From dc28b924151374776aefa04935379ad095eb4c06 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 23 Feb 2012 13:01:16 +0100 Subject: Core: Random cleanup + compile fix --- src/server/scripts/Commands/cs_account.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 7372c92c4dd..df83fe8118f 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -502,11 +502,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)); -- cgit v1.2.3 From 1ebdc5c19cc871ab2e00e75c3e477972151c8e7f Mon Sep 17 00:00:00 2001 From: leak Date: Sat, 25 Feb 2012 22:05:47 +0100 Subject: Core/Warden: Add reload ability for character.warden_action table / Centralize the crypto keys in one header file --- src/server/game/Warden/Modules/WardenModuleWin.h | 2389 +++++++++++----------- src/server/game/Warden/WardenCheckMgr.cpp | 50 +- src/server/game/Warden/WardenCheckMgr.h | 2 +- src/server/game/Warden/WardenWin.cpp | 36 +- src/server/game/World/World.cpp | 3 + src/server/scripts/Commands/cs_reload.cpp | 17 + 6 files changed, 1275 insertions(+), 1222 deletions(-) (limited to 'src/server/scripts/Commands') 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,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x7A, - 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, 0x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, 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/WardenCheckMgr.cpp b/src/server/game/Warden/WardenCheckMgr.cpp index 589b666c035..29f29fe5b88 100644 --- a/src/server/game/Warden/WardenCheckMgr.cpp +++ b/src/server/game/Warden/WardenCheckMgr.cpp @@ -28,7 +28,6 @@ WardenCheckMgr::WardenCheckMgr() { - InternalDataID = 1; } WardenCheckMgr::~WardenCheckMgr() @@ -151,31 +150,48 @@ void WardenCheckMgr::LoadWardenChecks() } 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 - { - fields = overrideResult->Fetch(); + sLog->outString(">> Loaded 0 Warden action overrides. DB table `warden_action` is empty!"); + sLog->outString(); + return; + } + + Field* fields = result->Fetch(); - uint16 checkId = fields[0].GetUInt16(); + uint32 count = 0; - // 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 + { + fields = result->Fetch(); - ++overrideCount; + uint16 checkId = fields[0].GetUInt16(); + uint8 action = fields[1].GetUInt8(); + + // 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..1b790d16716 100644 --- a/src/server/game/Warden/WardenCheckMgr.h +++ b/src/server/game/Warden/WardenCheckMgr.h @@ -58,11 +58,11 @@ class WardenCheckMgr WardenCheck* GetWardenDataById(uint16 Id); WardenCheckResult* GetWardenResultById(uint16 Id); - uint32 InternalDataID; std::vector MemChecksIdPool; std::vector OtherChecksIdPool; void LoadWardenChecks(); + void LoadWardenOverrides(); private: CheckContainer CheckStore; diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp index a77c77a3261..53d167082d6 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); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 61757b4fab2..fcdb6b7fcd6 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1743,6 +1743,9 @@ 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"); diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 17c819f2f22..361d329ac6b 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 { @@ -151,6 +152,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 }, @@ -724,6 +726,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!"); -- cgit v1.2.3 From d38bc3a17857c36a3ab871deac57b314987194bb Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 27 Feb 2012 14:58:47 +0100 Subject: Core: Rename GetCreatureInfo to GetCreatureTemplate and minor cleanup here and there --- src/server/game/AI/CreatureAISelector.cpp | 2 +- src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 4 +- .../game/AI/ScriptedAI/ScriptedFollowerAI.cpp | 6 +- src/server/game/AI/SmartScripts/SmartAI.cpp | 4 +- src/server/game/Battlegrounds/ArenaTeam.cpp | 24 +-- src/server/game/Entities/Creature/Creature.cpp | 64 ++++---- src/server/game/Entities/Creature/Creature.h | 22 +-- src/server/game/Entities/Item/Item.cpp | 26 ++-- src/server/game/Entities/Object/Object.cpp | 2 +- src/server/game/Entities/Pet/Pet.cpp | 22 +-- src/server/game/Entities/Player/Player.cpp | 73 +++++----- src/server/game/Entities/Player/Player.h | 14 +- src/server/game/Entities/Unit/StatSystem.cpp | 4 +- src/server/game/Entities/Unit/Unit.cpp | 52 +++---- src/server/game/Entities/Vehicle/Vehicle.cpp | 2 +- src/server/game/Events/GameEventMgr.cpp | 2 +- src/server/game/Groups/Group.cpp | 3 +- src/server/game/Handlers/ItemHandler.cpp | 1 - src/server/game/Handlers/LootHandler.cpp | 25 ++-- src/server/game/Handlers/MiscHandler.cpp | 34 ++--- src/server/game/Handlers/NPCHandler.cpp | 4 +- src/server/game/Handlers/QuestHandler.cpp | 2 +- src/server/game/Loot/LootMgr.cpp | 162 ++++++++++----------- src/server/game/Miscellaneous/Formulas.h | 4 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 6 +- src/server/game/Spells/Spell.cpp | 4 +- src/server/game/Spells/SpellEffects.cpp | 6 +- src/server/scripts/Commands/cs_learn.cpp | 2 +- src/server/scripts/Commands/cs_npc.cpp | 6 +- .../EasternKingdoms/BlackrockSpire/boss_gyth.cpp | 2 +- .../Karazhan/boss_prince_malchezaar.cpp | 4 +- .../EasternKingdoms/ScarletEnclave/chapter1.cpp | 4 +- .../EasternKingdoms/ZulGurub/boss_arlokk.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_marli.cpp | 4 +- .../EasternKingdoms/ZulGurub/boss_thekal.cpp | 2 +- .../TrialOfTheCrusader/boss_anubarak_trial.cpp | 4 +- .../IcecrownCitadel/boss_the_lich_king.cpp | 2 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 2 +- .../scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp | 10 +- .../Northrend/Ulduar/Ulduar/boss_razorscale.cpp | 2 +- src/server/scripts/Northrend/borean_tundra.cpp | 2 +- src/server/scripts/Northrend/zuldrak.cpp | 4 +- .../scripts/Outland/BlackTemple/boss_illidan.cpp | 2 +- .../scripts/Outland/blades_edge_mountains.cpp | 2 +- src/server/scripts/Spells/spell_dk.cpp | 2 +- src/server/scripts/World/mob_generic_creature.cpp | 2 +- src/server/scripts/World/npcs_special.cpp | 2 +- 47 files changed, 318 insertions(+), 318 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp index ab616d78a8c..f64bb320542 100755 --- a/src/server/game/AI/CreatureAISelector.cpp +++ b/src/server/game/AI/CreatureAISelector.cpp @@ -102,7 +102,7 @@ namespace FactorySelector MovementGenerator* selectMovementGenerator(Creature* creature) { MovementGeneratorRegistry& mv_registry(*MovementGeneratorRepository::instance()); - ASSERT(creature->GetCreatureInfo() != NULL); + ASSERT(creature->GetCreatureTemplate() != NULL); const MovementGeneratorCreator* mv_factory = mv_registry.GetRegistryItem(creature->GetDefaultMovementType()); /* if (mv_factory == NULL) diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 01e13b29f19..1e0c3f5c1fc 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 @@ -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(); diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index d83ad9b756c..e0fe12082f1 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 @@ -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/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 8776090c86f..50c7aba0360 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -524,7 +524,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 +561,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(); diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index a5c34e4b7ee..05fef44f676 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -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); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 20bcfc8f41c..0fe2016950b 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -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 { @@ -342,7 +342,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 +352,14 @@ 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); - SelectLevel(GetCreatureInfo()); + SelectLevel(GetCreatureTemplate()); if (team == HORDE) setFaction(cInfo->faction_H); else @@ -754,7 +754,7 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, 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); @@ -783,7 +783,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 (GetCreatureTemplate()->InhabitType & INHABIT_AIR) { if (GetDefaultMovementType() == IDLE_MOTION_TYPE) AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); @@ -791,10 +791,10 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, SetFlying(true); } - if (GetCreatureInfo()->InhabitType & INHABIT_WATER) + if (GetCreatureTemplate()->InhabitType & INHABIT_WATER) AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); - LastUsedScriptID = GetCreatureInfo()->ScriptID; + LastUsedScriptID = GetCreatureTemplate()->ScriptID; // TODO: Replace with spell, handle from DB if (isSpiritHealer() || isSpiritGuide()) @@ -816,22 +816,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 +856,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 +879,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 +930,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 +1040,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 || @@ -1302,7 +1302,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; } @@ -1502,8 +1502,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); @@ -1529,11 +1529,11 @@ void Creature::setDeathState(DeathState s) SetFullHealth(); SetLootRecipient(NULL); ResetPlayerDamageReq(); - CreatureTemplate const* cinfo = GetCreatureInfo(); + CreatureTemplate const* cinfo = GetCreatureTemplate(); SetWalk(true); - if (GetCreatureInfo()->InhabitType & INHABIT_AIR) + if (GetCreatureTemplate()->InhabitType & INHABIT_AIR) AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING); - if (GetCreatureInfo()->InhabitType & INHABIT_WATER) + if (GetCreatureTemplate()->InhabitType & INHABIT_WATER) AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); ClearUnitState(uint32(UNIT_STATE_ALL_STATE)); @@ -1573,7 +1573,7 @@ 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); @@ -1634,11 +1634,11 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo) return false; // Spells that don't have effectMechanics. - if (!spellInfo->HasAnyEffectMechanic() && GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1))) + if (!spellInfo->HasAnyEffectMechanic() && 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,10 +1654,10 @@ 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); @@ -2015,7 +2015,7 @@ CreatureAddon const* Creature::GetCreatureAddon() const } // dependent from difficulty mode entry - return sObjectMgr->GetCreatureTemplateAddon(GetCreatureInfo()->Entry); + return sObjectMgr->GetCreatureTemplateAddon(GetCreatureTemplate()->Entry); } //creature_addon table @@ -2236,7 +2236,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); diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 40477de7c75..f986e09e7cb 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -457,17 +457,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; } @@ -496,7 +496,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; } @@ -505,7 +505,7 @@ class Creature : public Unit, public GridObject, public MapCreature if (isPet()) return false; - return GetCreatureInfo()->rank == CREATURE_ELITE_WORLDBOSS; + return GetCreatureTemplate()->rank == CREATURE_ELITE_WORLDBOSS; } bool IsDungeonBoss() const; @@ -558,7 +558,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; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 70b81593b56..0fc53a65258 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; @@ -780,20 +779,18 @@ 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; // Check all enchants for required level @@ -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); } diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index c98364ecb2d..c1ecc3b74e7 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -541,7 +541,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())) diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 566ee06218e..e7103e2cb70 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -180,7 +180,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()); @@ -692,7 +692,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()); @@ -704,7 +704,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!"); @@ -763,7 +763,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); @@ -997,7 +997,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; @@ -1405,7 +1405,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) @@ -1419,7 +1419,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)) @@ -1543,7 +1543,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 @@ -1771,9 +1771,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; default: return false; } @@ -1812,7 +1812,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 f5b7d487219..857ae4d845b 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -143,10 +143,8 @@ static uint32 copseReclaimDelay[MAX_DEATH_COUNT] = { 30, 60, 120 }; // == PlayerTaxi ================================================ PlayerTaxi::PlayerTaxi() -{ - // Taxi nodes - memset(m_taximask, 0, sizeof(m_taximask)); -} + : m_taximask() +{ } void PlayerTaxi::InitTaxiNodesForLevel(uint32 race, uint32 chrClass, uint8 level) { @@ -540,7 +538,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) @@ -1123,10 +1121,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; @@ -1148,7 +1146,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) if (iProto->GetMaxStackSize() < count) count = iProto->GetMaxStackSize(); } - StoreNewItemInBestSlots(item_id, count); + StoreNewItemInBestSlots(itemId, count); } } @@ -1589,14 +1587,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) @@ -1606,7 +1604,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) @@ -1625,16 +1623,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 { @@ -1643,13 +1641,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); @@ -2687,11 +2685,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 @@ -4458,7 +4456,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); } */ @@ -6222,7 +6220,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); @@ -6922,7 +6920,7 @@ void Player::RewardReputation(Unit* pVictim, float rate) if (pVictim->ToCreature()->IsReputationGainDisabled()) return; - ReputationOnKillEntry const* Rep = sObjectMgr->GetReputationOnKilEntry(pVictim->ToCreature()->GetCreatureInfo()->Entry); + ReputationOnKillEntry const* Rep = sObjectMgr->GetReputationOnKilEntry(pVictim->ToCreature()->GetCreatureTemplate()->Entry); if (!Rep) return; @@ -8845,7 +8843,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 @@ -8892,7 +8890,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 @@ -12007,7 +12005,7 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update { pItem->SetSoulboundTradeable(allowedLooters); pItem->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, GetTotalPlayedTime()); - m_itemSoulboundTradeable.push_back(pItem); + AddTradeableItem(pItem); // save data std::ostringstream ss; @@ -12450,7 +12448,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) @@ -13449,6 +13447,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) { @@ -14133,7 +14136,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: @@ -14406,7 +14409,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: @@ -17578,7 +17581,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 { @@ -19759,7 +19762,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); @@ -19853,7 +19856,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()); @@ -19939,7 +19942,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) @@ -22641,7 +22644,7 @@ bool Player::isHonorOrXPTarget(Unit* pVictim) { if (pVictim->ToCreature()->isTotem() || pVictim->ToCreature()->isPet() || - pVictim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) + pVictim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) return false; } return true; @@ -24001,7 +24004,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; @@ -24262,7 +24265,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; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 82bbd1b38d5..db055088808 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1337,6 +1337,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); @@ -1982,7 +1983,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 @@ -2015,9 +2016,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; } @@ -2026,7 +2027,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(); @@ -2037,7 +2038,7 @@ class Player : public Unit, public GridObject /*** PVP SYSTEM ***/ /*********************************************************/ void UpdateHonorFields(); - bool RewardHonor(Unit* pVictim, uint32 groupsize, int32 honor = -1, bool pvptoken = false); + bool RewardHonor(Unit* victim, 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 @@ -2331,7 +2332,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]; @@ -2414,6 +2415,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(); diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index c0bd5cb95a6..283ab2c9cf6 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -1019,12 +1019,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)) { diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f006b4c07c0..3af6d388ba9 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2014,7 +2014,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 @@ -2026,7 +2026,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 @@ -2045,7 +2045,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; @@ -2075,7 +2075,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; @@ -2189,7 +2189,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(); @@ -2327,7 +2327,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 @@ -9178,7 +9178,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()); @@ -10235,7 +10235,7 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 // ..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) @@ -12032,7 +12032,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(); } @@ -12051,12 +12051,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()) { @@ -12171,7 +12171,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_UNK26) return false; Player const* playerAffectingAttacker = HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) ? GetAffectingPlayer() : NULL; @@ -12258,7 +12258,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_UNK26))) return false; // PvP case @@ -12292,7 +12292,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_UNK26 || creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS; } return true; } @@ -12514,7 +12514,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 @@ -13200,7 +13200,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; } @@ -13209,7 +13209,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) @@ -13226,7 +13226,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; @@ -13310,7 +13310,7 @@ uint32 Unit::GetCreatureType() const return CREATURE_TYPE_HUMANOID; } else - return ToCreature()->GetCreatureInfo()->type; + return ToCreature()->GetCreatureTemplate()->type; } /*####################################### @@ -15393,10 +15393,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); @@ -15497,7 +15497,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); } @@ -15526,7 +15526,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 @@ -15935,7 +15935,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 @@ -16039,7 +16039,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)); @@ -16078,7 +16078,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); diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index 348ce132da8..6693af5c91f 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); diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 6f5dc0e511e..808da1ac791 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -1174,7 +1174,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/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index b24b5be014a..9879ef7ff3b 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() { } @@ -1727,7 +1728,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; diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 802597e14eb..2434ba6eaa7 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1262,7 +1262,6 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) } } } - } } diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 6508f08dc22..496eae34133 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -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/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index f220be7d2b5..aaa41ec3519 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -125,11 +125,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(); @@ -811,7 +811,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; } @@ -819,14 +819,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; } @@ -840,7 +840,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; } @@ -871,7 +871,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; } @@ -1325,7 +1325,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()); } @@ -1501,16 +1501,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; } } @@ -1558,14 +1558,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; diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 6a44c7ae5e2..5479791d341 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) { @@ -337,7 +337,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/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 05d945d3a93..6725992b48a 100755 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -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); diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 64e9b9a27e4..3522571775c 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -147,7 +147,6 @@ uint32 LootStore::LoadLootTable() // Adds current row to the template tab->second->AddEntry(storeitem); ++count; - } while (result->NextRow()); @@ -205,12 +204,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,16 +220,16 @@ 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()); } 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()); } // @@ -296,7 +295,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 { @@ -1420,8 +1418,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(); @@ -1429,18 +1427,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)); @@ -1456,7 +1454,7 @@ void LoadLootTemplates_Disenchant() uint32 oldMSTime = getMSTime(); - LootIdSet lootIdSet, loodIdSetUsed; + LootIdSet lootIdSet, lootIdSetUsed; uint32 count = LootTemplates_Disenchant.LoadAndCollectLootIds(lootIdSet); ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore(); @@ -1467,11 +1465,11 @@ 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 @@ -1490,17 +1488,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)); @@ -1516,8 +1514,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(); @@ -1525,18 +1523,18 @@ void LoadLootTemplates_Gameobject() { if (uint32 lootid = itr->second.GetLootId()) { - if (sObjectMgr->IsGoOfSpecificEntrySpawned(itr->second.entry) && ids_set.find(lootid) == ids_set.end()) + if (sObjectMgr->IsGoOfSpecificEntrySpawned(itr->second.entry) && 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)); @@ -1552,17 +1550,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)); @@ -1578,8 +1576,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(); @@ -1588,12 +1586,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)); @@ -1609,8 +1607,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(); @@ -1618,18 +1616,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)); @@ -1645,8 +1643,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(); @@ -1655,12 +1653,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)); @@ -1676,17 +1674,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)); @@ -1702,8 +1700,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(); @@ -1711,18 +1709,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)); @@ -1738,8 +1736,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) @@ -1752,7 +1750,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 @@ -1762,11 +1760,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)); @@ -1781,24 +1779,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/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index 4faacc1f7b7..bf00514000e 100755 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -162,8 +162,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/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index cb79bd00776..8403bc3deb7 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5912,15 +5912,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(); } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index e2cd360b844..4f4de7c72cd 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5098,7 +5098,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(); @@ -5366,7 +5366,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()) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 2f04099f86b..511d2877f24 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2438,8 +2438,8 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) 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); @@ -5521,7 +5521,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); 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_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 57932ef56c6..67ac6f8ff76 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -462,7 +462,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; @@ -547,7 +547,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) @@ -1148,7 +1148,7 @@ public: return false; } - CreatureTemplate const* cInfo = creatureTarget->GetCreatureInfo(); + CreatureTemplate const* cInfo = creatureTarget->GetCreatureTemplate(); if (!cInfo->isTameable (player->CanTameExoticPets())) { diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp index 0d8cabcf89c..22f3513b157 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp @@ -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/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 14add92fd16..35a9f854d58 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -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/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 342c0d18dc9..a264c7afa98 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -108,7 +108,7 @@ public: 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; @@ -878,7 +878,7 @@ public: npc_scarlet_miner_cartAI(Creature* c) : PassiveAI(c), 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; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp index 27ddc215543..737a8fade57 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -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); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp index 38d9be78f2a..d0f1aea21ba 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp @@ -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); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index 4185ba2f3e7..dc9521b028b 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -201,7 +201,7 @@ class boss_thekal : public CreatureScript 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); 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..7dcdaa28879 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -572,7 +572,7 @@ class mob_frost_sphere : public CreatureScript _isFalling = false; me->SetReactState(REACT_PASSIVE); me->SetFlying(true); - me->SetDisplayId(me->GetCreatureInfo()->Modelid2); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); me->SetSpeed(MOVE_RUN, 0.5f, false); me->GetMotionMaster()->MoveRandom(20.0f); DoCast(SPELL_FROST_SPHERE); @@ -604,7 +604,7 @@ 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); 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 7ca371d1c82..e0fa0e2b75a 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -1222,7 +1222,7 @@ 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); 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 aae1995e204..408ebf3cc96 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -577,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(); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index 33f50d0b3de..60c4ec68e82 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); } @@ -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_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index 7ad859e3e8d..d245c77b9df 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() diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index a8fcd6139da..e97cc5e205b 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -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; diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zuldrak.cpp index 1bf04bc624c..835ad144501 100644 --- a/src/server/scripts/Northrend/zuldrak.cpp +++ b/src/server/scripts/Northrend/zuldrak.cpp @@ -92,7 +92,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 +156,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); diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index b0a42614ee3..de9ef5cd67f 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -502,7 +502,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]) diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index f99851f013e..bd23b06a5ea 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -523,7 +523,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()); } } diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index eb42b377128..ee554f4875a 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -341,7 +341,7 @@ class spell_dk_death_pact : public SpellScriptLoader { 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; diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp index 3a61b9f9e18..ce8b0a2de14 100644 --- a/src/server/scripts/World/mob_generic_creature.cpp +++ b/src/server/scripts/World/mob_generic_creature.cpp @@ -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); diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 8513eae5876..10bc722fc1b 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1650,7 +1650,7 @@ public: { SpellTimer = 0; - CreatureTemplate const* Info = me->GetCreatureInfo(); + CreatureTemplate const* Info = me->GetCreatureTemplate(); IsViper = Info->Entry == C_VIPER ? true : false; -- cgit v1.2.3 From b939ea59514489d6fc5e92eb47aa0b5d864b9695 Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 1 Mar 2012 12:16:06 +0100 Subject: Script/Commands: Some safer code in wp modify --- src/server/scripts/Commands/cs_wp.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index 8f5e862555c..9249cb3fdbc 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -223,6 +223,7 @@ public: sWaypointMgr->ReloadPath(id); return true; } + static bool HandleWpUnLoadCommand(ChatHandler* handler, const char* /*args*/) { @@ -605,7 +606,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 +616,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 +642,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 +656,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 +680,7 @@ public: { handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT); delete wpCreature2; + wpCreature2 = NULL; return false; } //sMapMgr->GetMap(npcCreature->GetMapId())->Add(wpCreature2); -- cgit v1.2.3 From d1e4eb051239c51f84e07938077da82f99367e8d Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 3 Mar 2012 16:12:28 +0100 Subject: Core/Commands: Implement .debug moveflags command. With params you can set MoveFlags and MoveFlagsExtra for targeted unit. Without params it will display the current MoveFlags and MoveFlagsExtra. Useful for debugging upcoming changes. --- sql/updates/world/2012_03_03_00_world_command.sql | 9 ++++++ src/server/game/Miscellaneous/Language.h | 4 ++- src/server/scripts/Commands/cs_debug.cpp | 34 +++++++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_03_03_00_world_command.sql (limited to 'src/server/scripts/Commands') diff --git a/sql/updates/world/2012_03_03_00_world_command.sql b/sql/updates/world/2012_03_03_00_world_command.sql new file mode 100644 index 00000000000..52938c0b76b --- /dev/null +++ b/sql/updates/world/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/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index e751dbf92fe..547f1679b61 100755 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -811,7 +811,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/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 8ca40231090..d4c94061e01 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -89,6 +89,7 @@ public: { "itemexpire", SEC_ADMINISTRATOR, false, &HandleDebugItemExpireCommand, "", NULL }, { "areatriggers", SEC_ADMINISTRATOR, false, &HandleDebugAreaTriggersCommand, "", NULL }, { "los", SEC_MODERATOR, false, &HandleDebugLoSCommand, "", NULL }, + { "moveflags", SEC_ADMINISTRATOR, false, &HandleDebugMoveflagsCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = @@ -1283,6 +1284,39 @@ 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()); + } + } }; void AddSC_debug_commandscript() -- cgit v1.2.3 From cbee39a4dcece9dc5722e7cc8a30d3365c1057d1 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 3 Mar 2012 16:23:16 +0100 Subject: Fix a warning. --- src/server/scripts/Commands/cs_debug.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index d4c94061e01..9646a881fc0 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1316,6 +1316,8 @@ public: target->SendMovementFlagUpdate(); handler->PSendSysMessage(LANG_MOVEFLAGS_SET, target->GetUnitMovementFlags(), target->GetExtraUnitMovementFlags()); } + + return true; } }; -- cgit v1.2.3 From 96a05600c4eec194d274857547396e3f39c814d7 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Mon, 5 Mar 2012 23:25:32 +0100 Subject: Core/Commands: add command to reload locales_creature_text --- sql/updates/world/2012_03_06_00_world_commands.sql | 3 +++ src/server/scripts/Commands/cs_reload.cpp | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 sql/updates/world/2012_03_06_00_world_commands.sql (limited to 'src/server/scripts/Commands') diff --git a/sql/updates/world/2012_03_06_00_world_commands.sql b/sql/updates/world/2012_03_06_00_world_commands.sql new file mode 100644 index 00000000000..d782a76c70d --- /dev/null +++ b/sql/updates/world/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/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 361d329ac6b..b6e15ca25ea 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -106,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 }, @@ -319,6 +320,7 @@ public: { HandleReloadLocalesAchievementRewardCommand(handler, "a"); HandleReloadLocalesCreatureCommand(handler, "a"); + HandleReloadLocalesCreatureTextCommand(handler, "a"); HandleReloadLocalesGameobjectCommand(handler, "a"); HandleReloadLocalesGossipMenuOptionCommand(handler, "a"); HandleReloadLocalesItemCommand(handler, "a"); @@ -1171,6 +1173,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 ... "); -- cgit v1.2.3 From a153e0ca06698e95a35714964c51abadbd72e3c2 Mon Sep 17 00:00:00 2001 From: click Date: Wed, 7 Mar 2012 00:05:34 +0100 Subject: Core: Remove some whitespace and tabs --- src/server/game/Conditions/ConditionMgr.cpp | 2 +- src/server/game/Conditions/ConditionMgr.h | 4 ++-- src/server/game/Handlers/CalendarHandler.cpp | 2 +- .../Movement/MovementGenerators/TargetedMovementGenerator.cpp | 4 ++-- src/server/game/Spells/Spell.cpp | 2 +- src/server/scripts/Commands/cs_debug.cpp | 6 +++--- .../scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp | 4 ++-- src/server/scripts/Spells/spell_warlock.cpp | 2 +- src/tools/vmap4_extractor/model.cpp | 2 +- src/tools/vmap4_extractor/mpq_libmpq04.h | 10 +++++----- src/tools/vmap4_extractor/vmapexport.h | 4 ++-- 11 files changed, 21 insertions(+), 21 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 755b9299352..eadcc5c5fbb 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -1294,7 +1294,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) default: break; } - + switch (spellInfo->Effects[i].TargetB.GetSelectionCategory()) { case TARGET_SELECT_CATEGORY_NEARBY: diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index ec6d6dd8453..2df79eab088 100755 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -89,10 +89,10 @@ enum ConditionTypes 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: + 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 + 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. diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index c9e99af6fed..64acc512add 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -207,7 +207,7 @@ void WorldSession::HandleCalendarGuildFilter(WorldPacket& recvData) void WorldSession::HandleCalendarArenaTeam(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_ARENA_TEAM [" UI64FMTD "]", _player->GetGUID()); - + int32 unk1; recvData >> unk1; diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index 064a8fc8297..6d507a3b694 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 diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 2ffa94371f9..65ab9444f58 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6444,7 +6444,7 @@ void Spell::UpdatePointers() SpellDestination& dest = m_destTargets[effIndex]; if (!dest._transportGUID) continue; - + if (!transport || transport->GetGUID() != dest._transportGUID) transport = ObjectAccessor::GetWorldObject(*m_caster, dest._transportGUID); diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 9646a881fc0..814b18389a7 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1303,10 +1303,10 @@ public: return false; char* mask2 = strtok(NULL, " \n"); - + uint32 moveFlags = (uint32)atoi(mask1); target->SetUnitMovementFlags(moveFlags); - + if (mask2) { uint32 moveFlagsExtra = uint32(atoi(mask2)); @@ -1316,7 +1316,7 @@ public: target->SendMovementFlagUpdate(); handler->PSendSysMessage(LANG_MOVEFLAGS_SET, target->GetUnitMovementFlags(), target->GetExtraUnitMovementFlags()); } - + return true; } }; diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 64060464d7c..e03440cec98 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -241,7 +241,7 @@ public: _cannotMove = true; me->SetFlying(true); - + if (instance) instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } @@ -362,7 +362,7 @@ public: 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); } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 5ae630fcd68..e4593be295c 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -449,7 +449,7 @@ class spell_warl_demonic_circle_summon : public SpellScriptLoader { if (GameObject* circle = GetTarget()->GetGameObject(GetId())) { - // Here we check if player is in demonic circle teleport range, if so add + // 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. diff --git a/src/tools/vmap4_extractor/model.cpp b/src/tools/vmap4_extractor/model.cpp index ac28e1ff086..e81972f521f 100644 --- a/src/tools/vmap4_extractor/model.cpp +++ b/src/tools/vmap4_extractor/model.cpp @@ -167,7 +167,7 @@ ModelInstance::ModelInstance(MPQFile &f,const char* ModelInstName, uint32 mapID, uint16 adtId = 0;// not used for models uint32 flags = MOD_M2; - if(tileX == 65 && tileY == 65) flags |= MOD_WORLDSPAWN; + if(tileX == 65 && tileY == 65) flags |= MOD_WORLDSPAWN; //write mapID, tileX, tileY, Flags, ID, Pos, Rot, Scale, name fwrite(&mapID, sizeof(uint32), 1, pDirfile); fwrite(&tileX, sizeof(uint32), 1, pDirfile); diff --git a/src/tools/vmap4_extractor/mpq_libmpq04.h b/src/tools/vmap4_extractor/mpq_libmpq04.h index 4b0a2465bfd..ed51022de78 100644 --- a/src/tools/vmap4_extractor/mpq_libmpq04.h +++ b/src/tools/vmap4_extractor/mpq_libmpq04.h @@ -24,14 +24,14 @@ public: 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); + 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.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 }; -- cgit v1.2.3 From e5d23103f37c40d2e946fa0e2db66d2f527ad9af Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 7 Mar 2012 13:09:35 +0100 Subject: Core/Maps * Corrected liquid type extraction in maps - MCLQ chunk must be parsed together with MH2O (they stack) * Fixed liquid detection in WMO objects * Implemented LiquidType.dbc use, players will now get proper auras in special liquids * Turned off slime damage by default (Naxxramas uses periodic damage aura for this purpose) * Implemented liquid type overrides basing on area/zone * Renamed final temp_gameobject_models to GameObjectModels.dtree (the temporary one produced by vmap extractor remains unaffected) Note: Map and Vmap re-extraction is required --- .../world/2012_03_07_00_world_trinity_string.sql | 3 + src/server/collision/Management/VMapManager2.cpp | 2 +- src/server/collision/Maps/TileAssembler.cpp | 2 +- src/server/collision/Models/WorldModel.cpp | 3 +- src/server/collision/VMapDefinitions.h | 6 +- src/server/game/DataStores/DBCStores.cpp | 3 +- src/server/game/DataStores/DBCStores.h | 2 +- src/server/game/DataStores/DBCStructure.h | 42 ++--- src/server/game/DataStores/DBCfmt.h | 4 +- src/server/game/Entities/Player/Player.cpp | 48 ++++-- src/server/game/Entities/Player/Player.h | 1 + src/server/game/Maps/Map.cpp | 123 +++++++++++---- src/server/game/Maps/Map.h | 6 +- src/server/scripts/Commands/cs_gps.cpp | 2 +- src/tools/map_extractor/System.cpp | 173 +++++++++++---------- src/tools/vmap4_extractor/vmapexport.cpp | 2 +- src/tools/vmap4_extractor/wmo.cpp | 48 +++++- 17 files changed, 310 insertions(+), 160 deletions(-) create mode 100644 sql/updates/world/2012_03_07_00_world_trinity_string.sql (limited to 'src/server/scripts/Commands') diff --git a/sql/updates/world/2012_03_07_00_world_trinity_string.sql b/sql/updates/world/2012_03_07_00_world_trinity_string.sql new file mode 100644 index 00000000000..96344520236 --- /dev/null +++ b/sql/updates/world/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.'); \ No newline at end of file diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp index 62abc31831a..6139a27fb52 100644 --- a/src/server/collision/Management/VMapManager2.cpp +++ b/src/server/collision/Management/VMapManager2.cpp @@ -233,7 +233,7 @@ namespace VMAP { floor = info.ground_Z; ASSERT(floor < std::numeric_limits::max()); - type = info.hitModel->GetLiquidType(); + type = info.hitModel->GetLiquidType(); // entry from LiquidType.dbc if (reqLiquidType && !(type & reqLiquidType)) return false; if (info.hitInstance->GetLiquidLevel(pos, info, level)) 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/WorldModel.cpp b/src/server/collision/Models/WorldModel.cpp index d4b08dde5dd..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; } 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/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index b6c18103f1e..4fa8e09cead 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -119,7 +119,7 @@ DBCStorage sItemRandomSuffixStore(ItemRandomSuffixfmt); DBCStorage sItemSetStore(ItemSetEntryfmt); DBCStorage sLFGDungeonStore(LFGDungeonEntryfmt); -//DBCStorage sLiquidTypeStore(LiquidTypeEntryfmt); +DBCStorage sLiquidTypeStore(LiquidTypefmt); DBCStorage sLockStore(LockEntryfmt); DBCStorage sMailTemplateStore(MailTemplateEntryfmt); @@ -357,6 +357,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sItemSetStore, dbcPath, "ItemSet.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sLFGDungeonStore, dbcPath, "LFGDungeons.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sLiquidTypeStore, dbcPath, "LiquidType.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sLockStore, dbcPath, "Lock.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sMailTemplateStore, dbcPath, "MailTemplate.dbc"); diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 58c85adc11b..0bbf06c5311 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -119,7 +119,7 @@ extern DBCStorage sItemRandomPropertiesStore; extern DBCStorage sItemRandomSuffixStore; extern DBCStorage sItemSetStore; extern DBCStorage sLFGDungeonStore; -//extern DBCStorage sLiquidTypeStore; +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 0d721e3f832..1e52866539a 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -527,6 +527,7 @@ struct AreaTableEntry char* area_name[16]; // 11-26 // 27, string flags, unused uint32 team; // 28 + uint32 LiquidTypeOverride[4]; // 29-32 liquid override by type // helpers bool IsSanctuary() const @@ -1214,30 +1215,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 maxDarkenDepth // 6 Only Slime (6) and Magma (7) - float fogDarkenIntensity // 7 Only oceans got values here! - float ambDarkenIntensity // 8 Only oceans got values here! - float dirDarkenIntensity // 9 Only oceans got values here! - uint32 lightID // 10 Only Slime (6) and Magma (7) - float particleScale // 11 0: Slime, 1: Water/Ocean, 4: Magma - uint32 particleMovement // 12 - uint32 particleTexSlots // 13 - uint32 LiquidMaterialID // 14 Reference to LiquidMaterial.dbc - char* texture[6]; // 15-20 - uint32 color[2] // 21-22 - float floats[18]; // 23-40 Most likely these are attributes for the shaders. Water: (23, TextureTilesPerBlock),(24, Rotation) Magma: (23, AnimationX),(24, AnimationY) - uint32 ints[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 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 54be02a619e..ce887cac09b 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -23,7 +23,7 @@ const char Achievementfmt[]="niixssssssssssssssssxxxxxxxxxxxxxxxxxxiixixxxxxxxxx const std::string CustomAchievementfmt="pppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaapapaaaaaaaaaaaaaaaaaapp"; const std::string CustomAchievementIndex = "ID"; const char AchievementCriteriafmt[]="niiiiiiiixxxxxxxxxxxxxxxxxiiiix"; -const char AreaTableEntryfmt[]="iiinixxxxxissssssssssssssssxixxxxxxx"; +const char AreaTableEntryfmt[]="iiinixxxxxissssssssssssssssxiiiiixxx"; const char AreaGroupEntryfmt[]="niiiiiii"; const char AreaPOIEntryfmt[]="niiiiiiiiiiifffixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxix"; const char AreaTriggerEntryfmt[]="niffffffff"; @@ -78,7 +78,7 @@ const char ItemRandomPropertiesfmt[]="nxiiixxssssssssssssssssx"; const char ItemRandomSuffixfmt[]="nssssssssssssssssxxiiixxiiixx"; const char ItemSetEntryfmt[]="dssssssssssssssssxiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii"; const char LFGDungeonEntryfmt[]="nxxxxxxxxxxxxxxxxxiiiiiiixixxixixxxxxxxxxxxxxxxxx"; -//const char LiquidTypeEntryfmt[]="nsiiiiffffifiiisssssiiffffffffffffffffffiiii"; +const char LiquidTypefmt[]="nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; const char MailTemplateEntryfmt[]="nxxxxxxxxxxxxxxxxxssssssssssssssssx"; const char MapEntryfmt[]="nxixxssssssssssssssssxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixiffxiix"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 870b6f683b8..729a2fe0b00 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -724,6 +724,7 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep for (uint8 i=0; iSpellId)) { // 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; @@ -1434,8 +1435,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); } } } @@ -23059,15 +23060,34 @@ 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) + AddAura(liquid->SpellId, this); + + _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; @@ -23076,23 +23096,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; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 3d510148aa4..362fd8a9016 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2813,6 +2813,7 @@ class Player : public Unit, public GridObject uint32 m_lastFallTime; float m_lastFallZ; + LiquidTypeEntry const* _lastLiquid; int32 m_MirrorTimer[MAX_TIMERS]; uint8 m_MirrorTimerFlags; uint8 m_MirrorTimerFlagsLast; diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 00b52bf746b..7f27a474534 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -41,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'} }; @@ -1044,7 +1044,8 @@ GridMap::GridMap() _liquidWidth = 0; _liquidHeight = 0; _liquidLevel = INVALID_HEIGHT; - _liquidData = NULL; + _liquidEntry = NULL; + _liquidFlags = NULL; _liquidMap = NULL; } @@ -1106,12 +1107,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; } @@ -1192,18 +1195,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; } @@ -1462,23 +1469,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 @@ -1489,7 +1497,37 @@ 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) + if (area = GetAreaEntryByAreaID(area->zone)) + 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; @@ -1518,20 +1556,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; @@ -1722,8 +1760,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); @@ -1733,20 +1772,46 @@ 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) + if (area = GetAreaEntryByAreaID(area->zone)) + 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; } @@ -1760,7 +1825,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; } } diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index d8db4c947a3..d0f99610262 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; diff --git a/src/server/scripts/Commands/cs_gps.cpp b/src/server/scripts/Commands/cs_gps.cpp index 589ed4af3b8..59e2ec90905 100644 --- a/src/server/scripts/Commands/cs_gps.cpp +++ b/src/server/scripts/Commands/cs_gps.cpp @@ -122,7 +122,7 @@ public: 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); + handler->PSendSysMessage(LANG_LIQUID_STATUS, liquidStatus.level, liquidStatus.depth_level, liquidStatus.entry, liquidStatus.type_flags, status); return true; } diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 335fd924be8..bbde9f4675e 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -276,7 +276,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"; @@ -359,7 +359,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]; @@ -378,7 +379,8 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 } 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; @@ -612,13 +614,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) @@ -626,41 +690,41 @@ 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); 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); @@ -681,72 +745,16 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 } } } - else - { - // Get from MCLQ chunk (old) - for (int i=0;igetMCNK(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_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; - } - } - } - } - } - //============================================ // Pack liquid data //============================================ - uint8 type = liquid_type[0][0]; + uint8 type = liquid_flags[0][0]; bool fullType = false; for (int y=0;yliquidType & 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 f495e0efe4aff18d702fdc74ecc4f43e249aea9a Mon Sep 17 00:00:00 2001 From: Spp Date: Wed, 7 Mar 2012 14:08:30 +0100 Subject: Warning fixes and some random cleanup here and there --- src/server/game/Guilds/Guild.cpp | 94 ++++++------ src/server/game/Guilds/GuildMgr.cpp | 1 - src/server/game/Handlers/LootHandler.cpp | 4 +- src/server/game/Scripting/MapScripts.cpp | 82 +++++------ src/server/game/Texts/CreatureTextMgr.h | 2 + src/server/scripts/Commands/cs_debug.cpp | 10 +- src/server/scripts/Commands/cs_reload.cpp | 4 +- .../BlackrockDepths/blackrock_depths.cpp | 85 ++++++----- .../BlackrockDepths/boss_ambassador_flamelash.cpp | 4 +- .../BlackrockDepths/boss_anubshiah.cpp | 10 +- .../boss_emperor_dagran_thaurissan.cpp | 8 +- .../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 | 4 +- .../BlackrockDepths/boss_moira_bronzebeard.cpp | 8 +- .../BlackrockDepths/boss_tomb_of_seven.cpp | 14 +- .../BlackrockDepths/instance_blackrock_depths.cpp | 84 +++++------ .../BlackwingLair/boss_broodlord_lashlayer.cpp | 8 +- .../BlackwingLair/boss_nefarian.cpp | 14 +- .../BlackwingLair/boss_vaelastrasz.cpp | 32 ++-- .../BlackwingLair/boss_victor_nefarius.cpp | 18 +-- .../EasternKingdoms/Deadmines/boss_mr_smite.cpp | 3 - .../EasternKingdoms/Deadmines/deadmines.cpp | 3 +- .../scripts/EasternKingdoms/Deadmines/deadmines.h | 1 - .../EasternKingdoms/Gnomeregan/gnomeregan.cpp | 4 +- .../EasternKingdoms/Karazhan/bosses_opera.cpp | 4 +- .../scripts/EasternKingdoms/Karazhan/karazhan.cpp | 8 +- .../MagistersTerrace/magisters_terrace.cpp | 4 +- .../MoltenCore/boss_majordomo_executus.cpp | 2 +- .../EasternKingdoms/ScarletEnclave/chapter1.cpp | 4 +- .../EasternKingdoms/ScarletEnclave/chapter5.cpp | 4 +- .../ScarletMonastery/boss_interrogator_vishas.cpp | 2 +- .../ShadowfangKeep/shadowfang_keep.cpp | 4 +- .../EasternKingdoms/ZulAman/boss_janalai.cpp | 6 +- .../scripts/EasternKingdoms/ZulAman/zulaman.cpp | 4 +- .../EasternKingdoms/ZulGurub/boss_venoxis.cpp | 4 +- .../scripts/EasternKingdoms/blasted_lands.cpp | 5 +- src/server/scripts/EasternKingdoms/boss_kruul.cpp | 1 - .../scripts/EasternKingdoms/burning_steppes.cpp | 5 +- src/server/scripts/EasternKingdoms/duskwood.cpp | 2 - .../EasternKingdoms/eastern_plaguelands.cpp | 13 +- .../scripts/EasternKingdoms/eversong_woods.cpp | 6 - src/server/scripts/EasternKingdoms/ghostlands.cpp | 10 +- src/server/scripts/EasternKingdoms/hinterlands.cpp | 2 - src/server/scripts/EasternKingdoms/ironforge.cpp | 5 +- .../scripts/EasternKingdoms/isle_of_queldanas.cpp | 2 - src/server/scripts/EasternKingdoms/loch_modan.cpp | 5 +- .../scripts/EasternKingdoms/redridge_mountains.cpp | 1 - .../scripts/EasternKingdoms/silvermoon_city.cpp | 1 - .../scripts/EasternKingdoms/silverpine_forest.cpp | 3 - .../scripts/EasternKingdoms/stormwind_city.cpp | 15 +- .../scripts/EasternKingdoms/stranglethorn_vale.cpp | 1 - .../scripts/EasternKingdoms/tirisfal_glades.cpp | 3 - src/server/scripts/EasternKingdoms/undercity.cpp | 9 +- .../EasternKingdoms/western_plaguelands.cpp | 13 +- src/server/scripts/EasternKingdoms/westfall.cpp | 2 - src/server/scripts/EasternKingdoms/wetlands.cpp | 2 - src/server/scripts/Examples/example_creature.cpp | 4 +- src/server/scripts/Examples/example_escort.cpp | 4 +- .../scripts/Examples/example_gossip_codebox.cpp | 10 +- src/server/scripts/Examples/example_spell.cpp | 2 +- .../BlackfathomDeeps/blackfathom_deeps.cpp | 2 +- .../CavernsOfTime/BattleForMountHyjal/hyjal.cpp | 12 +- .../CavernsOfTime/DarkPortal/dark_portal.cpp | 4 +- .../EscapeFromDurnholdeKeep/old_hillsbrad.cpp | 16 +- .../Kalimdor/RazorfenDowns/razorfen_downs.cpp | 6 +- .../Kalimdor/WailingCaverns/wailing_caverns.cpp | 4 +- .../scripts/Kalimdor/ZulFarrak/zulfarrak.cpp | 8 +- src/server/scripts/Kalimdor/azshara.cpp | 8 +- src/server/scripts/Kalimdor/azuremyst_isle.cpp | 4 +- src/server/scripts/Kalimdor/bloodmyst_isle.cpp | 4 +- src/server/scripts/Kalimdor/darkshore.cpp | 4 +- src/server/scripts/Kalimdor/dustwallow_marsh.cpp | 16 +- src/server/scripts/Kalimdor/felwood.cpp | 4 +- src/server/scripts/Kalimdor/feralas.cpp | 6 +- src/server/scripts/Kalimdor/moonglade.cpp | 12 +- src/server/scripts/Kalimdor/mulgore.cpp | 4 +- src/server/scripts/Kalimdor/orgrimmar.cpp | 4 +- src/server/scripts/Kalimdor/silithus.cpp | 8 +- .../scripts/Kalimdor/stonetalon_mountains.cpp | 6 +- src/server/scripts/Kalimdor/tanaris.cpp | 12 +- src/server/scripts/Kalimdor/the_barrens.cpp | 8 +- src/server/scripts/Kalimdor/thousand_needles.cpp | 4 +- src/server/scripts/Kalimdor/thunder_bluff.cpp | 4 +- src/server/scripts/Kalimdor/winterspring.cpp | 12 +- .../TrialOfTheChampion/trial_of_the_champion.cpp | 4 +- .../FrozenHalls/ForgeOfSouls/forge_of_souls.cpp | 8 +- .../HallsOfReflection/halls_of_reflection.cpp | 6 +- .../Northrend/Naxxramas/boss_four_horsemen.cpp | 8 +- .../scripts/Northrend/Nexus/Oculus/oculus.cpp | 8 +- .../Ulduar/HallsOfStone/halls_of_stone.cpp | 4 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 8 +- .../scripts/Northrend/VioletHold/violet_hold.cpp | 4 +- src/server/scripts/Northrend/borean_tundra.cpp | 22 +-- src/server/scripts/Northrend/dalaran.cpp | 6 +- src/server/scripts/Northrend/dragonblight.cpp | 4 +- src/server/scripts/Northrend/howling_fjord.cpp | 8 +- src/server/scripts/Northrend/icecrown.cpp | 8 +- src/server/scripts/Northrend/sholazar_basin.cpp | 16 +- src/server/scripts/Northrend/storm_peaks.cpp | 24 +-- src/server/scripts/Northrend/zuldrak.cpp | 8 +- .../scripts/Outland/BlackTemple/black_temple.cpp | 4 +- .../scripts/Outland/BlackTemple/boss_illidan.cpp | 4 +- .../Outland/BlackTemple/boss_shade_of_akama.cpp | 4 +- .../scripts/Outland/blades_edge_mountains.cpp | 16 +- src/server/scripts/Outland/hellfire_peninsula.cpp | 20 +-- src/server/scripts/Outland/nagrand.cpp | 4 +- src/server/scripts/Outland/netherstorm.cpp | 13 +- src/server/scripts/Outland/shadowmoon_valley.cpp | 37 ++--- src/server/scripts/Outland/shattrath_city.cpp | 35 ++--- src/server/scripts/Outland/terokkar_forest.cpp | 39 ++--- src/server/scripts/Outland/zangarmarsh.cpp | 20 +-- src/server/scripts/Spells/spell_warlock.cpp | 1 - src/server/scripts/World/areatrigger_scripts.cpp | 4 +- src/server/scripts/World/go_scripts.cpp | 12 +- src/server/scripts/World/guards.cpp | 1 - src/server/scripts/World/item_scripts.cpp | 14 +- src/server/scripts/World/npc_innkeeper.cpp | 6 +- src/server/scripts/World/npc_professions.cpp | 162 ++++++++++----------- src/server/scripts/World/npc_taxi.cpp | 11 +- src/server/scripts/World/npcs_special.cpp | 66 ++++----- 123 files changed, 684 insertions(+), 802 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 5691dcab862..f97b907828a 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1349,12 +1349,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); } } @@ -1499,17 +1499,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)); @@ -1525,10 +1525,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; @@ -1537,13 +1537,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; @@ -1552,8 +1552,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; @@ -1561,9 +1561,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()); } } @@ -1672,8 +1672,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) @@ -1699,10 +1699,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()); } @@ -1868,14 +1868,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; } @@ -2087,9 +2087,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; @@ -2099,25 +2099,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) { @@ -2174,8 +2174,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 !! @@ -2193,9 +2193,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; @@ -2338,8 +2338,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; } @@ -2452,15 +2452,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; } @@ -2470,18 +2470,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 67260daf638..106be2a605d 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -221,7 +221,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/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 496eae34133..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; diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index fb2590ebbfe..e73839c8071 100755 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -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) { @@ -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/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h index ddf10568411..8ed0b01fcd5 100755 --- a/src/server/game/Texts/CreatureTextMgr.h +++ b/src/server/game/Texts/CreatureTextMgr.h @@ -158,6 +158,8 @@ class CreatureTextLocalizer case CHAT_MSG_RAID_BOSS_WHISPER: data.put(whisperGUIDpos, player->GetGUID()); break; + default: + break; } player->SendDirectMessage(&data); diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 814b18389a7..679bb450800 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[] = { @@ -90,12 +90,12 @@ public: { "areatriggers", SEC_ADMINISTRATOR, false, &HandleDebugAreaTriggersCommand, "", NULL }, { "los", SEC_MODERATOR, false, &HandleDebugLoSCommand, "", NULL }, { "moveflags", SEC_ADMINISTRATOR, false, &HandleDebugMoveflagsCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { NULL, SEC_PLAYER, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { { "debug", SEC_MODERATOR, true, NULL, "", debugCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { NULL, SEC_PLAYER, false, NULL, "", NULL } }; return commandTable; } @@ -1198,7 +1198,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); diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index b6e15ca25ea..28920f7c109 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -153,7 +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 }, + { "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 }, @@ -728,7 +728,7 @@ public: return true; } - static bool HandleReloadWardenActionCommand(ChatHandler* handler, const char* /*args*/) + static bool HandleReloadWardenactionCommand(ChatHandler* handler, const char* /*args*/) { if (!sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED)) { diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp index 7ef11e5256a..15c418d2919 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; } @@ -183,24 +183,24 @@ public: { case 0: DoScriptText(SCRIPT_TEXT1, me);//2 - CanWalk = false; - Event_Timer = 5000; + CanWalk = false; + Event_Timer = 5000; break; case 1: DoScriptText(SCRIPT_TEXT2, me);//4 - CanWalk = false; - Event_Timer = 5000; + CanWalk = false; + Event_Timer = 5000; break; case 2: - CanWalk = false; + CanWalk = false; break; case 3: DoScriptText(SCRIPT_TEXT3, me);//5 break; case 4: DoScriptText(SCRIPT_TEXT4, me);//6 - CanWalk = false; - Event_Timer = 5000; + CanWalk = false; + Event_Timer = 5000; break; case 5: if (instance) @@ -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 @@ -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) @@ -619,7 +618,7 @@ public: 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->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); @@ -634,7 +633,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 +645,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); } @@ -767,7 +766,7 @@ public: instance->SetData(DATA_GATE_SC, 0); break; case 19: - 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); me->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR, 403.61f, -51.71f, -63.92f, 3.600434f, TEMPSUMMON_DEAD_DESPAWN, 0); @@ -810,13 +809,13 @@ public: } 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); } @@ -1065,7 +1064,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) @@ -1099,7 +1098,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_TOBIAS, ENCOUNTER_STATE_ENDED); @@ -1114,7 +1113,7 @@ public: case 2: instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; case 4: - me->SetVisibility(VISIBILITY_OFF); + 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); @@ -1127,13 +1126,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_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 +1216,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) @@ -1263,8 +1262,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..fea8657496b 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*/) @@ -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..52d78487776 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*/) {} 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..de520fa8a58 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); 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/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_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp index c4e0d6ea715..1e539449fe3 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) diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp index 4a72bd0ca38..5bcb6d051bb 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) 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/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp index 9830563ac87..aa62e1277f8 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp @@ -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..0d473a5adf1 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp @@ -45,7 +45,7 @@ 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) { @@ -55,7 +55,6 @@ public: 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/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp index cd5566007ee..12f2cef2d0b 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()); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index b15cb7d3da1..39be500e487 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -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); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 30fc8a2f9c4..b4345c61a77 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -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(); 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/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/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index a264c7afa98..a55694ad419 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -362,10 +362,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(); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 2df31971275..505bf2cbf5c 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(); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp index 058c688641f..4517b1741d4 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp @@ -83,7 +83,7 @@ public: 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/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp index dded75e193c..9cb30eda060 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(); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index dd2bef556c4..8bbcdd6c036 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -226,7 +226,7 @@ class boss_janalai : public CreatureScript 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 +251,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; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index bf951dd186c..df90f80db4c 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -157,10 +157,10 @@ 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)) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp index bd6f6ec4748..f9fdd3a9587 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); @@ -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/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..810875abf0c 100644 --- a/src/server/scripts/EasternKingdoms/boss_kruul.cpp +++ b/src/server/scripts/EasternKingdoms/boss_kruul.cpp @@ -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..fb6024f1cb5 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); @@ -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..a9f413268c2 100644 --- a/src/server/scripts/EasternKingdoms/duskwood.cpp +++ b/src/server/scripts/EasternKingdoms/duskwood.cpp @@ -60,7 +60,6 @@ public: } return false; }; - }; /*###### @@ -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..451648a0da9 100644 --- a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp @@ -60,7 +60,6 @@ public: me->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000); } }; - }; /*###### @@ -72,10 +71,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 +90,6 @@ public: player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*###### @@ -129,9 +127,7 @@ public: } void EnterCombat(Unit* /*who*/) {} - }; - }; /*###### @@ -148,10 +144,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 +181,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..b0ced22bd8b 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; @@ -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(); @@ -428,7 +425,6 @@ public: return true; } - }; /*###### @@ -512,7 +508,6 @@ public: } } }; - }; /*###### @@ -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 effc333d6f8..3bd781ce6f9 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; } - }; /*###### diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/hinterlands.cpp index a66a01e00e5..08abdc26725 100644 --- a/src/server/scripts/EasternKingdoms/hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/hinterlands.cpp @@ -146,7 +146,6 @@ public: summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); } }; - }; /*###### @@ -345,7 +344,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..109f4ba1729 100644 --- a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp +++ b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp @@ -85,7 +85,6 @@ public: } } }; - }; /*###### @@ -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 310ecbf7b66..f6aaa4e4712 100644 --- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp @@ -164,7 +164,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..de14416483c 100644 --- a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp +++ b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp @@ -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..558b02fc675 100644 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp @@ -94,7 +94,6 @@ public: DoScriptText(SAY_QUINN, Quinn); break;} case 26: DoScriptText(SAY_ON_BYE, me, NULL); break; - } } @@ -123,7 +122,6 @@ public: { return new npc_deathstalker_erlandAI(creature); } - }; /*###### @@ -309,7 +307,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 26267497aa1..ea62014f8a8 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; } - }; /*###### @@ -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; } - }; /*###### @@ -370,7 +367,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -457,7 +453,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -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..2862ba18bca 100644 --- a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp +++ b/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp @@ -114,7 +114,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### 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 1724572f796..bf3d07ad5ae 100644 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ b/src/server/scripts/EasternKingdoms/undercity.cpp @@ -143,7 +143,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -201,7 +200,6 @@ public: } } }; - }; /*###### @@ -219,15 +217,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 +250,6 @@ public: return true; } - }; /*###### diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp index 4ec8dbb647b..07766455495 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()); @@ -100,7 +100,6 @@ public: return true; } - }; /*###### @@ -121,10 +120,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 +148,6 @@ public: return true; } - }; /*###### @@ -229,7 +227,6 @@ public: } } }; - }; /*###### @@ -264,7 +261,6 @@ public: CAST_PLR(who)->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); } }; - }; /*###### @@ -395,7 +391,6 @@ public: m_uiChatTimer = 6000; } }; - }; /*###### diff --git a/src/server/scripts/EasternKingdoms/westfall.cpp b/src/server/scripts/EasternKingdoms/westfall.cpp index 271e1d99d63..f5a0f0e85c4 100644 --- a/src/server/scripts/EasternKingdoms/westfall.cpp +++ b/src/server/scripts/EasternKingdoms/westfall.cpp @@ -185,7 +185,6 @@ public: } else uiShootTimer -= diff; } }; - }; /*###### @@ -258,7 +257,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..e89b8fd7fba 100644 --- a/src/server/scripts/EasternKingdoms/wetlands.cpp +++ b/src/server/scripts/EasternKingdoms/wetlands.cpp @@ -132,7 +132,6 @@ public: } } }; - }; /*###### @@ -161,7 +160,6 @@ public: } return false; } - }; /*###### diff --git a/src/server/scripts/Examples/example_creature.cpp b/src/server/scripts/Examples/example_creature.cpp index f1b336f07f9..412211bd280 100644 --- a/src/server/scripts/Examples/example_creature.cpp +++ b/src/server/scripts/Examples/example_creature.cpp @@ -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..e22c2f85506 100644 --- a/src/server/scripts/Examples/example_escort.cpp +++ b/src/server/scripts/Examples/example_escort.cpp @@ -197,12 +197,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..8c721c141af 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); diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp index 3bfaa448b85..20f738c95ed 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) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp index 12485293650..28457b3b461 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); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp index 4ff34fc3349..63035ef2699 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp @@ -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/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp index f5745f0f894..71945f649cb 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(); @@ -581,16 +581,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(); diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp index ac9bf524e7a..5cf970e60f3 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()); diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp index 8eb3d20d528..ea2846185f8 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) diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index 98de619c127..f8b1364437b 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(); @@ -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 diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp index 2e621c4a3ba..802867f4171 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/azshara.cpp @@ -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(); @@ -267,10 +267,10 @@ 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(10994) == QUEST_STATUS_INCOMPLETE) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true); diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp index 09f4b9415a9..6f17ab16d15 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp @@ -195,10 +195,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); diff --git a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp index c114c02b16d..10555d252a6 100644 --- a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp @@ -101,10 +101,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); diff --git a/src/server/scripts/Kalimdor/darkshore.cpp b/src/server/scripts/Kalimdor/darkshore.cpp index a2c10b94ff9..0d83ea5ad03 100644 --- a/src/server/scripts/Kalimdor/darkshore.cpp +++ b/src/server/scripts/Kalimdor/darkshore.cpp @@ -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/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index 1a6ba36bbb1..94702a85d64 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -157,11 +157,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)) @@ -255,11 +255,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(); player->KilledMonsterCredit(NPC_THERAMORE_GUARD, 0); @@ -337,10 +337,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); @@ -377,10 +377,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; diff --git a/src/server/scripts/Kalimdor/felwood.cpp b/src/server/scripts/Kalimdor/felwood.cpp index 91d8a875f17..d540d522326 100644 --- a/src/server/scripts/Kalimdor/felwood.cpp +++ b/src/server/scripts/Kalimdor/felwood.cpp @@ -40,10 +40,10 @@ 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); diff --git a/src/server/scripts/Kalimdor/feralas.cpp b/src/server/scripts/Kalimdor/feralas.cpp index 37a0e4e8f88..82e85c16564 100644 --- a/src/server/scripts/Kalimdor/feralas.cpp +++ b/src/server/scripts/Kalimdor/feralas.cpp @@ -37,15 +37,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; } diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp index 2d6e34ab9ee..833224b0e98 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/moonglade.cpp @@ -54,10 +54,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 +113,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 +169,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(); diff --git a/src/server/scripts/Kalimdor/mulgore.cpp b/src/server/scripts/Kalimdor/mulgore.cpp index c689d6954a4..19be3ce21cc 100644 --- a/src/server/scripts/Kalimdor/mulgore.cpp +++ b/src/server/scripts/Kalimdor/mulgore.cpp @@ -43,10 +43,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; diff --git a/src/server/scripts/Kalimdor/orgrimmar.cpp b/src/server/scripts/Kalimdor/orgrimmar.cpp index 629abb84fc1..63916968ca2 100644 --- a/src/server/scripts/Kalimdor/orgrimmar.cpp +++ b/src/server/scripts/Kalimdor/orgrimmar.cpp @@ -149,10 +149,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); diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index 71cc92da438..2c21ac18752 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -49,10 +49,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); @@ -134,10 +134,10 @@ 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); diff --git a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp index c31a7731865..66731574ec9 100644 --- a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp @@ -46,16 +46,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); diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/tanaris.cpp index ff6cdccb66a..dcca1ed29b4 100644 --- a/src/server/scripts/Kalimdor/tanaris.cpp +++ b/src/server/scripts/Kalimdor/tanaris.cpp @@ -244,10 +244,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 +287,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 +330,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); diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp index e12897c1def..ca87c350cda 100644 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ b/src/server/scripts/Kalimdor/the_barrens.cpp @@ -51,10 +51,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()); @@ -186,10 +186,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); diff --git a/src/server/scripts/Kalimdor/thousand_needles.cpp b/src/server/scripts/Kalimdor/thousand_needles.cpp index 2349b4493ce..77788d0fcfa 100644 --- a/src/server/scripts/Kalimdor/thousand_needles.cpp +++ b/src/server/scripts/Kalimdor/thousand_needles.cpp @@ -299,10 +299,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(); diff --git a/src/server/scripts/Kalimdor/thunder_bluff.cpp b/src/server/scripts/Kalimdor/thunder_bluff.cpp index 67a876c40b2..36873190e8c 100644 --- a/src/server/scripts/Kalimdor/thunder_bluff.cpp +++ b/src/server/scripts/Kalimdor/thunder_bluff.cpp @@ -42,10 +42,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()); diff --git a/src/server/scripts/Kalimdor/winterspring.cpp b/src/server/scripts/Kalimdor/winterspring.cpp index 00bb250d64d..3547b09a34b 100644 --- a/src/server/scripts/Kalimdor/winterspring.cpp +++ b/src/server/scripts/Kalimdor/winterspring.cpp @@ -48,10 +48,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 +105,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 +140,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); 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..a2919de0149 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 @@ -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/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp index c8f18dba1d0..3158d58716f 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp @@ -251,10 +251,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 +388,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(); 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..9b627281775 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 diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index 05206102762..1d82e1c29f3 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -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,7 +131,7 @@ 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; @@ -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/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/HallsOfStone/halls_of_stone.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp index 1c8d9380a2b..1a09db675c6 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp @@ -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(); 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 98b20f1c424..20a46c953ab 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -171,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 @@ -1155,7 +1155,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(); @@ -1228,10 +1228,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) diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index d9e8798b179..a0fe468a91b 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(); diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index e97cc5e205b..3f0a85ce561 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -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(); @@ -317,10 +317,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); @@ -1256,10 +1256,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()); @@ -2540,18 +2540,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; 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/howling_fjord.cpp b/src/server/scripts/Northrend/howling_fjord.cpp index 5e4b7dafdb4..e29b6462835 100644 --- a/src/server/scripts/Northrend/howling_fjord.cpp +++ b/src/server/scripts/Northrend/howling_fjord.cpp @@ -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); 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..f0445273d43 100644 --- a/src/server/scripts/Northrend/sholazar_basin.cpp +++ b/src/server/scripts/Northrend/sholazar_basin.cpp @@ -132,10 +132,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) { CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); CAST_AI(npc_escortAI, (creature->AI()))->SetMaxPlayerDistance(35.0f); @@ -206,10 +206,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 +263,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); @@ -647,11 +647,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 4e0864e01e4..a6874b582dd 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); @@ -270,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); @@ -326,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); @@ -437,12 +437,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); diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zuldrak.cpp index 4cea6d8d8aa..b4bcab9e731 100644 --- a/src/server/scripts/Northrend/zuldrak.cpp +++ b/src/server/scripts/Northrend/zuldrak.cpp @@ -223,10 +223,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); @@ -1365,10 +1365,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); 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_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index de9ef5cd67f..ace1a2ab717 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -1801,10 +1801,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); 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 08b188f7301..4ae41931bd4 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -541,10 +541,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); diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index bd23b06a5ea..d5b08d83c71 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -73,7 +73,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -253,7 +252,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -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*/) {} }; - }; /*###### @@ -534,7 +527,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### diff --git a/src/server/scripts/Outland/hellfire_peninsula.cpp b/src/server/scripts/Outland/hellfire_peninsula.cpp index 7d4de409b8b..707dfd65135 100644 --- a/src/server/scripts/Outland/hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/hellfire_peninsula.cpp @@ -124,7 +124,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -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; } - }; /*###### @@ -456,7 +450,6 @@ public: summoned->AI()->AttackStart(me); } }; - }; /*###### @@ -529,7 +522,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_hellfire_peninsula() diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp index f1aaf82cb67..5d1a77953a7 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); diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index 79811069402..d28a1f23795 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -295,7 +295,6 @@ public: } } }; - }; /*###### @@ -350,7 +349,6 @@ public: } return true; } - }; /*###### @@ -633,7 +631,6 @@ public: } } }; - }; class at_commander_dawnforge : public AreaTriggerScript @@ -659,7 +656,6 @@ public: } return false; } - }; /*###### @@ -690,10 +686,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 +710,6 @@ public: return true; } - }; /*###### @@ -849,7 +844,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -888,7 +882,6 @@ public: struct npc_bessyAI : public npc_escortAI { - npc_bessyAI(Creature* c) : npc_escortAI(c) {} void JustDied(Unit* /*killer*/) @@ -937,9 +930,7 @@ public: { me->RestoreFaction(); } - }; - }; /*###### diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index 6acd9bf6c99..79d284d779a 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -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(); } }; - }; /*### @@ -321,7 +320,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*##### @@ -401,7 +399,6 @@ public: } } }; - }; /*###### @@ -413,10 +410,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 +428,6 @@ public: return true; } - }; /*###### @@ -446,10 +442,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 +455,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 +479,6 @@ public: return true; } - }; /*###### @@ -504,10 +499,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 +547,6 @@ public: player->SEND_GOSSIP_MENU(10940, creature->GetGUID()); return true; } - }; /*###### @@ -572,10 +566,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 +622,6 @@ public: return true; } - }; /*#### @@ -884,7 +877,6 @@ public: } else ConversationTimer -= diff; } }; - }; /*#### @@ -1061,7 +1053,6 @@ public: } } }; - }; /*##### @@ -1265,7 +1256,6 @@ public: me->CombatStop(); } else if (!Timers) { - SpellTimer1 = SpawnCast[6].Timer1; SpellTimer2 = SpawnCast[7].Timer1; SpellTimer3 = SpawnCast[8].Timer1; @@ -1321,7 +1311,6 @@ public: } } }; - }; /*##### @@ -1467,7 +1456,6 @@ public: EnterEvadeMode(); } }; - }; /*###### @@ -1586,7 +1574,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI::SummonNextWave() @@ -1680,7 +1667,6 @@ public: } return true; } - }; /*#### @@ -1801,7 +1787,6 @@ public: } } }; - }; /*##### diff --git a/src/server/scripts/Outland/shattrath_city.cpp b/src/server/scripts/Outland/shattrath_city.cpp index ed68f55aeb5..2421af6af75 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); @@ -111,7 +111,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -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; } - }; /*###### @@ -543,10 +539,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 +568,6 @@ public: { return new npc_dirty_larryAI (creature); } - }; /*###### @@ -587,12 +582,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 +605,6 @@ public: return true; } - }; /*###### @@ -629,10 +623,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 +672,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 5eb88e6bfb6..bcb5f9f4da1 100644 --- a/src/server/scripts/Outland/terokkar_forest.cpp +++ b/src/server/scripts/Outland/terokkar_forest.cpp @@ -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(); } }; - }; /*###### @@ -183,7 +182,6 @@ public: DoCast(me, 39130, true); } }; - }; /*###### @@ -245,7 +243,6 @@ public: npc_escortAI::UpdateAI(diff); } }; - }; /*###### @@ -278,7 +275,6 @@ public: DoCast(me, 39134, true); } }; - }; /*###### @@ -331,7 +327,6 @@ public: } } }; - }; /*###### @@ -358,15 +353,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); @@ -439,7 +434,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -533,7 +527,6 @@ public: { return new npc_isla_starmaneAI(creature); } - }; /*###### @@ -549,12 +542,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; } @@ -573,9 +566,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); @@ -607,10 +600,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; @@ -628,7 +621,6 @@ public: return true; } - }; /*######## @@ -695,7 +687,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..6d8a47c693e 100644 --- a/src/server/scripts/Outland/zangarmarsh.cpp +++ b/src/server/scripts/Outland/zangarmarsh.cpp @@ -64,10 +64,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 @@ -195,10 +195,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 +231,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 +284,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; } @@ -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/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index e4593be295c..80ba1972437 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -381,7 +381,6 @@ class spell_warl_life_tap : public SpellScriptLoader if (Unit* target = GetHitUnit()) { SpellInfo const* spellInfo = GetSpellInfo(); - float spFactor = 0.0f; int32 damage = int32(GetEffectValue() + (6.3875 * spellInfo->BaseLevel)); int32 mana = int32(damage + (caster->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+SPELL_SCHOOL_SHADOW) * 0.5f)); diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp index d8a90b2ffd5..1220a4a24fb 100644 --- a/src/server/scripts/World/areatrigger_scripts.cpp +++ b/src/server/scripts/World/areatrigger_scripts.cpp @@ -447,7 +447,7 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) { - float x, y, z; + float x = 0.0f, y = 0.0f, z = 0.0f; if (!player->isAlive()) return false; @@ -502,4 +502,4 @@ void AddSC_areatrigger_scripts() new AreaTrigger_at_bring_your_orphan_to(); new AreaTrigger_at_brewfest(); new AreaTrigger_at_area_52_entrance(); -} \ No newline at end of file +} diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 59ed06788cb..d67c09c8d02 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -564,10 +564,10 @@ public: return true; } - bool OnGossipSelect(Player* player, GameObject* pGO, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, GameObject* pGO, 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); @@ -623,10 +623,10 @@ public: return true; } - bool OnGossipSelect(Player* player, GameObject* pGO, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, GameObject* pGO, 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); @@ -1087,10 +1087,10 @@ public: return true; } - bool OnGossipSelect(Player* player, GameObject* pGO, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, GameObject* pGO, 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); diff --git a/src/server/scripts/World/guards.cpp b/src/server/scripts/World/guards.cpp index 9bc511931b9..294f1cd291a 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) { diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index 165ef9f18b1..cf55bb14895 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -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; } @@ -264,7 +264,7 @@ 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* pItem, const SpellCastTargets & /*targets*/) { if (player->GetZoneId() != ZONE_ID_HOWLING) return false; @@ -273,8 +273,8 @@ public: { player->SendEquipError(EQUIP_ERR_NONE, pItem, 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,7 +330,7 @@ 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* /*pItem*/, const SpellCastTargets & /*targets*/) { if (player->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) != QUEST_STATUS_INCOMPLETE) return false; @@ -367,7 +367,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* pItem, const SpellCastTargets & /*targets*/) { if (player->GetQuestStatus(QUEST_THE_EMISSARY) == QUEST_STATUS_INCOMPLETE) { 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..a1920e06ad1 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -213,7 +213,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)) { @@ -424,9 +424,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 +436,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 +482,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 +507,15 @@ 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; } @@ -599,9 +599,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 +665,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 +690,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 +700,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 +724,15 @@ 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; } @@ -824,16 +824,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); @@ -897,9 +897,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 +920,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 +948,14 @@ 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; } @@ -1017,9 +1017,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 +1029,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 +1050,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 +1075,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,15 +1100,15 @@ 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; } 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 10bc722fc1b..b7aee4a3f07 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1495,7 +1495,6 @@ public: else me->SetReactState(REACT_AGGRESSIVE); } - }; CreatureAI* GetAI(Creature* creature) const @@ -1754,14 +1753,12 @@ public: struct mob_mojoAI : public ScriptedAI { mob_mojoAI(Creature* c) : ScriptedAI(c) {Reset();} - - uint32 Hearts; - uint64 VictimGUID; - + 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 +1769,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 +1817,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; } } }; @@ -1894,7 +1890,7 @@ public: { npc_ebon_gargoyleAI(Creature* c) : CasterAI(c) {} - uint32 DespawnTimer; + uint32 despawnTimer; void InitializeAI() { @@ -1903,7 +1899,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); @@ -1952,15 +1948,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; @@ -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;} -- cgit v1.2.3 From 609728a17b22d8f53b54bfb2778762b4bdb752cd Mon Sep 17 00:00:00 2001 From: frozenarmor Date: Sun, 11 Mar 2012 00:52:06 +0500 Subject: Update forgotten copyright-headers for 2012. Signed-off-by: frozenarmor --- src/server/scripts/Commands/CMakeLists.txt | 2 +- src/server/scripts/Custom/CMakeLists.txt | 2 +- src/server/scripts/EasternKingdoms/CMakeLists.txt | 2 +- src/server/scripts/Examples/CMakeLists.txt | 2 +- src/server/scripts/Kalimdor/CMakeLists.txt | 2 +- src/server/scripts/Northrend/CMakeLists.txt | 2 +- src/server/scripts/OutdoorPvP/CMakeLists.txt | 2 +- src/server/scripts/Outland/CMakeLists.txt | 2 +- src/server/scripts/Spells/CMakeLists.txt | 2 +- src/server/scripts/World/CMakeLists.txt | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index b17350c265d..d14e71aac4a 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 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/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt index 5af9dd2f23e..129e88a4e3b 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 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/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/Northrend/CMakeLists.txt b/src/server/scripts/Northrend/CMakeLists.txt index 53b47884e57..31aa924365d 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 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/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/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/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 -- cgit v1.2.3 From f85fdbebe7db448d895bb97ee5eafa393a1f6547 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 10 Mar 2012 20:53:26 +0100 Subject: Core/DBC: Remove store getters (useless since we don't have scripts as external dll) --- src/server/game/AI/EventAI/CreatureEventAI.cpp | 2 +- src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 2 +- src/server/game/Conditions/ConditionMgr.cpp | 2 +- src/server/game/DataStores/DBCStores.cpp | 9 --------- src/server/game/DataStores/DBCStores.h | 9 --------- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Scripting/ScriptMgr.cpp | 2 +- src/server/game/Scripting/ScriptSystem.cpp | 4 ++-- src/server/scripts/Commands/cs_achievement.cpp | 2 +- src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp | 2 +- src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp | 2 +- .../scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp | 2 +- 12 files changed, 11 insertions(+), 29 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index 730606becb5..11887611ae8 100755 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp @@ -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); diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index bd6c901f99c..5c1bbf0ad06 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -171,7 +171,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; diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index eadcc5c5fbb..7fe6df14679 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -1545,7 +1545,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); diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index acc130dcddf..cbff5c900f6 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -872,12 +872,3 @@ uint32 GetLiquidFlags(uint32 liquidType) return 0; } -// script support functions - 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; } - DBCStorage const* GetAchievementStore() { return &sAchievementStore; } diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 3f8d19c1f5e..cd30ed587f8 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -175,13 +175,4 @@ extern DBCStorage sWorldSafeLocsStore; void LoadDBCStores(const std::string& dataPath); -// script support functions - DBCStorage const* GetSoundEntriesStore(); - DBCStorage const* GetSpellRangeStore(); - DBCStorage const* GetFactionStore(); - DBCStorage const* GetItemDisplayStore(); - DBCStorage const* GetCreatureDisplayStore(); - DBCStorage const* GetEmotesStore(); - DBCStorage const* GetEmotesTextStore(); - DBCStorage const* GetAchievementStore(); #endif diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 92a21dfb52c..8318bd246d0 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -23077,7 +23077,7 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z) if (liquid && liquid->SpellId) { if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER)) - CastSpell(this, liquid->SpellId, this); + CastSpell(this, liquid->SpellId, true); else RemoveAurasDueToSpell(liquid->SpellId); } diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index ac15bd5c985..fba6b460ec9 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); diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp index 65e855cd887..ecb82a80a8d 100755 --- a/src/server/game/Scripting/ScriptSystem.cpp +++ b/src/server/game/Scripting/ScriptSystem.cpp @@ -67,7 +67,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); } @@ -129,7 +129,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); } 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/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp index ea2846185f8..23e64d756f5 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp @@ -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/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index 63f7c653c5a..abd16cd9c93 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -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()) diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp index 83604ed4153..13ba85f646c 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp @@ -152,7 +152,7 @@ public: 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(); -- cgit v1.2.3 From 03a24a84e493f914d46488e8c4ae9e9d663c21d7 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Mon, 12 Mar 2012 00:45:58 +0100 Subject: Core/Units: - Implement UNIT_FIELD_HOVERHEIGHT (requires DB data). This field, sent in update object packet, will determine the height at which a creature hovers if it has movementflag_hover applied. Note that hovering will now update the server-sided z-coordinate by the value of this field, and that all subsequent positional updates to the client will need to send z coordinate MINUS the hover height offset, or the hoverheight will be visually doubled client side. - Correct our usage of movementflag_flying, movementflag_can_fly, movementflag_hover and movementflag_disable_gravity (previously levitate), and how they relate to InhabitType in the database. This fixes "flying creatures on steroids" bug (wings flapping too fast), and potentially a lot of visual issues in AI scripts. Note that a lot of scripts still set wrong movementflags, these need to be fixed on a case by case basis. - Send correct packets for SPELL_AURA_FEATHER_FALL, SPELL_AURA_WATER_WALK and SPELL_AURA_HOVER apply/unapply. - Send correct packet contents for movement update in Unit::SetSpeed. - Misc. cleanup in affected scripts. --- .../2012_03_12_00_world_creature_template.sql | 1 + src/server/game/AI/CoreAI/GuardAI.cpp | 2 +- src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 2 +- .../game/AI/ScriptedAI/ScriptedFollowerAI.cpp | 2 +- src/server/game/AI/SmartScripts/SmartAI.cpp | 12 +-- src/server/game/Entities/Creature/Creature.cpp | 104 ++++++++++++++------ src/server/game/Entities/Creature/Creature.h | 6 +- src/server/game/Entities/Object/Object.cpp | 19 +++- src/server/game/Entities/Object/Object.h | 3 +- src/server/game/Entities/Player/Player.cpp | 20 ++++ src/server/game/Entities/Player/Player.h | 9 +- src/server/game/Entities/Unit/Unit.cpp | 109 ++++++++++++++------- src/server/game/Entities/Unit/Unit.h | 45 ++++++--- src/server/game/Globals/ObjectMgr.cpp | 49 +++++---- src/server/game/Maps/Map.cpp | 12 +++ .../MovementGenerators/PointMovementGenerator.cpp | 2 +- .../MovementGenerators/RandomMovementGenerator.cpp | 2 +- src/server/game/Movement/Spline/MoveSplineInit.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 6 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 41 ++++---- src/server/scripts/Commands/cs_reload.cpp | 35 +++---- .../EasternKingdoms/Karazhan/boss_nightbane.cpp | 4 +- .../scripts/EasternKingdoms/Karazhan/karazhan.cpp | 2 +- .../MagistersTerrace/boss_felblood_kaelthas.cpp | 4 +- .../ScarletEnclave/the_scarlet_enclave.cpp | 2 +- .../ScarletMonastery/boss_headless_horseman.cpp | 4 +- .../SunwellPlateau/boss_brutallus.cpp | 2 +- .../SunwellPlateau/boss_felmyst.cpp | 6 +- .../SunwellPlateau/boss_kalecgos.cpp | 8 +- .../SunwellPlateau/boss_kiljaeden.cpp | 6 +- .../EasternKingdoms/ZulAman/boss_akilzon.cpp | 6 +- .../EasternKingdoms/ZulAman/boss_janalai.cpp | 2 +- src/server/scripts/EasternKingdoms/undercity.cpp | 4 +- .../EasternKingdoms/western_plaguelands.cpp | 2 +- .../BattleForMountHyjal/hyjal_trash.cpp | 6 +- .../scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp | 4 +- src/server/scripts/Kalimdor/silithus.cpp | 8 +- .../AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp | 1 + .../RubySanctum/boss_saviana_ragefire.cpp | 12 +-- .../TrialOfTheCrusader/boss_anubarak_trial.cpp | 5 +- .../TrialOfTheCrusader/boss_twin_valkyr.cpp | 4 +- .../FrozenHalls/PitOfSaron/boss_krickandick.cpp | 4 +- .../PitOfSaron/boss_scourgelord_tyrannus.cpp | 2 +- .../IcecrownCitadel/boss_blood_prince_council.cpp | 2 +- .../IcecrownCitadel/boss_blood_queen_lana_thel.cpp | 36 +++---- .../IcecrownCitadel/boss_deathbringer_saurfang.cpp | 10 +- .../Northrend/IcecrownCitadel/boss_sindragosa.cpp | 40 ++++---- .../IcecrownCitadel/boss_the_lich_king.cpp | 8 +- .../Northrend/IcecrownCitadel/icecrown_citadel.cpp | 4 +- .../scripts/Northrend/Naxxramas/boss_sapphiron.cpp | 4 +- .../Northrend/Nexus/EyeOfEternity/boss_malygos.cpp | 20 ++-- .../scripts/Northrend/Nexus/Oculus/boss_urom.cpp | 4 +- .../scripts/Northrend/Nexus/Oculus/boss_varos.cpp | 1 + .../Ulduar/Ulduar/boss_assembly_of_iron.cpp | 2 +- .../Northrend/Ulduar/Ulduar/boss_razorscale.cpp | 8 +- .../UtgardeKeep/boss_ingvar_the_plunderer.cpp | 1 + .../UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp | 1 + .../UtgardeKeep/UtgardePinnacle/boss_skadi.cpp | 6 +- .../UtgardeKeep/UtgardePinnacle/boss_svala.cpp | 94 ++++-------------- .../UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp | 2 +- src/server/scripts/Northrend/sholazar_basin.cpp | 2 +- .../SethekkHalls/boss_tailonking_ikiss.cpp | 2 +- .../scripts/Outland/BlackTemple/boss_illidan.cpp | 6 +- .../SerpentShrine/boss_lady_vashj.cpp | 2 +- .../SerpentShrine/boss_lurker_below.cpp | 2 +- .../SerpentShrine/instance_serpent_shrine.cpp | 2 +- .../HellfireRamparts/boss_vazruden_the_herald.cpp | 4 +- .../boss_watchkeeper_gargolmar.cpp | 2 +- .../scripts/Outland/TempestKeep/Eye/boss_alar.cpp | 6 +- .../Outland/TempestKeep/Eye/boss_kaelthas.cpp | 2 +- .../Outland/TempestKeep/arcatraz/arcatraz.cpp | 2 +- .../scripts/Outland/blades_edge_mountains.cpp | 2 +- src/server/scripts/Outland/shadowmoon_valley.cpp | 8 +- src/server/scripts/World/npcs_special.cpp | 3 +- 74 files changed, 487 insertions(+), 382 deletions(-) create mode 100644 sql/updates/world/2012_03_12_00_world_creature_template.sql (limited to 'src/server/scripts/Commands') diff --git a/sql/updates/world/2012_03_12_00_world_creature_template.sql b/sql/updates/world/2012_03_12_00_world_creature_template.sql new file mode 100644 index 00000000000..cc70ff7a557 --- /dev/null +++ b/sql/updates/world/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/src/server/game/AI/CoreAI/GuardAI.cpp b/src/server/game/AI/CoreAI/GuardAI.cpp index b78fec7c142..df29d485cba 100755 --- a/src/server/game/AI/CoreAI/GuardAI.cpp +++ b/src/server/game/AI/CoreAI/GuardAI.cpp @@ -54,7 +54,7 @@ bool GuardAI::CanSeeAlways(WorldObject const* obj) void GuardAI::MoveInLineOfSight(Unit* unit) { // Ignore Z for flying creatures - if (!me->canFly() && me->GetDistanceZ(unit) > CREATURE_Z_ATTACK_RANGE) + if (!me->CanFly() && me->GetDistanceZ(unit) > CREATURE_Z_ATTACK_RANGE) return; if (!me->getVictim() && me->IsValidAttackTarget(unit) && diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 1e0c3f5c1fc..688d48b41ad 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -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)) diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index e0fe12082f1..13bbbe2c338 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -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)) diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 50c7aba0360..4cf438da5a4 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -729,17 +729,7 @@ void SmartAI::SetRun(bool run) void SmartAI::SetFly(bool fly) { - if (fly) - { - me->SetLevitate(true); - me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - } - else - { - me->SetLevitate(false); - me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - } - me->SetFlying(fly); + me->SetDisableGravity(fly); me->SendMovementFlagUpdate(); } diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 2b4f1275993..1fb972ccfdf 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -334,7 +334,8 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data SetSpeed(MOVE_FLIGHT, 1.0f); // using 1.0 rate SetFloatValue(OBJECT_FIELD_SCALE_X, cinfo->scale); - SetLevitate(canFly()); + + SetFloatValue(UNIT_FIELD_HOVERHEIGHT, cinfo->HoverHeight); // checked at loading m_defaultMovementType = MovementGeneratorType(cinfo->MovementType); @@ -418,10 +419,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); @@ -742,6 +758,14 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, 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; + + //! Need to be called after CreateFromProto + if (HasUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY)) + z += GetFloatValue(UNIT_FIELD_HOVERHEIGHT); + Relocate(x, y, z, ang); if (!IsPositionValid()) @@ -750,10 +774,6 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, 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 (GetCreatureTemplate()->rank) { case CREATURE_ELITE_RARE: @@ -783,17 +803,6 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, SetByteValue(UNIT_FIELD_BYTES_0, 2, minfo->gender); } - if (GetCreatureTemplate()->InhabitType & INHABIT_AIR) - { - if (GetDefaultMovementType() == IDLE_MOTION_TYPE) - AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); - else - SetFlying(true); - } - - if (GetCreatureTemplate()->InhabitType & INHABIT_WATER) - AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); - LastUsedScriptID = GetCreatureTemplate()->ScriptID; // TODO: Replace with spell, handle from DB @@ -1065,11 +1074,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); @@ -1287,7 +1296,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) @@ -1420,7 +1429,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 @@ -1517,7 +1526,7 @@ 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); @@ -1532,7 +1541,7 @@ void Creature::setDeathState(DeathState s) CreatureTemplate const* cinfo = GetCreatureTemplate(); SetWalk(true); if (GetCreatureTemplate()->InhabitType & INHABIT_AIR) - AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING); + SetDisableGravity(true); if (GetCreatureTemplate()->InhabitType & INHABIT_WATER) AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); @@ -2040,6 +2049,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) @@ -2088,6 +2103,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; } @@ -2415,17 +2431,43 @@ bool Creature::SetWalk(bool enable) WorldPacket data(enable ? SMSG_SPLINE_MOVE_SET_WALK_MODE : SMSG_SPLINE_MOVE_SET_RUN_MODE, 9); data.append(GetPackGUID()); - SendMessageToSet(&data, true); + SendMessageToSet(&data, false); + return true; +} + +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::SetLevitate(bool enable) +bool Creature::SetHover(bool enable) { - if (!Unit::SetLevitate(enable)) + if (!Unit::SetHover(enable)) return false; - WorldPacket data(enable ? SMSG_SPLINE_MOVE_GRAVITY_DISABLE : SMSG_SPLINE_MOVE_GRAVITY_ENABLE, 9); + //! Unconfirmed for players: + if (enable) + SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_HOVER); + else + 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 f986e09e7cb..2f9549fd70a 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -134,6 +134,7 @@ struct CreatureTemplate std::string AIName; uint32 MovementType; uint32 InhabitType; + float HoverHeight; float ModHealth; float ModMana; float ModArmor; @@ -467,7 +468,7 @@ class Creature : public Unit, public GridObject, public MapCreature 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; } + bool CanFly() const { return GetCreatureTemplate()->InhabitType & INHABIT_AIR; } void SetReactState(ReactStates st) { m_reactState = st; } ReactStates GetReactState() { return m_reactState; } @@ -521,7 +522,8 @@ class Creature : public Unit, public GridObject, public MapCreature CreatureAI* AI() const { return (CreatureAI*)i_AI; } bool SetWalk(bool enable); - bool SetLevitate(bool enable); + bool SetDisableGravity(bool disable, bool packetOnly = false); + bool SetHover(bool enable); uint32 GetShieldBlockValue() const //dunno mob block value { diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 2a2b78f4630..56ddd14dc3a 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -340,7 +340,10 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const *data << ((WorldObject*)this)->GetPositionX(); *data << ((WorldObject*)this)->GetPositionY(); - *data << ((WorldObject*)this)->GetPositionZ(); + if (isType(TYPEMASK_UNIT)) + *data << ((Unit*)this)->GetPositionZMinusOffset(); + else + *data << ((WorldObject*)this)->GetPositionZ(); if (transport) { @@ -352,7 +355,10 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const { *data << ((WorldObject*)this)->GetPositionX(); *data << ((WorldObject*)this)->GetPositionY(); - *data << ((WorldObject*)this)->GetPositionZ(); + if (isType(TYPEMASK_UNIT)) + *data << ((Unit*)this)->GetPositionZMinusOffset(); + else + *data << ((WorldObject*)this)->GetPositionZ(); } *data << ((WorldObject*)this)->GetOrientation(); @@ -369,7 +375,10 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const { *data << ((WorldObject*)this)->GetPositionX(); *data << ((WorldObject*)this)->GetPositionY(); - *data << ((WorldObject*)this)->GetPositionZ(); + if (isType(TYPEMASK_UNIT)) + *data << ((Unit*)this)->GetPositionZMinusOffset(); + else + *data << ((WorldObject*)this)->GetPositionZ(); *data << ((WorldObject*)this)->GetOrientation(); } } @@ -1557,7 +1566,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; @@ -1583,7 +1592,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)); diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index c243527570b..fd8deb1b841 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -776,7 +776,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); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 8318bd246d0..f3f376dae04 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -22170,6 +22170,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()); @@ -25158,3 +25170,11 @@ bool Player::IsInWhisperWhiteList(uint64 guid) } return false; } + +bool Player::SetHover(bool enable) +{ + if (!Unit::SetHover(enable)) + return false; + + return true; +} diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index bd58827c0e4..7f6b2322e93 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2287,6 +2287,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; @@ -2479,6 +2481,10 @@ class Player : public Unit, public GridObject void AddWhisperWhiteList(uint64 guid) { WhisperList.push_back(guid); } bool IsInWhisperWhiteList(uint64 guid); + #pragma region Player Movement + + bool CanFly() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY); } + //! Return collision height sent to client float GetCollisionHeight(bool mounted) { @@ -2511,8 +2517,9 @@ class Player : public Unit, public GridObject return modelData->CollisionHeight; } - //! TODO: Need a proper calculation for collision height when mounted } + #pragma endregion Player Movement + protected: // Gamemaster whisper whitelist diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3411d285b1e..6d4963f1960 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3049,7 +3049,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 @@ -12597,15 +12597,7 @@ 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 + BuildMovementPacket(&data); data << float(GetSpeed(mtype)); SendMessageToSet(&data, true); } @@ -12664,14 +12656,6 @@ 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 @@ -17058,12 +17042,12 @@ void Unit::_ExitVehicle(Position const* exitPosition) void Unit::BuildMovementPacket(ByteBuffer *data) const { - *data << uint32(GetUnitMovementFlags()); // movement flags - *data << uint16(m_movementInfo.flags2); // 2.3.0 - *data << uint32(getMSTime()); // time + *data << uint32(GetUnitMovementFlags()); // movement flags + *data << uint16(GetExtraUnitMovementFlags()); // 2.3.0 + *data << uint32(getMSTime()); // time / counter *data << GetPositionX(); *data << GetPositionY(); - *data << GetPositionZ(); + *data << GetPositionZMinusOffset(); *data << GetOrientation(); // 0x00000200 @@ -17108,18 +17092,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*/) @@ -17165,11 +17143,20 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel 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(), GetOrientation()); + 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() @@ -17457,15 +17444,65 @@ bool Unit::SetWalk(bool enable) return true; } -bool Unit::SetLevitate(bool enable) +bool Unit::SetDisableGravity(bool disable) +{ + 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 == IsLevitating()) + if (enable == HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) return false; if (enable) - AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + { + //! No need to check height on ascent + AddUnitMovementFlag(MOVEMENTFLAG_HOVER); + if (float hh = GetFloatValue(UNIT_FIELD_HOVERHEIGHT)) + UpdateHeight(GetPositionZ() + hh); + } else - RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + { + 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() +{ + WorldPacket data(MSG_MOVE_HOVER, 64); + data.append(GetPackGUID()); + BuildMovementPacket(&data); + SendMessageToSet(&data, true); +} + +void Unit::SendMovementWaterWalking() +{ + WorldPacket data(MSG_MOVE_WATER_WALK, 64); + data.append(GetPackGUID()); + BuildMovementPacket(&data); + SendMessageToSet(&data, true); +} + +void Unit::SendMovementFeatherFall() +{ + WorldPacket data(MSG_MOVE_FEATHER_FALL, 64); + data.append(GetPackGUID()); + BuildMovementPacket(&data); + SendMessageToSet(&data, true); +} diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index b07f2ae1c16..79ed0ec2f3d 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -184,10 +184,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 @@ -676,7 +676,7 @@ 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 @@ -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 @@ -706,6 +706,10 @@ enum MovementFlags MOVEMENTFLAG_MASK_TURNING = MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT, + + //! TODO if needed: add more flags to this masks that are exclusive to players + MOVEMENTFLAG_MASK_PLAYER_ONLY = + MOVEMENTFLAG_FLYING, }; enum MovementFlags2 { @@ -1615,6 +1619,7 @@ class Unit : public WorldObject // 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); @@ -1626,10 +1631,14 @@ 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);} + void SendMovementHover(); + void SendMovementFeatherFall(); + void SendMovementWaterWalking(); + 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 SetLevitate(bool enable); + virtual bool SetDisableGravity(bool disable); + bool SetHover(bool enable); void SetInFront(Unit const* target); void SetFacingTo(float ori); @@ -2053,7 +2062,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 +2085,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 +2095,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 +2188,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); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 11977280177..f2b867b91ff 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -377,9 +377,9 @@ void ObjectMgr::LoadCreatureTemplates() // 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 - "InhabitType, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, " + "InhabitType, HoverHeight, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, " // 78 79 80 81 82 83 - "movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName " + " questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName " "FROM creature_template;"); if (!result) @@ -463,20 +463,21 @@ void ObjectMgr::LoadCreatureTemplates() 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.HoverHeight = fields[68].GetFloat(); + creatureTemplate.ModHealth = fields[69].GetFloat(); + creatureTemplate.ModMana = fields[70].GetFloat(); + creatureTemplate.ModArmor = fields[71].GetFloat(); + creatureTemplate.RacialLeader = fields[72].GetBool(); for (uint8 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i) - creatureTemplate.questItems[i] = fields[72 + i].GetUInt32(); + creatureTemplate.questItems[i] = fields[73 + 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[79].GetUInt32(); + creatureTemplate.RegenHealth = fields[80].GetBool(); + creatureTemplate.equipmentId = fields[81].GetUInt32(); + creatureTemplate.MechanicImmuneMask = fields[82].GetUInt32(); + creatureTemplate.flags_extra = fields[83].GetUInt32(); + creatureTemplate.ScriptID = GetScriptId(fields[84].GetCString()); ++count; } @@ -494,7 +495,7 @@ void ObjectMgr::LoadCreatureTemplateAddons() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 + // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT entry, path_id, mount, bytes1, bytes2, emote, auras FROM creature_template_addon"); if (!result) @@ -549,7 +550,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; } @@ -793,6 +797,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); @@ -862,7 +872,7 @@ void ObjectMgr::LoadCreatureAddons() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 + // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT guid, path_id, mount, bytes1, bytes2, emote, auras FROM creature_addon"); if (!result) @@ -899,7 +909,7 @@ void ObjectMgr::LoadCreatureAddons() creatureAddon.bytes1 = fields[3].GetUInt32(); creatureAddon.bytes2 = fields[4].GetUInt32(); creatureAddon.emote = fields[5].GetUInt32(); - + Tokens tokens(fields[6].GetString(), ' '); uint8 i = 0; creatureAddon.auras.resize(tokens.size()); @@ -914,7 +924,7 @@ void ObjectMgr::LoadCreatureAddons() creatureAddon.auras[i++] = uint32(atol(*itr)); } - if (creatureAddon.mount) + if (creatureAddon.mount) { if (!sCreatureDisplayInfoStore.LookupEntry(creatureAddon.mount)) { @@ -924,7 +934,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; } diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 7f27a474534..7403a86a47f 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -702,6 +702,12 @@ 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); @@ -731,6 +737,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)) { diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index fddfe5f8fb0..91b50344ccb 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -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); diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index b65fa210723..e520253eb46 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; diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index b5ae923dc32..f5d2ae59329 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -100,7 +100,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/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index e5b5b20dcfa..c6ccfaa8004 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -270,10 +270,10 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*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 }, + /*0x0F4*/ { "SMSG_MOVE_SET_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, + /*0x0F5*/ { "SMSG_MOVE_UNSET_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x0F6*/ { "CMSG_MOVE_HOVER_ACK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveHoverAck }, - /*0x0F7*/ { "MSG_MOVE_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, + /*0x0F7*/ { "MSG_MOVE_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*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 }, diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 56bca65788c..387f76bbc7f 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2845,7 +2845,7 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode } if (target->GetTypeId() == TYPEID_UNIT) - target->SetFlying(apply); + target->SetCanFly(apply); if (Player* player = target->m_movedPlayer) { @@ -2856,7 +2856,7 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode else data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12); data.append(target->GetPackGUID()); - data << uint32(0); // unk + data << uint32(0); // movement counter player->SendDirectMessage(&data); } } @@ -2875,14 +2875,16 @@ void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, return; } - WorldPacket data; if (apply) - data.Initialize(SMSG_MOVE_WATER_WALK, 8+4); + { + target->AddUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); + target->SendMovementWaterWalking(); + } else - data.Initialize(SMSG_MOVE_LAND_WALK, 8+4); - data.append(target->GetPackGUID()); - data << uint32(0); - target->SendMessageToSet(&data, true); + { + target->RemoveUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); + target->SendMovementFlagUpdate(); + } } void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -2899,14 +2901,16 @@ void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode return; } - WorldPacket data; if (apply) - data.Initialize(SMSG_MOVE_FEATHER_FALL, 8+4); + { + target->AddUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW); + target->SendMovementFeatherFall(); + } else - data.Initialize(SMSG_MOVE_NORMAL_FALL, 8+4); - data.append(target->GetPackGUID()); - data << uint32(0); - target->SendMessageToSet(&data, true); + { + target->RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW); + target->SendMovementFlagUpdate(); + } // start fall from current height if (!apply && target->GetTypeId() == TYPEID_PLAYER) @@ -2927,14 +2931,11 @@ void AuraEffect::HandleAuraHover(AuraApplication const* aurApp, uint8 mode, bool return; } - WorldPacket data; + target->SetHover(apply); //! Sets movementflags if (apply) - data.Initialize(SMSG_MOVE_SET_HOVER, 8+4); + target->SendMovementHover(); else - data.Initialize(SMSG_MOVE_UNSET_HOVER, 8+4); - data.append(target->GetPackGUID()); - data << uint32(0); - target->SendMessageToSet(&data, true); + target->SendMovementFlagUpdate(); } void AuraEffect::HandleWaterBreathing(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 28920f7c109..1520a944f6e 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -413,7 +413,7 @@ 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); + 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, 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 = %u", entry); if (!result) { handler->PSendSysMessage(LANG_COMMAND_CREATURETEMPLATE_NOTFOUND, entry); @@ -498,22 +498,23 @@ public: 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()); + const_cast(cInfo)->HoverHeight = fields[67].GetFloat(); + const_cast(cInfo)->ModHealth = fields[68].GetFloat(); + const_cast(cInfo)->ModMana = fields[69].GetFloat(); + const_cast(cInfo)->ModArmor = fields[70].GetFloat(); + const_cast(cInfo)->RacialLeader = fields[71].GetBool(); + const_cast(cInfo)->questItems[0] = fields[72].GetUInt32(); + const_cast(cInfo)->questItems[1] = fields[73].GetUInt32(); + const_cast(cInfo)->questItems[2] = fields[74].GetUInt32(); + const_cast(cInfo)->questItems[3] = fields[75].GetUInt32(); + const_cast(cInfo)->questItems[4] = fields[76].GetUInt32(); + const_cast(cInfo)->questItems[5] = fields[77].GetUInt32(); + const_cast(cInfo)->movementId = fields[78].GetUInt32(); + const_cast(cInfo)->RegenHealth = fields[79].GetBool(); + const_cast(cInfo)->equipmentId = fields[80].GetUInt32(); + const_cast(cInfo)->MechanicImmuneMask = fields[81].GetUInt32(); + const_cast(cInfo)->flags_extra = fields[82].GetUInt32(); + const_cast(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[83].GetCString()); sObjectMgr->CheckCreatureTemplate(cInfo); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index 2a8676d7915..0cf68852041 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -121,7 +121,7 @@ public: MovePhase = 0; me->SetSpeed(MOVE_RUN, 2.0f); - me->SetLevitate(true); + me->SetDisableGravity(true); me->SetWalk(false); me->setActive(true); @@ -240,7 +240,7 @@ public: me->InterruptSpell(CURRENT_GENERIC_SPELL); me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - me->SetLevitate(true); + me->SetDisableGravity(true); (*me).GetMotionMaster()->Clear(false); (*me).GetMotionMaster()->MovePoint(0, IntroWay[2][0], IntroWay[2][1], IntroWay[2][2]); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index b4345c61a77..fd5a77fb816 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -527,7 +527,7 @@ public: if (!Arcanagos) return; ArcanagosGUID = Arcanagos->GetGUID(); - Arcanagos->SetLevitate(true); + Arcanagos->SetDisableGravity(true); (*Arcanagos).GetMotionMaster()->MovePoint(0, ArcanagosPos[0], ArcanagosPos[1], ArcanagosPos[2]); Arcanagos->SetOrientation(ArcanagosPos[3]); me->SetOrientation(MedivPos[3]); diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index a46037f2662..0c1017edfdb 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -497,7 +497,7 @@ public: void Reset() { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); - me->SetLevitate(true); + me->SetDisableGravity(true); DoCast(me, SPELL_PHOENIX_BURN, true); BurnTimer = 2000; Death_Timer = 3000; @@ -651,7 +651,7 @@ public: ChangeTargetTimer = urand(6000, 12000); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetLevitate(true); + me->SetDisableGravity(true); me->setFaction(14); DoCast(me, SPELL_ARCANE_SPHERE_PASSIVE, true); } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp index 4f4622b6d4a..bf09e008dff 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp @@ -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; diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 77099f2e2d7..b71f0ef8b9a 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -429,7 +429,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 +462,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: { diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index 78d00e19cdf..5089c3b8074 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -216,7 +216,7 @@ public: break; case 3: DoCast(me, SPELL_INTRO_FROST_BLAST); - Madrigosa->SetLevitate(true); + Madrigosa->SetDisableGravity(true); me->AttackStop(); Madrigosa->AttackStop(); IntroFrostBoltTimer = 3000; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index 0d98efd703b..b3ea89c1d66 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -137,7 +137,7 @@ public: uiFlightCount = 0; - me->SetLevitate(true); + me->SetDisableGravity(true); me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); @@ -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->SetLevitate(false); + me->SetDisableGravity(false); me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); EnterPhase(PHASE_GROUND); AttackStart(SelectTarget(SELECT_TARGET_TOPAGGRO)); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index 1735c0c4f07..45153c21ea6 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -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->SetLevitate(false); + 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->SetLevitate(false); + 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->SetLevitate(true); + 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->SetLevitate(true); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(0, FLY_X, FLY_Y, FLY_Z); TalkTimer = 15000; break; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 02a8de14fdf..e9101d123dc 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_LEVITATING); + me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->setActive(true); @@ -451,7 +451,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; @@ -1188,7 +1188,7 @@ public: void Reset() { - me->SetLevitate(true); + me->SetDisableGravity(true); bPointReached = true; uiTimer = urand(500, 1000); uiCheckTimer = 1000; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index eee6b08d834..df8d9bb83f8 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -324,14 +324,14 @@ 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->setFaction(35); @@ -409,7 +409,7 @@ 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();} diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index 8bbcdd6c036..8d29cfefc6e 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -632,7 +632,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/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp index bf3d07ad5ae..3f088bf00b9 100644 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ b/src/server/scripts/EasternKingdoms/undercity.cpp @@ -114,7 +114,7 @@ public: summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false); } - summoned->SetLevitate(true); + summoned->SetDisableGravity(true); targetGUID = summoned->GetGUID(); } } @@ -184,7 +184,7 @@ public: { if (EventMove_Timer <= diff) { - me->SetLevitate(true); + 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; diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp index 07766455495..1a31c29f5bb 100644 --- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp @@ -355,7 +355,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->SetLevitate(true); + Ughost->SetDisableGravity(true); DoScriptText(SAY_WP_4, Ughost, me); m_uiChatTimer = 4000; break; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index ecc6b865b3d..e1d7d97e0b8 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -459,7 +459,7 @@ public: { trigger->SetVisible(false); trigger->setFaction(me->getFaction()); - trigger->SetLevitate(true); + trigger->SetDisableGravity(true); trigger->CastSpell(me, SPELL_METEOR, true); } me->GetMotionMaster()->Clear(); @@ -1176,7 +1176,7 @@ public: { FrostBreathTimer = 5000; MoveTimer = 0; - me->SetLevitate(true); + me->SetDisableGravity(true); } void WaypointReached(uint32 i) @@ -1298,7 +1298,7 @@ public: Zpos = 10.0f; StrikeTimer = 2000+rand()%5000; MoveTimer = 0; - me->SetLevitate(true); + me->SetDisableGravity(true); } void WaypointReached(uint32 i) diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index 3b42fc3ed7b..3b3dfae92b2 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -261,7 +261,7 @@ 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); @@ -414,7 +414,7 @@ public: 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/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index 2c21ac18752..2c498cfdc43 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -576,7 +576,7 @@ public: break; case 10: Merithra->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Merithra->SetLevitate(true); + Merithra->SetDisableGravity(true); Merithra->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 3); break; case 11: @@ -603,7 +603,7 @@ public: break; case 18: Arygos->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Arygos->SetLevitate(true); + Arygos->SetDisableGravity(true); Arygos->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 42); break; case 19: @@ -630,7 +630,7 @@ public: break; case 26: Caelestrasz->HandleEmoteCommand(254); - Caelestrasz->SetLevitate(true); + Caelestrasz->SetDisableGravity(true); Caelestrasz->GetMotionMaster()->MoveCharge(-8065, 1530, 7.61f, 4); break; case 27: @@ -769,7 +769,7 @@ public: break; case 63: me->HandleEmoteCommand(254); - me->SetLevitate(true); + me->SetDisableGravity(true); break; case 64: me->GetMotionMaster()->MoveCharge(-8000, 1400, 150, 9); 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 636be5e29be..c756aa4f232 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp @@ -349,6 +349,7 @@ 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); 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 03a04648793..3407b42b2a7 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->SetLevitate(false); + 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->SetLevitate(false); + 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->SetLevitate(true); + me->SetCanFly(true); + me->SetDisableGravity(true); me->SetReactState(REACT_PASSIVE); me->GetMotionMaster()->MovePoint(POINT_FLIGHT, SavianaRagefireFlyPos); events.ScheduleEvent(EVENT_FLIGHT, 50000); 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 7dcdaa28879..b64e324d4da 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -571,7 +571,10 @@ class mob_frost_sphere : public CreatureScript { _isFalling = false; me->SetReactState(REACT_PASSIVE); - me->SetFlying(true); + //! 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); 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 0e604566276..3e2427d66b3 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -576,8 +576,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->SetLevitate(true); - me->SetFlying(true); + me->SetDisableGravity(true); + me->SetCanFly(true); SetCombatMovement(false); MoveToNextPoint(); m_uiRangeCheckTimer = IN_MILLISECONDS; diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp index 8e211cbd2cb..6520d58da20 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,6 +454,7 @@ 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->GetMotionMaster()->MovePoint(0, outroPos[6]); 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..88e9bedcd07 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); } 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 8ee0ef02cbd..c557b6ad831 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -1058,7 +1058,7 @@ class npc_blood_queen_lana_thel : public CreatureScript void Reset() { _events.Reset(); - me->SetLevitate(true); + me->SetDisableGravity(true); if (_instance->GetBossState(DATA_BLOOD_PRINCE_COUNCIL) == DONE) { me->SetVisible(false); 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 5eeb941d9aa..784cda8f595 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 @@ -198,8 +198,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); @@ -216,9 +216,9 @@ class boss_blood_queen_lana_thel : public CreatureScript _killMinchar = true; else { - me->SetLevitate(true); - 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); } @@ -230,9 +230,9 @@ class boss_blood_queen_lana_thel : public CreatureScript if (_killMinchar) { _killMinchar = false; - me->SetLevitate(true); - 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 +244,9 @@ class boss_blood_queen_lana_thel : public CreatureScript void JustReachedHome() { - me->SetLevitate(false); - 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 +295,9 @@ class boss_blood_queen_lana_thel : public CreatureScript events.ScheduleEvent(EVENT_AIR_FLY_DOWN, 10000); break; case POINT_GROUND: - me->SetLevitate(false); - 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 +372,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; @@ -424,9 +424,9 @@ class boss_blood_queen_lana_thel : public CreatureScript me->GetMotionMaster()->MovePoint(POINT_CENTER, centerPos); break; case EVENT_AIR_START_FLYING: - me->SetLevitate(true); - 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; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 5177f65f670..e57fd7bbcb8 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -605,7 +605,7 @@ 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->SetLevitate(false); + me->SetDisableGravity(false); me->SendMovementFlagUpdate(); me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f); me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f); @@ -629,7 +629,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript { if (spell->Id == SPELL_GRIP_OF_AGONY) { - me->SetLevitate(true); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(POINT_CHOKE, chokePos[0]); } } @@ -812,7 +812,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript { me->RemoveAurasDueToSpell(SPELL_GRIP_OF_AGONY); Talk(SAY_OUTRO_ALLIANCE_1); - me->SetLevitate(false); + me->SetDisableGravity(false); me->SendMovementFlagUpdate(); me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f); me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f); @@ -832,7 +832,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript { if (spell->Id == SPELL_GRIP_OF_AGONY) { - me->SetLevitate(true); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(POINT_CHOKE, chokePos[0]); } } @@ -934,7 +934,7 @@ class npc_saurfang_event : public CreatureScript { if (spell->Id == SPELL_GRIP_OF_AGONY) { - me->SetLevitate(true); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(POINT_CHOKE, chokePos[_index]); } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 01879240e3a..649efc59681 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -198,8 +198,8 @@ class boss_sindragosa : public CreatureScript if (instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) != 255) { - me->SetFlying(true); - me->SetLevitate(true); + me->SetCanFly(true); + me->SetDisableGravity(true); } } @@ -228,8 +228,8 @@ class boss_sindragosa : public CreatureScript { BossAI::JustReachedHome(); instance->SetBossState(DATA_SINDRAGOSA, FAIL); - me->SetFlying(false); - me->SetLevitate(false); + me->SetCanFly(false); + me->SetDisableGravity(false); } void KilledUnit(Unit* victim) @@ -275,8 +275,8 @@ class boss_sindragosa : public CreatureScript { case POINT_FROSTWYRM_LAND: me->setActive(false); - me->SetFlying(false); - me->SetLevitate(false); + me->SetCanFly(false); + me->SetDisableGravity(false); me->SetHomePosition(SindragosaLandPos); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetSpeed(MOVE_FLIGHT, 2.0f); @@ -292,8 +292,8 @@ class boss_sindragosa : public CreatureScript events.ScheduleEvent(EVENT_FROST_BOMB, 8000); break; case POINT_LAND: - me->SetFlying(false); - me->SetLevitate(false); + me->SetCanFly(false); + me->SetDisableGravity(false); me->SetReactState(REACT_DEFENSIVE); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); @@ -425,8 +425,8 @@ class boss_sindragosa : public CreatureScript { _isInAirPhase = true; Talk(SAY_AIR_PHASE); - me->SetFlying(true); - me->SetLevitate(true); + me->SetCanFly(true); + me->SetDisableGravity(true); me->SetReactState(REACT_PASSIVE); Position pos; pos.Relocate(me); @@ -617,8 +617,8 @@ class npc_spinestalker : public CreatureScript if (_instance->GetData(DATA_SPINESTALKER) != 255) { - me->SetFlying(true); - me->SetLevitate(true); + me->SetCanFly(true); + me->SetDisableGravity(true); } } @@ -660,8 +660,8 @@ class npc_spinestalker : public CreatureScript return; me->setActive(false); - me->SetFlying(false); - me->SetLevitate(false); + me->SetCanFly(false); + me->SetDisableGravity(false); me->SetHomePosition(SpinestalkerLandPos); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -742,8 +742,8 @@ class npc_rimefang : public CreatureScript if (_instance->GetData(DATA_RIMEFANG) != 255) { - me->SetFlying(true); - me->SetLevitate(true); + me->SetCanFly(true); + me->SetDisableGravity(true); } } @@ -785,8 +785,8 @@ class npc_rimefang : public CreatureScript return; me->setActive(false); - me->SetFlying(false); - me->SetLevitate(false); + me->SetCanFly(false); + me->SetDisableGravity(false); me->SetHomePosition(RimefangLandPos); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } @@ -819,7 +819,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 +840,7 @@ class npc_rimefang : public CreatureScript { me->SetReactState(REACT_DEFENSIVE); AttackStart(victim); - me->SetFlying(false); + me->SetCanFly(false); } break; default: 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 19a8e42e14b..554ac228be0 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -500,8 +500,8 @@ class boss_the_lich_king : public CreatureScript { _JustDied(); DoCastAOE(SPELL_PLAY_MOVIE, false); - me->SetLevitate(false); - me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x03); + me->SetDisableGravity(false); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_UNK_3); me->GetMotionMaster()->MoveFall(); } @@ -1073,8 +1073,8 @@ class boss_the_lich_king : public CreatureScript DoCastAOE(SPELL_SOUL_BARRAGE); sCreatureTextMgr->SendSound(me, SOUND_PAIN, CHAT_MSG_MONSTER_YELL, 0, TEXT_RANGE_NORMAL, TEAM_OTHER, false); // set flight - me->SetLevitate(true); - me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x03); + me->SetDisableGravity(true); + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_UNK_3); me->GetMotionMaster()->MovePoint(POINT_LK_OUTRO_2, OutroFlying); break; case EVENT_OUTRO_TALK_7: diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 60e85165cd5..ef222963dfb 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -796,7 +796,7 @@ class boss_sister_svalna : public CreatureScript { _JustReachedHome(); me->SetReactState(REACT_PASSIVE); - me->SetFlying(false); + me->SetCanFly(false); } void DoAction(int32 const action) @@ -844,7 +844,7 @@ class boss_sister_svalna : public CreatureScript _isEventInProgress = false; me->setActive(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); - me->SetFlying(false); + me->SetCanFly(false); } void SpellHitTarget(Unit* target, SpellInfo const* spell) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index abd16cd9c93..e37ceb6925f 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -296,7 +296,7 @@ public: { case EVENT_LIFTOFF: me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - me->SetLevitate(true); + 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->SetLevitate(false); + me->SetDisableGravity(false); me->SendMovementFlagUpdate(); events.ScheduleEvent(EVENT_GROUND, 1500); return; diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index e03440cec98..9e889bb9941 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -240,7 +240,7 @@ 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->SetLevitate(true); + me->SetDisableGravity(true); BossAI::EnterEvadeMode(); @@ -354,8 +354,8 @@ public: { _EnterCombat(); - me->SetLevitate(false); - me->SetFlying(false); + me->SetDisableGravity(false); + me->SetCanFly(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -412,8 +412,8 @@ public: void PrepareForVortex() { - me->SetLevitate(true); - 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->SetLevitate(true); - 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->SetLevitate(false); - malygos->SetFlying(false); + malygos->SetDisableGravity(false); + malygos->SetCanFly(false); malygos->GetMotionMaster()->MoveChase(caster->getVictim()); malygos->RemoveAura(SPELL_VORTEX_1); diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp index 9671d59bcec..357b0bad13c 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp @@ -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 187dbed6901..7ebaac1e938 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -170,6 +170,7 @@ class npc_azure_ring_captain : public CreatureScript targetGUID = 0; me->SetWalk(true); + //! HACK: Creature's can't have MOVEMENTFLAG_FLYING me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); me->SetReactState(REACT_AGGRESSIVE); } 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 1671953aba1..f7c523d1521 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 @@ -575,7 +575,7 @@ class boss_stormcaller_brundir : public CreatureScript _Reset(); phase = 0; me->RemoveAllAuras(); - me->SetLevitate(false); + 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); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index d245c77b9df..85b5c13c6ee 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -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; @@ -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); 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..7d37621e787 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 @@ -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); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp index 656b2931abb..d40dba22fcd 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp @@ -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); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index dd3557071cd..5ce26ab1467 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -217,7 +217,7 @@ public: 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) @@ -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; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index a4289b2eb06..10dc8957d93 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -91,12 +91,6 @@ enum SvalaPhase INTRO, NORMAL, SACRIFICING, - SVALADEAD -}; - -enum SvalaPoint -{ - POINT_FALL_GROUND = 1, }; #define DATA_INCREDIBLE_HULK 2043 @@ -158,15 +152,11 @@ public: summons.DespawnAll(); me->RemoveAllAuras(); - if (Phase > INTRO) - { - me->SetFlying(true); - me->SetLevitate(true); - } - if (Phase > NORMAL) Phase = NORMAL; + me->SetDisableGravity(Phase == NORMAL); + introTimer = 1 * IN_MILLISECONDS; introPhase = 0; arthasGUID = 0; @@ -178,17 +168,6 @@ public: } } - void JustReachedHome() - { - if (Phase > INTRO) - { - me->SetFlying(false); - me->SetLevitate(false); - me->SetOrientation(1.58f); - me->SendMovementFlagUpdate(); - } - } - void EnterCombat(Unit* /*who*/) { Talk(SAY_AGGRO); @@ -240,44 +219,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 +273,6 @@ public: break; case 2: arthas->CastSpell(me, SPELL_TRANSFORMING_CHANNEL, false); - me->SetFlying(true); - me->SetLevitate(true); pos.Relocate(me); pos.m_positionZ += 8.0f; me->GetMotionMaster()->MoveTakeoff(0, pos, 3.30078125f); @@ -382,14 +328,13 @@ public: introTimer = 13800; break; case 8: - me->SetFlying(false); - me->SetLevitate(false); - 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 +348,8 @@ public: break; } } - else introTimer -= diff; + else + introTimer -= diff; return; } @@ -414,33 +360,29 @@ public: if (!UpdateVictim()) return; - if (me->IsWithinMeleeRange(me->getVictim()) && me->HasUnitMovementFlag(MOVEMENTFLAG_LEVITATING)) - { - me->SetFlying(false); - me->SetLevitate(false); - 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 +392,6 @@ public: DoCast(sacrificeTarget, SPELL_RITUAL_PREPARATION); SetCombatMovement(false); - me->SetFlying(true); - me->SetLevitate(true); 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 35bbb98fd77..0d8e22ff630 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp @@ -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->SetLevitate(true); + temp->SetDisableGravity(true); switch (m_uiActiveOrder[m_uiActivedNumber]) { case 0: m_bIsActiveWithBJORN = true; break; diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp index f0445273d43..d43cf6fb98f 100644 --- a/src/server/scripts/Northrend/sholazar_basin.cpp +++ b/src/server/scripts/Northrend/sholazar_basin.cpp @@ -92,7 +92,7 @@ public: me->RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING); me->RemoveUnitMovementFlag(MOVEMENTFLAG_JUMPING); me->SetSpeed(MOVE_SWIM, 0.85f, true); - me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING); + me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_DISABLE_GRAVITY); break; case 19: me->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING); 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..51271cdfe42 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp @@ -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); diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index ace1a2ab717..93b687d3f3d 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -798,7 +798,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); @@ -867,7 +867,7 @@ public: Timer[EVENT_FLIGHT_SEQUENCE] = 2000; break; case 9: // land - me->SetLevitate(false); + me->SetDisableGravity(false); me->StopMoving(); me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); for (uint8 i = 0; i < 2; ++i) @@ -1869,7 +1869,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->SetLevitate(false); + me->SetDisableGravity(false); me->setActive(false); Summons.DespawnAll(); } 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 fbafb9615f7..2df9e0e65ba 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -731,7 +731,7 @@ public: void Reset() { - me->SetLevitate(true); + me->SetDisableGravity(true); me->setFaction(14); MovementTimer = 0; ToxicSporeTimer = 5000; 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 4af20d70816..41a8b12dd51 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp @@ -109,7 +109,7 @@ 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 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/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index 4f422da35ad..66d445c1f39 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,7 +145,7 @@ class boss_nazan : public CreatureScript flight = false; BellowingRoar_Timer = 6000; ConeOfFire_Timer = 12000; - me->SetLevitate(false); + me->SetDisableGravity(false); me->SetWalk(true); me->GetMotionMaster()->Clear(); if (Unit* victim = SelectTarget(SELECT_TARGET_NEAREST, 0)) @@ -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->SetLevitate(true); + summoned->SetDisableGravity(true); summoned->SetSpeed(MOVE_FLIGHT, 2.5f); if (victim) AttackStartNoMove(victim); 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..cc732b86ea4 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); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index fcfe6c0ea16..97ac0b9da5e 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,7 +140,7 @@ 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); } @@ -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); } diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 904b2851816..577c8bf9f54 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -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); diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp index db95f60f556..24ea29702f5 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp @@ -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/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index d5b08d83c71..f46f7f1d745 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -751,7 +751,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; diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index 79d284d779a..be0166b6d19 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -223,7 +223,7 @@ public: me->setFaction(FACTION_DEFAULT); FlyTimer = 10000; - me->SetLevitate(false); + me->SetDisableGravity(false); me->SetVisible(true); } @@ -270,7 +270,7 @@ public: PlayerGUID = 0; } me->SetVisible(false); - me->SetLevitate(false); + me->SetDisableGravity(false); me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); me->RemoveCorpse(); } @@ -308,7 +308,7 @@ public: pos.m_positionZ += 25; } - me->SetLevitate(true); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(1, pos); } } @@ -808,7 +808,7 @@ public: case 19: DoScriptText(LORD_ILLIDAN_SAY_7, Illi); return 5000; break; case 20: Illi->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Illi->SetLevitate(true); + Illi->SetDisableGravity(true); return 500; break; case 21: DoScriptText(OVERLORD_SAY_5, me); return 500; break; case 22: diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index b7aee4a3f07..67b04dab29d 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -421,7 +421,7 @@ public: float x, y, z; me->GetPosition(x, y, z); me->Relocate(x, y, z + 0.94f); - me->SetLevitate(true); + me->SetDisableGravity(true); me->HandleEmoteCommand(EMOTE_ONESHOT_DANCE); WorldPacket data; //send update position to client me->BuildHeartBeatMsg(&data); @@ -1937,6 +1937,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); -- cgit v1.2.3 From 20cd4c71ee6336610daab304959909b2f6397287 Mon Sep 17 00:00:00 2001 From: thomas33 Date: Wed, 14 Mar 2012 17:51:11 +0100 Subject: Core: more more cleanup --- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 20 +- src/server/game/AuctionHouse/AuctionHouseMgr.h | 2 +- src/server/game/Entities/Item/Container/Bag.cpp | 36 +- src/server/game/Entities/Item/Container/Bag.h | 2 +- src/server/game/Entities/Item/Item.cpp | 10 +- src/server/game/Entities/Player/Player.cpp | 946 ++++++++++----------- src/server/game/Entities/Player/Player.h | 54 +- src/server/game/Groups/Group.cpp | 8 +- src/server/game/Guilds/Guild.cpp | 128 +-- src/server/game/Guilds/Guild.h | 22 +- src/server/game/Handlers/AuctionHouseHandler.cpp | 6 +- src/server/game/Handlers/ItemHandler.cpp | 124 +-- src/server/game/Handlers/LootHandler.cpp | 22 +- src/server/game/Handlers/SpellHandler.cpp | 38 +- src/server/game/Mails/Mail.cpp | 4 +- src/server/game/Scripting/ScriptMgr.cpp | 4 +- src/server/game/Scripting/ScriptMgr.h | 4 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 18 +- src/server/game/Spells/Spell.cpp | 36 +- src/server/game/Spells/SpellEffects.cpp | 18 +- src/server/scripts/Commands/cs_npc.cpp | 12 +- .../TrialOfTheChampion/boss_grand_champions.cpp | 6 +- .../TrialOfTheChampion/trial_of_the_champion.cpp | 12 +- .../Outland/BlackTemple/illidari_council.cpp | 30 +- src/server/scripts/Spells/spell_item.cpp | 4 +- src/server/scripts/World/item_scripts.cpp | 34 +- src/server/scripts/World/npc_professions.cpp | 8 +- 27 files changed, 804 insertions(+), 804 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index a2e958d680f..43f3ff50fd8 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -64,9 +64,9 @@ AuctionHouseObject* AuctionHouseMgr::GetAuctionsMap(uint32 factionTemplateId) return &mNeutralAuctions; } -uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* pItem, uint32 count) +uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* item, uint32 count) { - uint32 MSV = pItem->GetTemplate()->SellPrice; + uint32 MSV = item->GetTemplate()->SellPrice; if (MSV <= 0) return AH_MINIMUM_DEPOSIT; @@ -89,8 +89,8 @@ uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 //does not clear ram void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& trans) { - Item* pItem = GetAItem(auction->item_guidlow); - if (!pItem) + Item* item = GetAItem(auction->item_guidlow); + if (!item) return; uint32 bidder_accId = 0; @@ -127,7 +127,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& uint32 owner_accid = sObjectMgr->GetPlayerAccountIdByGUID(auction->owner); sLog->outCommand(bidder_accId, "GM %s (Account: %u) won item in auction: %s (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)", - bidder_name.c_str(), bidder_accId, pItem->GetTemplate()->Name1.c_str(), pItem->GetEntry(), pItem->GetCount(), auction->bid, owner_name.c_str(), owner_accid); + bidder_name.c_str(), bidder_accId, item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount(), auction->bid, owner_name.c_str(), owner_accid); } } @@ -147,7 +147,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& // owner in `data` will set at mail receive and item extracting PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_OWNER); stmt->setUInt32(0, auction->bidder); - stmt->setUInt32(1, pItem->GetGUIDLow()); + stmt->setUInt32(1, item->GetGUIDLow()); trans->Append(stmt); if (bidder) @@ -158,7 +158,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& } MailDraft(msgAuctionWonSubject.str(), msgAuctionWonBody.str()) - .AddItem(pItem) + .AddItem(item) .SendMailTo(trans, MailReceiver(bidder, auction->bidder), auction, MAIL_CHECK_MASK_COPIED); } } @@ -234,8 +234,8 @@ 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); - if (!pItem) + Item* item = GetAItem(auction->item_guidlow); + if (!item) return; uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER); @@ -251,7 +251,7 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, SQLTransacti owner->GetSession()->SendAuctionOwnerNotification(auction); MailDraft(subject.str(), "") // TODO: fix body - .AddItem(pItem) + .AddItem(item) .SendMailTo(trans, MailReceiver(owner, auction->owner), auction, MAIL_CHECK_MASK_COPIED, 0); } } diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h index 190fbcc5107..d5432f7b00c 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.h +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h @@ -154,7 +154,7 @@ class AuctionHouseMgr void SendAuctionOutbiddedMail(AuctionEntry* auction, uint32 newPrice, Player* newBidder, SQLTransaction& trans); void SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQLTransaction& trans); - static uint32 GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* pItem, uint32 count); + static uint32 GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* item, uint32 count); static AuctionHouseEntry const* GetAuctionHouseEntry(uint32 factionTemplateId); public: diff --git a/src/server/game/Entities/Item/Container/Bag.cpp b/src/server/game/Entities/Item/Container/Bag.cpp index 4eede93bd37..1b9d5c12978 100755 --- a/src/server/game/Entities/Item/Container/Bag.cpp +++ b/src/server/game/Entities/Item/Container/Bag.cpp @@ -153,18 +153,18 @@ void Bag::RemoveItem(uint8 slot, bool /*update*/) SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), 0); } -void Bag::StoreItem(uint8 slot, Item* pItem, bool /*update*/) +void Bag::StoreItem(uint8 slot, Item* item, bool /*update*/) { ASSERT(slot < MAX_BAG_SIZE); - if (pItem && pItem->GetGUID() != this->GetGUID()) + if (item && item->GetGUID() != this->GetGUID()) { - m_bagslot[slot] = pItem; - SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), pItem->GetGUID()); - pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); - pItem->SetUInt64Value(ITEM_FIELD_OWNER, GetOwnerGUID()); - pItem->SetContainer(this); - pItem->SetSlot(slot); + m_bagslot[slot] = item; + SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), item->GetGUID()); + item->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); + item->SetUInt64Value(ITEM_FIELD_OWNER, GetOwnerGUID()); + item->SetContainer(this); + item->SetSlot(slot); } } @@ -189,22 +189,22 @@ bool Bag::IsEmpty() const uint32 Bag::GetItemCount(uint32 item, Item* eItem) const { - Item* pItem; + Item* item; uint32 count = 0; for (uint32 i=0; i < GetBagSize(); ++i) { - pItem = m_bagslot[i]; - if (pItem && pItem != eItem && pItem->GetEntry() == item) - count += pItem->GetCount(); + item = m_bagslot[i]; + if (item && item != eItem && item->GetEntry() == item) + count += item->GetCount(); } if (eItem && eItem->GetTemplate()->GemProperties) { for (uint32 i=0; i < GetBagSize(); ++i) { - pItem = m_bagslot[i]; - if (pItem && pItem != eItem && pItem->GetTemplate()->Socket[0].Color) - count += pItem->GetGemCountWithID(item); + item = m_bagslot[i]; + if (item && item != eItem && item->GetTemplate()->Socket[0].Color) + count += item->GetGemCountWithID(item); } } @@ -215,9 +215,9 @@ uint32 Bag::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem) { uint32 count = 0; for (uint32 i = 0; i < GetBagSize(); ++i) - if (Item* pItem = m_bagslot[i]) - if (pItem != skipItem) - if (ItemTemplate const* pProto = pItem->GetTemplate()) + if (Item* item = m_bagslot[i]) + if (item != skipItem) + if (ItemTemplate const* pProto = item->GetTemplate()) if (pProto->ItemLimitCategory == limitCategory) count += m_bagslot[i]->GetCount(); diff --git a/src/server/game/Entities/Item/Container/Bag.h b/src/server/game/Entities/Item/Container/Bag.h index 5a533d9cf57..79acd9ba4af 100755 --- a/src/server/game/Entities/Item/Container/Bag.h +++ b/src/server/game/Entities/Item/Container/Bag.h @@ -38,7 +38,7 @@ class Bag : public Item bool Create(uint32 guidlow, uint32 itemid, Player const* owner); void Clear(); - void StoreItem(uint8 slot, Item* pItem, bool update); + void StoreItem(uint8 slot, Item* item, bool update); void RemoveItem(uint8 slot, bool update); Item* GetItemByPos(uint8 slot) const; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 90f6f4a217c..4e76ddfe0a8 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1021,14 +1021,14 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player) ASSERT(count !=0 && "pProto->Stackable == 0 but checked at loading already"); - Item* pItem = NewItemOrBag(pProto); - if (pItem->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), item, player)) + Item* item = NewItemOrBag(pProto); + if (item->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), item, player)) { - pItem->SetCount(count); - return pItem; + item->SetCount(count); + return item; } else - delete pItem; + delete item; } else ASSERT(false); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f0b974fa673..a1e8ddd95d1 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1160,31 +1160,31 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) // or ammo not equipped in special bag for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) { - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { uint16 eDest; // equip offhand weapon/shield if it attempt equipped before main-hand weapon - InventoryResult msg = CanEquipItem(NULL_SLOT, eDest, pItem, false); + InventoryResult msg = CanEquipItem(NULL_SLOT, eDest, item, false); if (msg == EQUIP_ERR_OK) { RemoveItem(INVENTORY_SLOT_BAG_0, i, true); - EquipItem(eDest, pItem, true); + EquipItem(eDest, item, true); } // move other items to more appropriate slots (ammo not equipped in special bag) else { ItemPosCountVec sDest; - msg = CanStoreItem(NULL_BAG, NULL_SLOT, sDest, pItem, false); + msg = CanStoreItem(NULL_BAG, NULL_SLOT, sDest, item, false); if (msg == EQUIP_ERR_OK) { RemoveItem(INVENTORY_SLOT_BAG_0, i, true); - pItem = StoreItem(sDest, pItem, true); + item = StoreItem(sDest, item, true); } // if this is ammo then use it - msg = CanUseAmmo(pItem->GetEntry()); + msg = CanUseAmmo(item->GetEntry()); if (msg == EQUIP_ERR_OK) - SetAmmo(pItem->GetEntry()); + SetAmmo(item->GetEntry()); } } } @@ -4854,15 +4854,15 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC continue; } - Item* pItem = NewItemOrBag(itemProto); - if (!pItem->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), fields, item_template)) + Item* item = NewItemOrBag(itemProto); + if (!item->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), fields, item_template)) { - pItem->FSetState(ITEM_REMOVED); - pItem->SaveToDB(trans); // it also deletes item object! + item->FSetState(ITEM_REMOVED); + item->SaveToDB(trans); // it also deletes item object! continue; } - draft.AddItem(pItem); + draft.AddItem(item); } while (resultItems->NextRow()); } @@ -5270,8 +5270,8 @@ Corpse* Player::GetCorpse() const 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)) - DurabilityLoss(pItem, percent); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + DurabilityLoss(item, percent); if (inventory) { @@ -5279,8 +5279,8 @@ void Player::DurabilityLossAll(double percent, bool inventory) // for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityLoss(pItem, percent); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + DurabilityLoss(item, percent); // keys not have durability //for (int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++) @@ -5288,8 +5288,8 @@ void Player::DurabilityLossAll(double percent, bool inventory) 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++) - if (Item* pItem = GetItemByPos(i, j)) - DurabilityLoss(pItem, percent); + if (Item* item = GetItemByPos(i, j)) + DurabilityLoss(item, percent); } } @@ -5314,8 +5314,8 @@ void Player::DurabilityLoss(Item* item, double percent) void Player::DurabilityPointsLossAll(int32 points, bool inventory) { for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; i++) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityPointsLoss(pItem, points); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + DurabilityPointsLoss(item, points); if (inventory) { @@ -5323,8 +5323,8 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory) // for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityPointsLoss(pItem, points); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + DurabilityPointsLoss(item, points); // keys not have durability //for (int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++) @@ -5332,8 +5332,8 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory) 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++) - if (Item* pItem = GetItemByPos(i, j)) - DurabilityPointsLoss(pItem, points); + if (Item* item = GetItemByPos(i, j)) + DurabilityPointsLoss(item, points); } } @@ -5366,8 +5366,8 @@ void Player::DurabilityPointsLoss(Item* item, int32 points) void Player::DurabilityPointLossForEquipSlot(EquipmentSlots slot) { - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) - DurabilityPointsLoss(pItem, 1); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) + DurabilityPointsLoss(item, 1); } uint32 Player::DurabilityRepairAll(bool cost, float discountMod, bool guildBank) @@ -9916,13 +9916,13 @@ InventoryResult Player::CanUnequipItems(uint32 item, uint32 count) const InventoryResult res = EQUIP_ERR_OK; for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetEntry() == item) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetEntry() == item) { InventoryResult ires = CanUnequipItem(INVENTORY_SLOT_BAG_0 << 8 | i, false); if (ires == EQUIP_ERR_OK) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return EQUIP_ERR_OK; } @@ -9931,19 +9931,19 @@ InventoryResult Player::CanUnequipItems(uint32 item, uint32 count) const } for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetEntry() == item) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetEntry() == item) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) 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) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetEntry() == item) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return EQUIP_ERR_OK; } @@ -9951,10 +9951,10 @@ InventoryResult Player::CanUnequipItems(uint32 item, uint32 count) const 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) - if (Item* pItem = GetItemByPos(i, j)) - if (pItem->GetEntry() == item) + if (Item* item = GetItemByPos(i, j)) + if (item->GetEntry() == item) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return EQUIP_ERR_OK; } @@ -9967,14 +9967,14 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const { uint32 count = 0; for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem && pItem->GetEntry() == item) - count += pItem->GetCount(); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item != skipItem && item->GetEntry() == item) + count += item->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(); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item != skipItem && item->GetEntry() == item) + count += item->GetCount(); for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) @@ -9982,16 +9982,16 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const if (skipItem && skipItem->GetTemplate()->GemProperties) for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem && pItem->GetTemplate()->Socket[0].Color) - count += pItem->GetGemCountWithID(item); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item != skipItem && item->GetTemplate()->Socket[0].Color) + count += item->GetGemCountWithID(item); if (inBankAlso) { for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem && pItem->GetEntry() == item) - count += pItem->GetCount(); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item != skipItem && item->GetEntry() == item) + count += item->GetCount(); for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) @@ -9999,9 +9999,9 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const if (skipItem && skipItem->GetTemplate()->GemProperties) for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem && pItem->GetTemplate()->Socket[0].Color) - count += pItem->GetGemCountWithID(item); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item != skipItem && item->GetTemplate()->Socket[0].Color) + count += item->GetGemCountWithID(item); } return count; @@ -10011,29 +10011,29 @@ uint32 Player::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipIte { uint32 count = 0; for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem) - if (ItemTemplate const* pProto = pItem->GetTemplate()) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item != skipItem) + if (ItemTemplate const* pProto = item->GetTemplate()) if (pProto->ItemLimitCategory == limitCategory) - count += pItem->GetCount(); + count += item->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 (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item != skipItem) + if (ItemTemplate const* pProto = item->GetTemplate()) if (pProto->ItemLimitCategory == limitCategory) - count += pItem->GetCount(); + count += item->GetCount(); for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) count += pBag->GetItemCountWithLimitCategory(limitCategory, skipItem); for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem) - if (ItemTemplate const* pProto = pItem->GetTemplate()) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item != skipItem) + if (ItemTemplate const* pProto = item->GetTemplate()) if (pProto->ItemLimitCategory == limitCategory) - count += pItem->GetCount(); + count += item->GetCount(); for (int i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) @@ -10045,33 +10045,33 @@ uint32 Player::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipIte Item* Player::GetItemByGuid(uint64 guid) const { for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetGUID() == guid) - return pItem; + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetGUID() == guid) + return item; 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; + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetGUID() == guid) + return item; for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetGUID() == guid) - return pItem; + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetGUID() == guid) + return item; 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) - if (Item* pItem = pBag->GetItemByPos(j)) - if (pItem->GetGUID() == guid) - return pItem; + if (Item* item = pBag->GetItemByPos(j)) + if (item->GetGUID() == guid) + return item; for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) - if (Item* pItem = pBag->GetItemByPos(j)) - if (pItem->GetGUID() == guid) - return pItem; + if (Item* item = pBag->GetItemByPos(j)) + if (item->GetGUID() == guid) + return item; return NULL; } @@ -10262,20 +10262,20 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const uint32 tempcount = 0; for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; i++) { - Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) + Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (item && item->GetEntry() == item && !item->IsInTrade()) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) 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()) + Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (item && item->GetEntry() == item && !item->IsInTrade()) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return true; } @@ -10286,10 +10286,10 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const { for (uint32 j = 0; j < pBag->GetBagSize(); j++) { - Item* pItem = GetItemByPos(i, j); - if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) + Item* item = GetItemByPos(i, j); + if (item && item->GetEntry() == item && !item->IsInTrade()) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return true; } @@ -10301,10 +10301,10 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const { for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; i++) { - Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) + Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (item && item->GetEntry() == item && !item->IsInTrade()) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return true; } @@ -10315,10 +10315,10 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const { for (uint32 j = 0; j < pBag->GetBagSize(); j++) { - Item* pItem = GetItemByPos(i, j); - if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) + Item* item = GetItemByPos(i, j); + if (item && item->GetEntry() == item && !item->IsInTrade()) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return true; } @@ -10338,10 +10338,10 @@ bool Player::HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_ if (i == except_slot) continue; - Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && pItem->GetEntry() == item) + Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (item && item->GetEntry() == item) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return true; } @@ -10355,10 +10355,10 @@ bool Player::HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_ if (i == except_slot) continue; - Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && pItem->GetTemplate()->Socket[0].Color) + Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (item && item->GetTemplate()->Socket[0].Color) { - tempcount += pItem->GetGemCountWithID(item); + tempcount += item->GetGemCountWithID(item); if (tempcount >= count) return true; } @@ -10376,24 +10376,24 @@ bool Player::HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 if (i == except_slot) continue; - Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (!pItem) + Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (!item) continue; - ItemTemplate const* pProto = pItem->GetTemplate(); + ItemTemplate const* pProto = item->GetTemplate(); if (!pProto) continue; if (pProto->ItemLimitCategory == limitCategory) { - tempcount += pItem->GetCount(); + tempcount += item->GetCount(); if (tempcount >= count) return true; } - if (pProto->Socket[0].Color || pItem->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT)) + if (pProto->Socket[0].Color || item->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT)) { - tempcount += pItem->GetGemCountWithLimitCategory(limitCategory); + tempcount += item->GetGemCountWithLimitCategory(limitCategory); if (tempcount >= count) return true; } @@ -10402,7 +10402,7 @@ bool Player::HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 return false; } -InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count) const +InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* item, uint32* no_space_count) const { ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(entry); if (!pProto) @@ -10412,7 +10412,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - if (pItem && pItem->m_lootGenerated) + if (item && item->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; // no maximum @@ -10421,7 +10421,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item if (pProto->MaxCount > 0) { - uint32 curcount = GetItemCount(pProto->ItemId, true, pItem); + uint32 curcount = GetItemCount(pProto->ItemId, true, item); if (curcount + count > uint32(pProto->MaxCount)) { if (no_space_count) @@ -10443,7 +10443,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item if (limitEntry->mode == ITEM_LIMIT_CATEGORY_MODE_HAVE) { - uint32 curcount = GetItemCountWithLimitCategory(pProto->ItemLimitCategory, pItem); + uint32 curcount = GetItemCountWithLimitCategory(pProto->ItemLimitCategory, item); if (curcount + count > uint32(limitEntry->maxCount)) { if (no_space_count) @@ -10458,17 +10458,17 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item bool Player::HasItemTotemCategory(uint32 TotemCategory) const { - Item* pItem; + Item* item; 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)) + item = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i); + if (item && IsTotemCategoryCompatiableWith(item->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)) + item = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i); + if (item && IsTotemCategoryCompatiableWith(item->GetTemplate()->TotemCategory, TotemCategory)) return true; } for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) @@ -10477,8 +10477,8 @@ bool Player::HasItemTotemCategory(uint32 TotemCategory) const { for (uint32 j = 0; j < pBag->GetBagSize(); ++j) { - pItem = GetUseableItemByPos(i, j); - if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory, TotemCategory)) + item = GetUseableItemByPos(i, j); + if (item && IsTotemCategoryCompatiableWith(item->GetTemplate()->TotemCategory, TotemCategory)) return true; } } @@ -10681,7 +10681,7 @@ InventoryResult Player::CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 sl return EQUIP_ERR_OK; } -InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 entry, uint32 count, Item* pItem, bool swap, uint32* no_space_count) const +InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 entry, uint32 count, Item* item, bool swap, uint32* no_space_count) const { sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count); @@ -10693,17 +10693,17 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED :EQUIP_ERR_ITEM_NOT_FOUND; } - if (pItem) + if (item) { // item used - if (pItem->m_lootGenerated) + if (item->m_lootGenerated) { if (no_space_count) *no_space_count = count; return EQUIP_ERR_ALREADY_LOOTED; } - if (pItem->IsBindedNotWith(this)) + if (item->IsBindedNotWith(this)) { if (no_space_count) *no_space_count = count; @@ -10713,7 +10713,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des // check count of items (skip for auto move for same player from bank) uint32 no_similar_count = 0; // can't store this amount similar items - InventoryResult res = CanTakeMoreSimilarItems(entry, count, pItem, &no_similar_count); + InventoryResult res = CanTakeMoreSimilarItems(entry, count, item, &no_similar_count); if (res != EQUIP_ERR_OK) { if (count == no_similar_count) @@ -10728,7 +10728,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des // in specific slot if (bag != NULL_BAG && slot != NULL_SLOT) { - res = CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, pItem); + res = CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, item); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10757,7 +10757,7 @@ 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); + res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, true, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10775,7 +10775,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des 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); + res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10796,9 +10796,9 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des else // equipped bag { // we need check 2 time (specialized/non_specialized), use NULL_BAG to prevent skipping bag - res = CanStoreItem_InBag(bag, dest, pProto, count, true, false, pItem, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, true, false, item, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = CanStoreItem_InBag(bag, dest, pProto, count, true, true, pItem, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, true, true, item, NULL_BAG, slot); if (res != EQUIP_ERR_OK) { @@ -10826,7 +10826,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des 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); + res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, KEYRING_SLOT_START+keyringSize, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10844,7 +10844,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10864,7 +10864,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) { - res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10883,7 +10883,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } } - res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10903,9 +10903,9 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } else // equipped bag { - res = CanStoreItem_InBag(bag, dest, pProto, count, false, false, pItem, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, false, false, item, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = CanStoreItem_InBag(bag, dest, pProto, count, false, true, pItem, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, false, true, item, NULL_BAG, slot); if (res != EQUIP_ERR_OK) { @@ -10931,7 +10931,7 @@ 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); + res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, true, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10949,7 +10949,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des 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); + res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10971,7 +10971,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des { for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, true, false, pItem, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, true, false, item, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -10989,7 +10989,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, true, true, pItem, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, true, true, item, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11011,7 +11011,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des 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); + res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, KEYRING_SLOT_START+keyringSize, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -11031,7 +11031,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) { - res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -11052,7 +11052,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des 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); + res = CanStoreItem_InBag(i, dest, pProto, count, false, false, item, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11068,11 +11068,11 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } } - if (pItem && pItem->IsNotEmptyBag()) + if (item && item->IsNotEmptyBag()) return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG; // search free slot - res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -11092,7 +11092,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, false, true, pItem, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, false, true, item, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11162,30 +11162,30 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const // check free space for all items for (int k = 0; k < count; ++k) { - Item* pItem = pItems[k]; + Item* item = pItems[k]; // no item - if (!pItem) continue; + if (!item) 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(); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItems %i. item = %u, count = %u", k + 1, item->GetEntry(), item->GetCount()); + ItemTemplate const* pProto = item->GetTemplate(); // strange item if (!pProto) return EQUIP_ERR_ITEM_NOT_FOUND; // item used - if (pItem->m_lootGenerated) + if (item->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; // item it 'bind' - if (pItem->IsBindedNotWith(this)) + if (item->IsBindedNotWith(this)) return EQUIP_ERR_DONT_OWN_THAT_ITEM; ItemTemplate const* pBagProto; // item is 'one item only' - InventoryResult res = CanTakeMoreSimilarItems(pItem); + InventoryResult res = CanTakeMoreSimilarItems(item); if (res != EQUIP_ERR_OK) return res; @@ -11197,9 +11197,9 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const 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()) + if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_keys[t-KEYRING_SLOT_START] + item->GetCount() <= pProto->GetMaxStackSize()) { - inv_keys[t-KEYRING_SLOT_START] += pItem->GetCount(); + inv_keys[t-KEYRING_SLOT_START] += item->GetCount(); b_found = true; break; } @@ -11209,9 +11209,9 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const 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()) + if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_tokens[t-CURRENCYTOKEN_SLOT_START] + item->GetCount() <= pProto->GetMaxStackSize()) { - inv_tokens[t-CURRENCYTOKEN_SLOT_START] += pItem->GetCount(); + inv_tokens[t-CURRENCYTOKEN_SLOT_START] += item->GetCount(); b_found = true; break; } @@ -11221,9 +11221,9 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const for (int t = INVENTORY_SLOT_ITEM_START; t < INVENTORY_SLOT_ITEM_END; ++t) { pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, t); - if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_slot_items[t-INVENTORY_SLOT_ITEM_START] + pItem->GetCount() <= pProto->GetMaxStackSize()) + if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_slot_items[t-INVENTORY_SLOT_ITEM_START] + item->GetCount() <= pProto->GetMaxStackSize()) { - inv_slot_items[t-INVENTORY_SLOT_ITEM_START] += pItem->GetCount(); + inv_slot_items[t-INVENTORY_SLOT_ITEM_START] += item->GetCount(); b_found = true; break; } @@ -11234,14 +11234,14 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const { if (Bag* bag = GetBagByPos(t)) { - if (ItemCanGoIntoBag(pItem->GetTemplate(), bag->GetTemplate())) + if (ItemCanGoIntoBag(item->GetTemplate(), bag->GetTemplate())) { for (uint32 j = 0; j < bag->GetBagSize(); j++) { pItem2 = GetItemByPos(t, j); - if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_bags[t-INVENTORY_SLOT_BAG_START][j] + pItem->GetCount() <= pProto->GetMaxStackSize()) + if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_bags[t-INVENTORY_SLOT_BAG_START][j] + item->GetCount() <= pProto->GetMaxStackSize()) { - inv_bags[t-INVENTORY_SLOT_BAG_START][j] += pItem->GetCount(); + inv_bags[t-INVENTORY_SLOT_BAG_START][j] += item->GetCount(); b_found = true; break; } @@ -11360,35 +11360,35 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const InventoryResult Player::CanEquipNewItem(uint8 slot, uint16 &dest, uint32 item, bool swap) const { dest = 0; - Item* pItem = Item::CreateItem(item, 1, this); - if (pItem) + Item* item = Item::CreateItem(item, 1, this); + if (item) { - InventoryResult result = CanEquipItem(slot, dest, pItem, swap); - delete pItem; + InventoryResult result = CanEquipItem(slot, dest, item, swap); + delete item; return result; } return EQUIP_ERR_ITEM_NOT_FOUND; } -InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool swap, bool not_loading) const +InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* item, bool swap, bool not_loading) const { dest = 0; - if (pItem) + if (item) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, pItem->GetEntry(), pItem->GetCount()); - ItemTemplate const* pProto = pItem->GetTemplate(); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, item->GetEntry(), item->GetCount()); + ItemTemplate const* pProto = item->GetTemplate(); if (pProto) { // item used - if (pItem->m_lootGenerated) + if (item->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; - if (pItem->IsBindedNotWith(this)) + if (item->IsBindedNotWith(this)) return EQUIP_ERR_DONT_OWN_THAT_ITEM; // check count of items (skip for auto move for same player from bank) - InventoryResult res = CanTakeMoreSimilarItems(pItem); + InventoryResult res = CanTakeMoreSimilarItems(item); if (res != EQUIP_ERR_OK) return res; @@ -11429,7 +11429,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool if (eslot == NULL_SLOT) return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED; - res = CanUseItem(pItem, not_loading); + res = CanUseItem(item, not_loading); if (res != EQUIP_ERR_OK) return res; @@ -11437,7 +11437,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool return EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE; // if swap ignore item (equipped also) - InventoryResult res2 = CanEquipUniqueItem(pItem, swap ? eslot : uint8(NULL_SLOT)); + InventoryResult res2 = CanEquipUniqueItem(item, swap ? eslot : uint8(NULL_SLOT)); if (res2 != EQUIP_ERR_OK) return res2; @@ -11445,7 +11445,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool if (pProto->Class == ITEM_CLASS_QUIVER) for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Item* pBag = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pBag != pItem) + if (pBag != item) if (ItemTemplate const* pBagProto = pBag->GetTemplate()) if (pBagProto->Class == pProto->Class && (!swap || pBag->GetSlot() != eslot)) return (pBagProto->SubClass == ITEM_SUBCLASS_AMMO_POUCH) @@ -11507,20 +11507,20 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const if (!IsEquipmentPos(pos) && !IsBagPos(pos)) return EQUIP_ERR_OK; - Item* pItem = GetItemByPos(pos); + Item* item = GetItemByPos(pos); // Applied only to existed equipped item - if (!pItem) + if (!item) return EQUIP_ERR_OK; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, pItem->GetEntry(), pItem->GetCount()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, item->GetEntry(), item->GetCount()); - ItemTemplate const* pProto = pItem->GetTemplate(); + ItemTemplate const* pProto = item->GetTemplate(); if (!pProto) return EQUIP_ERR_ITEM_NOT_FOUND; // item used - if (pItem->m_lootGenerated) + if (item->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; // do not allow unequipping gear except weapons, offhands, projectiles, relics in @@ -11536,42 +11536,42 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const return EQUIP_ERR_NOT_DURING_ARENA_MATCH; } - if (!swap && pItem->IsNotEmptyBag()) + if (!swap && item->IsNotEmptyBag()) return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS; return EQUIP_ERR_OK; } -InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item* pItem, bool swap, bool not_loading) const +InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item* item, bool swap, bool not_loading) const { - if (!pItem) + if (!item) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; - uint32 count = pItem->GetCount(); + uint32 count = item->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(); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, item->GetEntry(), item->GetCount()); + ItemTemplate const* pProto = item->GetTemplate(); if (!pProto) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; // item used - if (pItem->m_lootGenerated) + if (item->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; - if (pItem->IsBindedNotWith(this)) + if (item->IsBindedNotWith(this)) return EQUIP_ERR_DONT_OWN_THAT_ITEM; // Currency tokens are not supposed to be swapped out of their hidden bag - uint8 pItemslot = pItem->GetSlot(); + uint8 pItemslot = item->GetSlot(); if (pItemslot >= CURRENCYTOKEN_SLOT_START && pItemslot < CURRENCYTOKEN_SLOT_END) { 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); + GetName(), GetGUIDLow(), item->GetGUIDLow(), pProto->ItemId); return EQUIP_ERR_ITEMS_CANT_BE_SWAPPED; } // check count of items (skip for auto move for same player from bank) - InventoryResult res = CanTakeMoreSimilarItems(pItem); + InventoryResult res = CanTakeMoreSimilarItems(item); if (res != EQUIP_ERR_OK) return res; @@ -11580,18 +11580,18 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { if (slot >= BANK_SLOT_BAG_START && slot < BANK_SLOT_BAG_END) { - if (!pItem->IsBag()) + if (!item->IsBag()) return EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT; if (slot - BANK_SLOT_BAG_START >= GetBankBagSlotCount()) return EQUIP_ERR_MUST_PURCHASE_THAT_BAG_SLOT; - res = CanUseItem(pItem, not_loading); + res = CanUseItem(item, not_loading); if (res != EQUIP_ERR_OK) return res; } - res = CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, pItem); + res = CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, item); if (res != EQUIP_ERR_OK) return res; @@ -11604,7 +11604,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest // in specific bag if (bag != NULL_BAG) { - if (pItem->IsNotEmptyBag()) + if (item->IsNotEmptyBag()) return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG; // search stack in bag for merge to @@ -11612,7 +11612,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { if (bag == INVENTORY_SLOT_BAG_0) { - res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, item, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11621,9 +11621,9 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest } else { - res = CanStoreItem_InBag(bag, dest, pProto, count, true, false, pItem, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, true, false, item, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = CanStoreItem_InBag(bag, dest, pProto, count, true, true, pItem, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, true, true, item, NULL_BAG, slot); if (res != EQUIP_ERR_OK) return res; @@ -11636,7 +11636,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest // search free slot in bag if (bag == INVENTORY_SLOT_BAG_0) { - res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11645,9 +11645,9 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest } else { - res = CanStoreItem_InBag(bag, dest, pProto, count, false, false, pItem, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, false, false, item, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = CanStoreItem_InBag(bag, dest, pProto, count, false, true, pItem, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, false, true, item, NULL_BAG, slot); if (res != EQUIP_ERR_OK) return res; @@ -11663,7 +11663,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest if (pProto->Stackable != 1) { // in slots - res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, item, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11675,7 +11675,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, true, false, pItem, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, true, false, item, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11686,7 +11686,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, true, true, pItem, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, true, true, item, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11700,7 +11700,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, false, false, pItem, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, false, false, item, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11710,7 +11710,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest } // search free space - res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); + res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, item, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11719,7 +11719,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, false, true, pItem, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, false, true, item, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11729,11 +11729,11 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest return EQUIP_ERR_BANK_FULL; } -InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const +InventoryResult Player::CanUseItem(Item* item, bool not_loading) const { - if (pItem) + if (item) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", item->GetEntry()); if (!isAlive() && not_loading) return EQUIP_ERR_YOU_ARE_DEAD; @@ -11741,20 +11741,20 @@ InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const //if (isStunned()) // return EQUIP_ERR_YOU_ARE_STUNNED; - ItemTemplate const* pProto = pItem->GetTemplate(); + ItemTemplate const* pProto = item->GetTemplate(); if (pProto) { - if (pItem->IsBindedNotWith(this)) + if (item->IsBindedNotWith(this)) return EQUIP_ERR_DONT_OWN_THAT_ITEM; InventoryResult res = CanUseItem(pProto); if (res != EQUIP_ERR_OK) return res; - if (pItem->GetSkill() != 0) + if (item->GetSkill() != 0) { bool allowEquip = false; - uint32 itemSkill = pItem->GetSkill(); + uint32 itemSkill = item->GetSkill(); // 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)) { @@ -11985,33 +11985,33 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update return StoreNewItem(dest, item, update, randomPropertyId, allowedLooters); } -// Return stored item (if stored to stack, it can diff. from pItem). And pItem ca be deleted in this case. +// Return stored item (if stored to stack, it can diff. from item). And item ca be deleted in this case. Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update, int32 randomPropertyId, AllowedLooterSet& allowedLooters) { uint32 count = 0; for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr) count += itr->count; - Item* pItem = Item::CreateItem(item, count, this); - if (pItem) + Item* item = Item::CreateItem(item, count, this); + if (item) { ItemAddedQuestCheck(item, count); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, count); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, item, 1); if (randomPropertyId) - pItem->SetItemRandomProperties(randomPropertyId); - pItem = StoreItem(dest, pItem, update); + item->SetItemRandomProperties(randomPropertyId); + item = StoreItem(dest, item, update); - const ItemTemplate* proto = pItem->GetTemplate(); + const ItemTemplate* proto = item->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); + CastSpell(this, proto->Spells[i].SpellId, true, item); - if (allowedLooters.size() > 1 && pItem->GetTemplate()->GetMaxStackSize() == 1 && pItem->IsSoulBound()) + if (allowedLooters.size() > 1 && item->GetTemplate()->GetMaxStackSize() == 1 && item->IsSoulBound()) { - pItem->SetSoulboundTradeable(allowedLooters); - pItem->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, GetTotalPlayedTime()); - AddTradeableItem(pItem); + item->SetSoulboundTradeable(allowedLooters); + item->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, GetTotalPlayedTime()); + AddTradeableItem(item); // save data std::ostringstream ss; @@ -12021,20 +12021,20 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update ss << ' ' << *itr; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_BOP_TRADE); - stmt->setUInt32(0, pItem->GetGUIDLow()); + stmt->setUInt32(0, item->GetGUIDLow()); stmt->setString(1, ss.str()); CharacterDatabase.Execute(stmt); } } - return pItem; + return item; } -Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update) +Item* Player::StoreItem(ItemPosCountVec const& dest, Item* item, bool update) { - if (!pItem) + if (!item) return NULL; - Item* lastItem = pItem; + Item* lastItem = item; for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end();) { uint16 pos = itr->pos; @@ -12044,75 +12044,75 @@ Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update) if (itr == dest.end()) { - lastItem = _StoreItem(pos, pItem, count, false, update); + lastItem = _StoreItem(pos, item, count, false, update); break; } - lastItem = _StoreItem(pos, pItem, count, true, update); + lastItem = _StoreItem(pos, item, count, true, update); } return lastItem; } -// Return stored item (if stored to stack, it can diff. from pItem). And pItem ca be deleted in this case. -Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool update) +// Return stored item (if stored to stack, it can diff. from item). And item ca be deleted in this case. +Item* Player::_StoreItem(uint16 pos, Item* item, uint32 count, bool clone, bool update) { - if (!pItem) + if (!item) return NULL; 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, item->GetEntry(), count, item->GetGUIDLow()); Item* pItem2 = GetItemByPos(bag, slot); if (!pItem2) { if (clone) - pItem = pItem->CloneItem(count, this); + item = item->CloneItem(count, this); else - pItem->SetCount(count); + item->SetCount(count); - if (!pItem) + if (!item) return NULL; - if (pItem->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || - pItem->GetTemplate()->Bonding == BIND_QUEST_ITEM || - (pItem->GetTemplate()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos))) - pItem->SetBinding(true); + if (item->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || + item->GetTemplate()->Bonding == BIND_QUEST_ITEM || + (item->GetTemplate()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos))) + item->SetBinding(true); Bag* pBag = (bag == INVENTORY_SLOT_BAG_0) ? NULL : GetBagByPos(bag); if (!pBag) { - m_items[slot] = pItem; - SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), pItem->GetGUID()); - pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); - pItem->SetUInt64Value(ITEM_FIELD_OWNER, GetGUID()); + m_items[slot] = item; + SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), item->GetGUID()); + item->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); + item->SetUInt64Value(ITEM_FIELD_OWNER, GetGUID()); - pItem->SetSlot(slot); - pItem->SetContainer(NULL); + item->SetSlot(slot); + item->SetContainer(NULL); // need update known currency if (slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END) - AddKnownCurrency(pItem->GetEntry()); + AddKnownCurrency(item->GetEntry()); } else - pBag->StoreItem(slot, pItem, update); + pBag->StoreItem(slot, item, update); if (IsInWorld() && update) { - pItem->AddToWorld(); - pItem->SendUpdateToPlayer(this); + item->AddToWorld(); + item->SendUpdateToPlayer(this); } - pItem->SetState(ITEM_CHANGED, this); + item->SetState(ITEM_CHANGED, this); if (pBag) pBag->SetState(ITEM_CHANGED, this); - AddEnchantmentDurations(pItem); - AddItemDurations(pItem); + AddEnchantmentDurations(item); + AddItemDurations(item); - return pItem; + return item; } else { @@ -12130,18 +12130,18 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool // delete item (it not in any slot currently) if (IsInWorld() && update) { - pItem->RemoveFromWorld(); - pItem->DestroyForPlayer(this); + item->RemoveFromWorld(); + item->DestroyForPlayer(this); } - RemoveEnchantmentDurations(pItem); - RemoveItemDurations(pItem); + RemoveEnchantmentDurations(item); + RemoveItemDurations(item); - pItem->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor - pItem->SetNotRefundable(this); - pItem->ClearSoulboundTradeable(this); - RemoveTradeableItem(pItem); - pItem->SetState(ITEM_REMOVED, this); + item->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor + item->SetNotRefundable(this); + item->ClearSoulboundTradeable(this); + RemoveTradeableItem(item); + item->SetState(ITEM_REMOVED, this); } AddEnchantmentDurations(pItem2); @@ -12154,20 +12154,20 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool Item* Player::EquipNewItem(uint16 pos, uint32 item, bool update) { - if (Item* pItem = Item::CreateItem(item, 1, this)) + if (Item* item = Item::CreateItem(item, 1, this)) { ItemAddedQuestCheck(item, 1); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, 1); - return EquipItem(pos, pItem, update); + return EquipItem(pos, item, update); } return NULL; } -Item* Player::EquipItem(uint16 pos, Item* pItem, bool update) +Item* Player::EquipItem(uint16 pos, Item* item, bool update) { - AddEnchantmentDurations(pItem); - AddItemDurations(pItem); + AddEnchantmentDurations(item); + AddItemDurations(item); uint8 bag = pos >> 8; uint8 slot = pos & 255; @@ -12176,17 +12176,17 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update) if (!pItem2) { - VisualizeItem(slot, pItem); + VisualizeItem(slot, item); if (isAlive()) { - ItemTemplate const* pProto = pItem->GetTemplate(); + ItemTemplate const* pProto = item->GetTemplate(); // item set bonuses applied only at equip and removed at unequip, and still active for broken items if (pProto && pProto->ItemSet) - AddItemsSetItem(this, pItem); + AddItemsSetItem(this, item); - _ApplyItemMods(pItem, slot, true); + _ApplyItemMods(item, slot, true); if (pProto && isInCombat() && (pProto->Class == ITEM_CLASS_WEAPON || pProto->InventoryType == INVTYPE_RELIC) && m_weaponChangeTimer == 0) { @@ -12213,11 +12213,11 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update) if (IsInWorld() && update) { - pItem->AddToWorld(); - pItem->SendUpdateToPlayer(this); + item->AddToWorld(); + item->SendUpdateToPlayer(this); } - ApplyEquipCooldown(pItem); + ApplyEquipCooldown(item); // update expertise and armor penetration - passive auras may need it @@ -12239,26 +12239,26 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update) } else { - pItem2->SetCount(pItem2->GetCount() + pItem->GetCount()); + pItem2->SetCount(pItem2->GetCount() + item->GetCount()); if (IsInWorld() && update) pItem2->SendUpdateToPlayer(this); // delete item (it not in any slot currently) - //pItem->DeleteFromDB(); + //item->DeleteFromDB(); if (IsInWorld() && update) { - pItem->RemoveFromWorld(); - pItem->DestroyForPlayer(this); + item->RemoveFromWorld(); + item->DestroyForPlayer(this); } - RemoveEnchantmentDurations(pItem); - RemoveItemDurations(pItem); + RemoveEnchantmentDurations(item); + RemoveItemDurations(item); - pItem->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor - pItem->SetNotRefundable(this); - pItem->ClearSoulboundTradeable(this); - RemoveTradeableItem(pItem); - pItem->SetState(ITEM_REMOVED, this); + item->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor + item->SetNotRefundable(this); + item->ClearSoulboundTradeable(this); + RemoveTradeableItem(item); + item->SetState(ITEM_REMOVED, this); pItem2->SetState(ITEM_CHANGED, this); ApplyEquipCooldown(pItem2); @@ -12267,40 +12267,40 @@ 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); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, item->GetEntry()); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, item->GetEntry(), slot); - return pItem; + return item; } -void Player::QuickEquipItem(uint16 pos, Item* pItem) +void Player::QuickEquipItem(uint16 pos, Item* item) { - if (pItem) + if (item) { - AddEnchantmentDurations(pItem); - AddItemDurations(pItem); + AddEnchantmentDurations(item); + AddItemDurations(item); uint8 slot = pos & 255; - VisualizeItem(slot, pItem); + VisualizeItem(slot, item); if (IsInWorld()) { - pItem->AddToWorld(); - pItem->SendUpdateToPlayer(this); + item->AddToWorld(); + item->SendUpdateToPlayer(this); } - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry()); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, item->GetEntry()); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, item->GetEntry(), slot); } } -void Player::SetVisibleItemSlot(uint8 slot, Item* pItem) +void Player::SetVisibleItemSlot(uint8 slot, Item* item) { - if (pItem) + if (item) { - SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), pItem->GetEntry()); - 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)); + SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), item->GetEntry()); + SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 0, item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT)); + SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 1, item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT)); } else { @@ -12309,28 +12309,28 @@ void Player::SetVisibleItemSlot(uint8 slot, Item* pItem) } } -void Player::VisualizeItem(uint8 slot, Item* pItem) +void Player::VisualizeItem(uint8 slot, Item* item) { - if (!pItem) + if (!item) return; // check also BIND_WHEN_PICKED_UP and BIND_QUEST_ITEM for .additem or .additemset case by GM (not binded at adding to inventory) - if (pItem->GetTemplate()->Bonding == BIND_WHEN_EQUIPED || pItem->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetTemplate()->Bonding == BIND_QUEST_ITEM) - pItem->SetBinding(true); + if (item->GetTemplate()->Bonding == BIND_WHEN_EQUIPED || item->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || item->GetTemplate()->Bonding == BIND_QUEST_ITEM) + item->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, item->GetEntry()); - m_items[slot] = pItem; - SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), pItem->GetGUID()); - pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); - pItem->SetUInt64Value(ITEM_FIELD_OWNER, GetGUID()); - pItem->SetSlot(slot); - pItem->SetContainer(NULL); + m_items[slot] = item; + SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), item->GetGUID()); + item->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); + item->SetUInt64Value(ITEM_FIELD_OWNER, GetGUID()); + item->SetSlot(slot); + item->SetContainer(NULL); if (slot < EQUIPMENT_SLOT_END) - SetVisibleItemSlot(slot, pItem); + SetVisibleItemSlot(slot, item); - pItem->SetState(ITEM_CHANGED, this); + item->SetState(ITEM_CHANGED, this); } void Player::RemoveItem(uint8 bag, uint8 slot, bool update) @@ -12340,44 +12340,44 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) // note2: if removeitem is to be used for delinking // the item must be removed from the player's updatequeue - Item* pItem = GetItemByPos(bag, slot); - if (pItem) + Item* item = GetItemByPos(bag, slot); + if (item) { - 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, item->GetEntry()); - RemoveEnchantmentDurations(pItem); - RemoveItemDurations(pItem); - RemoveTradeableItem(pItem); + RemoveEnchantmentDurations(item); + RemoveItemDurations(item); + RemoveTradeableItem(item); if (bag == INVENTORY_SLOT_BAG_0) { if (slot < INVENTORY_SLOT_BAG_END) { - ItemTemplate const* pProto = pItem->GetTemplate(); + ItemTemplate const* pProto = item->GetTemplate(); // item set bonuses applied only at equip and removed at unequip, and still active for broken items if (pProto && pProto->ItemSet) RemoveItemsSetItem(this, pProto); - _ApplyItemMods(pItem, slot, false); + _ApplyItemMods(item, slot, false); // remove item dependent auras and casts (only weapon and armor slots) if (slot < EQUIPMENT_SLOT_END) { - RemoveItemDependentAurasAndCasts(pItem); + RemoveItemDependentAurasAndCasts(item); // remove held enchantments, update expertise if (slot == EQUIPMENT_SLOT_MAINHAND) { - if (pItem->GetItemSuffixFactor()) + if (item->GetItemSuffixFactor()) { - pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_3); - pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_4); + item->ClearEnchantment(PROP_ENCHANTMENT_SLOT_3); + item->ClearEnchantment(PROP_ENCHANTMENT_SLOT_4); } else { - pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_0); - pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_1); + item->ClearEnchantment(PROP_ENCHANTMENT_SLOT_0); + item->ClearEnchantment(PROP_ENCHANTMENT_SLOT_1); } UpdateExpertise(BASE_ATTACK); @@ -12406,11 +12406,11 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) else if (Bag* pBag = GetBagByPos(bag)) pBag->RemoveItem(slot, update); - pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); - // pItem->SetUInt64Value(ITEM_FIELD_OWNER, 0); not clear owner at remove (it will be set at store). This used in mail and auction code - pItem->SetSlot(NULL_SLOT); + item->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); + // item->SetUInt64Value(ITEM_FIELD_OWNER, 0); not clear owner at remove (it will be set at store). This used in mail and auction code + item->SetSlot(NULL_SLOT); if (IsInWorld() && update) - pItem->SendUpdateToPlayer(this); + item->SendUpdateToPlayer(this); } } @@ -12432,17 +12432,17 @@ void Player::MoveItemFromInventory(uint8 bag, uint8 slot, bool update) } // Common operation need to add item from inventory without delete in trade, guild bank, mail.... -void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool update, bool in_characterInventoryDB) +void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* item, bool update, bool in_characterInventoryDB) { // update quest counters - ItemAddedQuestCheck(pItem->GetEntry(), pItem->GetCount()); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, pItem->GetEntry(), pItem->GetCount()); + ItemAddedQuestCheck(item->GetEntry(), item->GetCount()); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item->GetEntry(), item->GetCount()); // store item - Item* pLastItem = StoreItem(dest, pItem, update); + Item* pLastItem = StoreItem(dest, item, update); - // only set if not merged to existed stack (pItem can be deleted already but we can compare pointers any way) - if (pLastItem == pItem) + // only set if not merged to existed stack (item can be deleted already but we can compare pointers any way) + if (pLastItem == item) { // update owner for last item (this can be original item with wrong owner if (pLastItem->GetOwnerGUID() != GetGUID()) @@ -12459,38 +12459,38 @@ void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool void Player::DestroyItem(uint8 bag, uint8 slot, bool update) { - Item* pItem = GetItemByPos(bag, slot); - if (pItem) + Item* item = GetItemByPos(bag, slot); + if (item) { - 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, item->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()) + if (item->IsNotEmptyBag()) for (uint8 i = 0; i < MAX_BAG_SIZE; ++i) DestroyItem(slot, i, update); - if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) + if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT); - stmt->setUInt32(0, pItem->GetGUIDLow()); + stmt->setUInt32(0, item->GetGUIDLow()); CharacterDatabase.Execute(stmt); } - RemoveEnchantmentDurations(pItem); - RemoveItemDurations(pItem); + RemoveEnchantmentDurations(item); + RemoveItemDurations(item); - pItem->SetNotRefundable(this); - pItem->ClearSoulboundTradeable(this); - RemoveTradeableItem(pItem); + item->SetNotRefundable(this); + item->ClearSoulboundTradeable(this); + RemoveTradeableItem(item); - const ItemTemplate* proto = pItem->GetTemplate(); + const ItemTemplate* proto = item->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 RemoveAurasDueToSpell(proto->Spells[i].SpellId); - ItemRemovedQuestCheck(pItem->GetEntry(), pItem->GetCount()); + ItemRemovedQuestCheck(item->GetEntry(), item->GetCount()); if (bag == INVENTORY_SLOT_BAG_0) { @@ -12499,19 +12499,19 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) // equipment and equipped bags can have applied bonuses if (slot < INVENTORY_SLOT_BAG_END) { - ItemTemplate const* pProto = pItem->GetTemplate(); + ItemTemplate const* pProto = item->GetTemplate(); // item set bonuses applied only at equip and removed at unequip, and still active for broken items if (pProto && pProto->ItemSet) RemoveItemsSetItem(this, pProto); - _ApplyItemMods(pItem, slot, false); + _ApplyItemMods(item, slot, false); } if (slot < EQUIPMENT_SLOT_END) { // remove item dependent auras and casts (only weapon and armor slots) - RemoveItemDependentAurasAndCasts(pItem); + RemoveItemDependentAurasAndCasts(item); // update expertise and armor penetration - passive auras may need it switch (slot) @@ -12540,14 +12540,14 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) if (IsInWorld() && update) { - pItem->RemoveFromWorld(); - pItem->DestroyForPlayer(this); + item->RemoveFromWorld(); + item->DestroyForPlayer(this); } - //pItem->SetOwnerGUID(0); - pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); - pItem->SetSlot(NULL_SLOT); - pItem->SetState(ITEM_REMOVED, this); + //item->SetOwnerGUID(0); + item->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); + item->SetSlot(NULL_SLOT); + item->SetState(ITEM_REMOVED, this); } } @@ -12559,14 +12559,14 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) { - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { - if (pItem->GetEntry() == item && !pItem->IsInTrade()) + if (item->GetEntry() == item && !item->IsInTrade()) { - if (pItem->GetCount() + remcount <= count) + if (item->GetCount() + remcount <= count) { // all items in inventory can unequipped - remcount += pItem->GetCount(); + remcount += item->GetCount(); DestroyItem(INVENTORY_SLOT_BAG_0, i, update); if (remcount >= count) @@ -12574,11 +12574,11 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ } else { - ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); - pItem->SetCount(pItem->GetCount() - count + remcount); + ItemRemovedQuestCheck(item->GetEntry(), count - remcount); + item->SetCount(item->GetCount() - count + remcount); if (IsInWorld() & update) - pItem->SendUpdateToPlayer(this); - pItem->SetState(ITEM_CHANGED, this); + item->SendUpdateToPlayer(this); + item->SetState(ITEM_CHANGED, this); return; } } @@ -12587,14 +12587,14 @@ 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 (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { - if (pItem->GetEntry() == item && !pItem->IsInTrade()) + if (item->GetEntry() == item && !item->IsInTrade()) { - if (pItem->GetCount() + remcount <= count) + if (item->GetCount() + remcount <= count) { // all keys can be unequipped - remcount += pItem->GetCount(); + remcount += item->GetCount(); DestroyItem(INVENTORY_SLOT_BAG_0, i, update); if (remcount >= count) @@ -12602,11 +12602,11 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ } else { - ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); - pItem->SetCount(pItem->GetCount() - count + remcount); + ItemRemovedQuestCheck(item->GetEntry(), count - remcount); + item->SetCount(item->GetCount() - count + remcount); if (IsInWorld() & update) - pItem->SendUpdateToPlayer(this); - pItem->SetState(ITEM_CHANGED, this); + item->SendUpdateToPlayer(this); + item->SetState(ITEM_CHANGED, this); return; } } @@ -12620,14 +12620,14 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ { for (uint32 j = 0; j < pBag->GetBagSize(); j++) { - if (Item* pItem = pBag->GetItemByPos(j)) + if (Item* item = pBag->GetItemByPos(j)) { - if (pItem->GetEntry() == item && !pItem->IsInTrade()) + if (item->GetEntry() == item && !item->IsInTrade()) { // all items in bags can be unequipped - if (pItem->GetCount() + remcount <= count) + if (item->GetCount() + remcount <= count) { - remcount += pItem->GetCount(); + remcount += item->GetCount(); DestroyItem(i, j, update); if (remcount >= count) @@ -12635,11 +12635,11 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ } else { - ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); - pItem->SetCount(pItem->GetCount() - count + remcount); + ItemRemovedQuestCheck(item->GetEntry(), count - remcount); + item->SetCount(item->GetCount() - count + remcount); if (IsInWorld() && update) - pItem->SendUpdateToPlayer(this); - pItem->SetState(ITEM_CHANGED, this); + item->SendUpdateToPlayer(this); + item->SetState(ITEM_CHANGED, this); return; } } @@ -12651,15 +12651,15 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ // in equipment and bag list for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++) { - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { - if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) + if (item && item->GetEntry() == item && !item->IsInTrade()) { - if (pItem->GetCount() + remcount <= count) + if (item->GetCount() + remcount <= count) { if (!unequip_check || CanUnequipItem(INVENTORY_SLOT_BAG_0 << 8 | i, false) == EQUIP_ERR_OK) { - remcount += pItem->GetCount(); + remcount += item->GetCount(); DestroyItem(INVENTORY_SLOT_BAG_0, i, update); if (remcount >= count) @@ -12668,11 +12668,11 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ } else { - ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); - pItem->SetCount(pItem->GetCount() - count + remcount); + ItemRemovedQuestCheck(item->GetEntry(), count - remcount); + item->SetCount(item->GetCount() - count + remcount); if (IsInWorld() & update) - pItem->SendUpdateToPlayer(this); - pItem->SetState(ITEM_CHANGED, this); + item->SendUpdateToPlayer(this); + item->SetState(ITEM_CHANGED, this); return; } } @@ -12686,27 +12686,27 @@ void Player::DestroyZoneLimitedItem(bool update, uint32 new_zone) // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->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)) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->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)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) - if (Item* pItem = pBag->GetItemByPos(j)) - if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) + if (Item* item = pBag->GetItemByPos(j)) + if (item->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) DestroyItem(i, j, update); // in equipment and bag list for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) DestroyItem(INVENTORY_SLOT_BAG_0, i, update); } @@ -12718,22 +12718,22 @@ void Player::DestroyConjuredItems(bool update) // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->IsConjuredConsumable()) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->IsConjuredConsumable()) 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)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) - if (Item* pItem = pBag->GetItemByPos(j)) - if (pItem->IsConjuredConsumable()) + if (Item* item = pBag->GetItemByPos(j)) + if (item->IsConjuredConsumable()) DestroyItem(i, j, update); // in equipment and bag list for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->IsConjuredConsumable()) + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->IsConjuredConsumable()) DestroyItem(INVENTORY_SLOT_BAG_0, i, update); } @@ -12741,46 +12741,46 @@ Item* Player::GetItemByEntry(uint32 entry) const { // in inventory for (int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetEntry() == entry) - return pItem; + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetEntry() == entry) + return item; 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) - if (Item* pItem = pBag->GetItemByPos(j)) - if (pItem->GetEntry() == entry) - return pItem; + if (Item* item = pBag->GetItemByPos(j)) + if (item->GetEntry() == entry) + return item; for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetEntry() == entry) - return pItem; + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetEntry() == entry) + return item; return NULL; } -void Player::DestroyItemCount(Item* pItem, uint32 &count, bool update) +void Player::DestroyItemCount(Item* item, uint32 &count, bool update) { - if (!pItem) + if (!item) 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", item->GetGUIDLow(), item->GetEntry(), count); - if (pItem->GetCount() <= count) + if (item->GetCount() <= count) { - count -= pItem->GetCount(); + count -= item->GetCount(); - DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), update); + DestroyItem(item->GetBagSlot(), item->GetSlot(), update); } else { - ItemRemovedQuestCheck(pItem->GetEntry(), count); - pItem->SetCount(pItem->GetCount() - count); + ItemRemovedQuestCheck(item->GetEntry(), count); + item->SetCount(item->GetCount() - count); count = 0; if (IsInWorld() & update) - pItem->SendUpdateToPlayer(this); - pItem->SetState(ITEM_CHANGED, this); + item->SendUpdateToPlayer(this); + item->SetState(ITEM_CHANGED, this); } } @@ -13255,9 +13255,9 @@ void Player::SwapItem(uint16 src, uint16 dst) AutoUnequipOffhandIfNeed(); } -void Player::AddItemToBuyBackSlot(Item* pItem) +void Player::AddItemToBuyBackSlot(Item* item) { - if (pItem) + if (item) { uint32 slot = m_currentBuybackSlot; // if current back slot non-empty search oldest or free @@ -13289,16 +13289,16 @@ 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", item->GetEntry(), slot); - m_items[slot] = pItem; + m_items[slot] = item; time_t base = time(NULL); uint32 etime = uint32(base - m_logintime + (30 * 3600)); uint32 eslot = slot - BUYBACK_SLOT_START; - SetUInt64Value(PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), pItem->GetGUID()); - if (ItemTemplate const* proto = pItem->GetTemplate()) - SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, proto->SellPrice * pItem->GetCount()); + SetUInt64Value(PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), item->GetGUID()); + if (ItemTemplate const* proto = item->GetTemplate()) + SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, proto->SellPrice * item->GetCount()); else SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, 0); SetUInt32Value(PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + eslot, (uint32)etime); @@ -13322,12 +13322,12 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) 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]; - if (pItem) + Item* item = m_items[slot]; + if (item) { - pItem->RemoveFromWorld(); + item->RemoveFromWorld(); if (del) - pItem->SetState(ITEM_REMOVED, this); + item->SetState(ITEM_REMOVED, this); } m_items[slot] = NULL; @@ -13343,7 +13343,7 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) } } -void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint32 itemid) +void Player::SendEquipError(InventoryResult msg, Item* item, Item* pItem2, uint32 itemid) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg); WorldPacket data(SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : 18)); @@ -13351,7 +13351,7 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint if (msg != EQUIP_ERR_OK) { - data << uint64(pItem ? pItem->GetGUID() : 0); + data << uint64(item ? item->GetGUID() : 0); data << uint64(pItem2 ? pItem2->GetGUID() : 0); data << uint8(0); // bag type subclass, used with EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM and EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2 @@ -13360,7 +13360,7 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint case EQUIP_ERR_CANT_EQUIP_LEVEL_I: case EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW: { - ItemTemplate const* proto = pItem ? pItem->GetTemplate() : sObjectMgr->GetItemTemplate(itemid); + ItemTemplate const* proto = item ? item->GetTemplate() : sObjectMgr->GetItemTemplate(itemid); data << uint32(proto ? proto->RequiredLevel : 0); break; } @@ -13375,7 +13375,7 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED: case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED: { - ItemTemplate const* proto = pItem ? pItem->GetTemplate() : sObjectMgr->GetItemTemplate(itemid); + ItemTemplate const* proto = item ? item->GetTemplate() : sObjectMgr->GetItemTemplate(itemid); data << uint32(proto ? proto->ItemLimitCategory : 0); break; } @@ -13565,17 +13565,17 @@ void Player::RemoveArenaEnchantments(EnchantmentSlot slot) // NOTE: no need to remove these from stats, since these aren't equipped // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetEnchantmentId(slot)) - pItem->ClearEnchantment(slot); + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (item->GetEnchantmentId(slot)) + item->ClearEnchantment(slot); // in inventory bags 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++) - if (Item* pItem = pBag->GetItemByPos(j)) - if (pItem->GetEnchantmentId(slot)) - pItem->ClearEnchantment(slot); + if (Item* item = pBag->GetItemByPos(j)) + if (item->GetEnchantmentId(slot)) + item->ClearEnchantment(slot); } // duration == 0 will remove item enchant @@ -21217,14 +21217,14 @@ void Player::CorrectMetaGemEnchants(uint8 exceptslot, bool apply) if (slot == exceptslot) continue; - Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); + Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); - if (!pItem || !pItem->GetTemplate()->Socket[0].Color) + if (!item || !item->GetTemplate()->Socket[0].Color) continue; for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot) { - uint32 enchant_id = pItem->GetEnchantmentId(EnchantmentSlot(enchant_slot)); + uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(enchant_slot)); if (!enchant_id) continue; @@ -21242,7 +21242,7 @@ void Player::CorrectMetaGemEnchants(uint8 exceptslot, bool apply) { // ignore item gem conditions //if state changed, (dis)apply enchant - ApplyEnchantment(pItem, EnchantmentSlot(enchant_slot), !wasactive, true, true); + ApplyEnchantment(item, EnchantmentSlot(enchant_slot), !wasactive, true, true); } } } @@ -21259,15 +21259,15 @@ void Player::ToggleMetaGemsActive(uint8 exceptslot, bool apply) if (slot == exceptslot) continue; - Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); + Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); - if (!pItem || !pItem->GetTemplate()->Socket[0].Color) //if item has no sockets or no item is equipped go to next item + if (!item || !item->GetTemplate()->Socket[0].Color) //if item has no sockets or no item is equipped go to next item continue; //cycle all (gem)enchants for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot) { - uint32 enchant_id = pItem->GetEnchantmentId(EnchantmentSlot(enchant_slot)); + uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(enchant_slot)); if (!enchant_id) //if no enchant go to next enchant(slot) continue; @@ -21278,7 +21278,7 @@ void Player::ToggleMetaGemsActive(uint8 exceptslot, bool apply) //only metagems to be (de)activated, so only enchants with condition uint32 condition = enchantEntry->EnchantmentCondition; if (condition) - ApplyEnchantment(pItem, EnchantmentSlot(enchant_slot), apply); + ApplyEnchantment(item, EnchantmentSlot(enchant_slot), apply); } } } @@ -21940,14 +21940,14 @@ void Player::SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint3 GetSession()->SendPacket(&data); } -void Player::ApplyEquipCooldown(Item* pItem) +void Player::ApplyEquipCooldown(Item* item) { - if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_PROTO_FLAG_NO_EQUIP_COOLDOWN)) + if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_PROTO_FLAG_NO_EQUIP_COOLDOWN)) return; for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) { - _Spell const& spellData = pItem->GetTemplate()->Spells[i]; + _Spell const& spellData = item->GetTemplate()->Spells[i]; // no spell if (!spellData.SpellId) @@ -21957,10 +21957,10 @@ void Player::ApplyEquipCooldown(Item* pItem) if (spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_USE) continue; - AddSpellCooldown(spellData.SpellId, pItem->GetEntry(), time(NULL) + 30); + AddSpellCooldown(spellData.SpellId, item->GetEntry(), time(NULL) + 30); WorldPacket data(SMSG_ITEM_COOLDOWN, 12); - data << pItem->GetGUID(); + data << item->GetGUID(); data << uint32(spellData.SpellId); GetSession()->SendPacket(&data); } @@ -22574,7 +22574,7 @@ bool Player::CanNoReagentCast(SpellInfo const* spellInfo) const return false; } -void Player::RemoveItemDependentAurasAndCasts(Item* pItem) +void Player::RemoveItemDependentAurasAndCasts(Item* item) { for (AuraMap::iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end();) { @@ -22589,7 +22589,7 @@ void Player::RemoveItemDependentAurasAndCasts(Item* pItem) } // skip if not item dependent or have alternative item - if (HasItemFitToSpellRequirements(spellInfo, pItem)) + if (HasItemFitToSpellRequirements(spellInfo, item)) { ++itr; continue; @@ -22602,7 +22602,7 @@ void Player::RemoveItemDependentAurasAndCasts(Item* pItem) // currently casted spells can be dependent from item for (uint32 i = 0; i < CURRENT_MAX_SPELL; ++i) if (Spell* spell = GetCurrentSpell(CurrentSpellTypes(i))) - if (spell->getState() != SPELL_STATE_DELAYED && !HasItemFitToSpellRequirements(spell->m_spellInfo, pItem)) + if (spell->getState() != SPELL_STATE_DELAYED && !HasItemFitToSpellRequirements(spell->m_spellInfo, item)) InterruptSpell(CurrentSpellTypes(i)); } @@ -23548,8 +23548,8 @@ void Player::AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore cons continue; } - Item* pItem = StoreNewItem(dest, lootItem->itemid, true, lootItem->randomPropertyId); - SendNewItem(pItem, lootItem->count, false, false, broadcast); + Item* item = StoreNewItem(dest, lootItem->itemid, true, lootItem->randomPropertyId); + SendNewItem(item, lootItem->count, false, false, broadcast); } } @@ -23780,9 +23780,9 @@ uint32 Player::GetPhaseMaskForSpawn() const return PHASEMASK_NORMAL; } -InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limit_count) const +InventoryResult Player::CanEquipUniqueItem(Item* item, uint8 eslot, uint32 limit_count) const { - ItemTemplate const* pProto = pItem->GetTemplate(); + ItemTemplate const* pProto = item->GetTemplate(); // proto based limitations if (InventoryResult res = CanEquipUniqueItem(pProto, eslot, limit_count)) @@ -23791,7 +23791,7 @@ InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limi // check unique-equipped on gems for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot) { - uint32 enchant_id = pItem->GetEnchantmentId(EnchantmentSlot(enchant_slot)); + uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(enchant_slot)); if (!enchant_id) continue; SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id); @@ -23803,8 +23803,8 @@ InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limi continue; // include for check equip another gems with same limit category for not equipped item (and then not counted) - uint32 gem_limit_count = !pItem->IsEquipped() && pGem->ItemLimitCategory - ? pItem->GetGemCountWithLimitCategory(pGem->ItemLimitCategory) : 1; + uint32 gem_limit_count = !item->IsEquipped() && pGem->ItemLimitCategory + ? item->GetGemCountWithLimitCategory(pGem->ItemLimitCategory) : 1; if (InventoryResult res = CanEquipUniqueItem(pGem, eslot, gem_limit_count)) return res; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 7f6b2322e93..0ee2743e319 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1233,70 +1233,70 @@ class Player : public Unit, public GridObject bool CanNoReagentCast(SpellInfo const* spellInfo) const; bool HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_slot = NULL_SLOT) const; bool HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot = NULL_SLOT) const; - InventoryResult CanTakeMoreSimilarItems(Item* pItem) const { return CanTakeMoreSimilarItems(pItem->GetEntry(), pItem->GetCount(), pItem); } + InventoryResult CanTakeMoreSimilarItems(Item* item) const { return CanTakeMoreSimilarItems(item->GetEntry(), item->GetCount(), item); } InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count) const { return CanTakeMoreSimilarItems(entry, count, NULL); } InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = NULL) const { return CanStoreItem(bag, slot, dest, item, count, NULL, false, no_space_count); } - InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* pItem, bool swap = false) const + InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* item, bool swap = false) const { - if (!pItem) + if (!item) return EQUIP_ERR_ITEM_NOT_FOUND; - uint32 count = pItem->GetCount(); - return CanStoreItem(bag, slot, dest, pItem->GetEntry(), count, pItem, swap, NULL); + uint32 count = item->GetCount(); + return CanStoreItem(bag, slot, dest, item->GetEntry(), count, item, swap, NULL); } - InventoryResult CanStoreItems(Item** pItem, int count) const; + InventoryResult CanStoreItems(Item** item, int count) const; InventoryResult CanEquipNewItem(uint8 slot, uint16& dest, uint32 item, bool swap) const; - InventoryResult CanEquipItem(uint8 slot, uint16& dest, Item* pItem, bool swap, bool not_loading = true) const; + InventoryResult CanEquipItem(uint8 slot, uint16& dest, Item* item, bool swap, bool not_loading = true) const; - InventoryResult CanEquipUniqueItem(Item* pItem, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1) const; + InventoryResult CanEquipUniqueItem(Item* item, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1) const; InventoryResult CanEquipUniqueItem(ItemTemplate const* itemProto, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1) const; InventoryResult CanUnequipItems(uint32 item, uint32 count) const; InventoryResult CanUnequipItem(uint16 src, bool swap) const; - InventoryResult CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* pItem, bool swap, bool not_loading = true) const; - InventoryResult CanUseItem(Item* pItem, bool not_loading = true) const; + InventoryResult CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* item, bool swap, bool not_loading = true) const; + InventoryResult CanUseItem(Item* item, bool not_loading = true) const; bool HasItemTotemCategory(uint32 TotemCategory) const; - InventoryResult CanUseItem(ItemTemplate const* pItem) const; + InventoryResult CanUseItem(ItemTemplate const* item) const; InventoryResult CanUseAmmo(uint32 item) const; InventoryResult CanRollForItemInLFG(ItemTemplate const* item, WorldObject const* lootedObject) const; Item* StoreNewItem(ItemPosCountVec const& pos, uint32 item, bool update, int32 randomPropertyId = 0); Item* StoreNewItem(ItemPosCountVec const& pos, uint32 item, bool update, int32 randomPropertyId, AllowedLooterSet &allowedLooters); - Item* StoreItem(ItemPosCountVec const& pos, Item* pItem, bool update); + Item* StoreItem(ItemPosCountVec const& pos, Item* item, bool update); Item* EquipNewItem(uint16 pos, uint32 item, bool update); - Item* EquipItem(uint16 pos, Item* pItem, bool update); + Item* EquipItem(uint16 pos, Item* item, bool update); void AutoUnequipOffhandIfNeed(bool force = false); bool StoreNewItemInBestSlots(uint32 item_id, uint32 item_count); void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store, bool broadcast = false); void AutoStoreLoot(uint32 loot_id, LootStore const& store, bool broadcast = false) { AutoStoreLoot(NULL_BAG, NULL_SLOT, loot_id, store, broadcast); } void StoreLootItem(uint8 lootSlot, Loot* loot); - InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = NULL) const; - InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* pItem = NULL, bool swap = false, uint32* no_space_count = NULL) const; + InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* item, uint32* no_space_count = NULL) const; + InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* item = NULL, bool swap = false, uint32* no_space_count = NULL) const; void AddRefundReference(uint32 it); void DeleteRefundReference(uint32 it); - void ApplyEquipCooldown(Item* pItem); + void ApplyEquipCooldown(Item* item); 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); - Item* BankItem(ItemPosCountVec const& dest, Item* pItem, bool update) + void QuickEquipItem(uint16 pos, Item* item); + void VisualizeItem(uint8 slot, Item* item); + void SetVisibleItemSlot(uint8 slot, Item* item); + Item* BankItem(ItemPosCountVec const& dest, Item* item, bool update) { - return StoreItem(dest, pItem, update); + return StoreItem(dest, item, update); } - Item* BankItem(uint16 pos, Item* pItem, bool update); + Item* BankItem(uint16 pos, Item* item, bool update); void RemoveItem(uint8 bag, uint8 slot, bool update); void MoveItemFromInventory(uint8 bag, uint8 slot, bool update); // in trade, auction, guild bank, mail.... - void MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool update, bool in_characterInventoryDB = false); + void MoveItemToInventory(ItemPosCountVec const& dest, Item* item, bool update, bool in_characterInventoryDB = false); // in trade, guild bank, mail.... - void RemoveItemDependentAurasAndCasts(Item* pItem); + void RemoveItemDependentAurasAndCasts(Item* item); void DestroyItem(uint8 bag, uint8 slot, bool update); void DestroyItemCount(uint32 item, uint32 count, bool update, bool unequip_check = false); void DestroyItemCount(Item* item, uint32& count, bool update); @@ -1304,11 +1304,11 @@ class Player : public Unit, public GridObject void DestroyZoneLimitedItem(bool update, uint32 new_zone); void SplitItem(uint16 src, uint16 dst, uint32 count); void SwapItem(uint16 src, uint16 dst); - void AddItemToBuyBackSlot(Item* pItem); + void AddItemToBuyBackSlot(Item* item); 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 SendEquipError(InventoryResult msg, Item* item, 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 AddWeaponProficiency(uint32 newflag) { m_WeaponProficiency |= newflag; } @@ -2789,7 +2789,7 @@ class Player : public Unit, public GridObject InventoryResult CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool swap, Item* pSrcItem) const; InventoryResult CanStoreItem_InBag(uint8 bag, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool merge, bool non_specialized, Item* pSrcItem, uint8 skip_bag, uint8 skip_slot) const; InventoryResult CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool merge, Item* pSrcItem, uint8 skip_bag, uint8 skip_slot) const; - Item* _StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool update); + Item* _StoreItem(uint16 pos, Item* item, uint32 count, bool clone, bool update); Item* _LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, Field* fields); std::set m_refundableItems; diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 9879ef7ff3b..396e01cb269 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1927,12 +1927,12 @@ void Group::BroadcastGroupUpdate(void) void Group::ResetMaxEnchantingLevel() { m_maxEnchantingLevel = 0; - Player* pMember = NULL; + Player* member = NULL; for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr) { - pMember = ObjectAccessor::FindPlayer(citr->guid); - if (pMember && m_maxEnchantingLevel < pMember->GetSkillValue(SKILL_ENCHANTING)) - m_maxEnchantingLevel = pMember->GetSkillValue(SKILL_ENCHANTING); + member = ObjectAccessor::FindPlayer(citr->guid); + if (member && m_maxEnchantingLevel < member->GetSkillValue(SKILL_ENCHANTING)) + m_maxEnchantingLevel = member->GetSkillValue(SKILL_ENCHANTING); } } diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index f97b907828a..9a453ed8033 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -348,8 +348,8 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields) return false; } - Item* pItem = NewItemOrBag(proto); - if (!pItem->LoadFromDB(itemGuid, 0, fields, itemEntry)) + Item* item = NewItemOrBag(proto); + if (!item->LoadFromDB(itemGuid, 0, fields, itemEntry)) { sLog->outError("Item (GUID %u, id: %u) not found in item_instance, deleting from guild bank!", itemGuid, itemEntry); @@ -359,12 +359,12 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields) stmt->setUInt8 (2, slotId); CharacterDatabase.Execute(stmt); - delete pItem; + delete item; return false; } - pItem->AddToWorld(); - m_items[slotId] = pItem; + item->AddToWorld(); + m_items[slotId] = item; return true; } @@ -372,13 +372,13 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields) void Guild::BankTab::Delete(SQLTransaction& trans, bool removeItemsFromDB) { for (uint8 slotId = 0; slotId < GUILD_BANK_MAX_SLOTS; ++slotId) - if (Item* pItem = m_items[slotId]) + if (Item* item = m_items[slotId]) { - pItem->RemoveFromWorld(); + item->RemoveFromWorld(); if (removeItemsFromDB) - pItem->DeleteFromDB(trans); - delete pItem; - pItem = NULL; + item->DeleteFromDB(trans); + delete item; + item = NULL; } } @@ -392,29 +392,29 @@ inline void Guild::BankTab::WritePacket(WorldPacket& data) const // 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; + Item* item = GetItem(slotId); + uint32 itemEntry = item ? item->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 + data << uint32(item->GetItemRandomPropertyId()); // Random item property id - if (pItem->GetItemRandomPropertyId()) - data << uint32(pItem->GetItemSuffixFactor()); // SuffixFactor + if (item->GetItemRandomPropertyId()) + data << uint32(item->GetItemSuffixFactor()); // SuffixFactor - data << uint32(pItem->GetCount()); // ITEM_FIELD_STACK_COUNT + data << uint32(item->GetCount()); // ITEM_FIELD_STACK_COUNT data << uint32(0); - data << uint8(abs(pItem->GetSpellCharges())); // Spell charges + data << uint8(abs(item->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))) + if (uint32 enchId = item->GetEnchantmentId(EnchantmentSlot(i))) { data << uint8(i); data << uint32(enchId); @@ -456,13 +456,13 @@ 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) +// If item == NULL contents are removed. +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; @@ -472,19 +472,19 @@ 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; } @@ -759,12 +759,12 @@ bool Guild::MoveItemData::CheckItem(uint32& splitedAmount) return true; } -bool Guild::MoveItemData::CanStore(Item* pItem, bool swap, bool sendError) +bool Guild::MoveItemData::CanStore(Item* item, bool swap, bool sendError) { m_vec.clear(); - InventoryResult msg = CanStore(pItem, swap); + InventoryResult msg = CanStore(item, swap); if (sendError && msg != EQUIP_ERR_OK) - m_pPlayer->SendEquipError(msg, pItem); + m_pPlayer->SendEquipError(msg, item); return (msg == EQUIP_ERR_OK); } @@ -834,12 +834,12 @@ void Guild::PlayerMoveItemData::RemoveItem(SQLTransaction& trans, MoveItemData* } } -Item* Guild::PlayerMoveItemData::StoreItem(SQLTransaction& trans, Item* pItem) +Item* Guild::PlayerMoveItemData::StoreItem(SQLTransaction& trans, Item* item) { - ASSERT(pItem); - m_pPlayer->MoveItemToInventory(m_vec, pItem, true); + ASSERT(item); + m_pPlayer->MoveItemToInventory(m_vec, item, true); m_pPlayer->SaveInventoryAndGoldToDB(trans); - return pItem; + return item; } void Guild::PlayerMoveItemData::LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const @@ -850,9 +850,9 @@ void Guild::PlayerMoveItemData::LogBankEvent(SQLTransaction& trans, MoveItemData pFrom->GetItem()->GetEntry(), count); } -inline InventoryResult Guild::PlayerMoveItemData::CanStore(Item* pItem, bool swap) +inline InventoryResult Guild::PlayerMoveItemData::CanStore(Item* item, bool swap) { - return m_pPlayer->CanStoreItem(m_container, m_slotId, m_vec, pItem, swap); + return m_pPlayer->CanStoreItem(m_container, m_slotId, m_vec, item, swap); } /////////////////////////////////////////////////////////////////////////////// @@ -900,24 +900,24 @@ void Guild::BankMoveItemData::RemoveItem(SQLTransaction& trans, MoveItemData* pO m_pGuild->_DecreaseMemberRemainingSlots(trans, m_pPlayer->GetGUID(), m_container); } -Item* Guild::BankMoveItemData::StoreItem(SQLTransaction& trans, Item* pItem) +Item* Guild::BankMoveItemData::StoreItem(SQLTransaction& trans, Item* item) { - if (!pItem) + if (!item) return NULL; BankTab* pTab = m_pGuild->GetBankTab(m_container); if (!pTab) return NULL; - Item* pLastItem = pItem; + Item* pLastItem = item; for (ItemPosCountVec::const_iterator itr = m_vec.begin(); itr != m_vec.end(); ) { ItemPosCount pos(*itr); ++itr; sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: StoreItem tab = %u, slot = %u, item = %u, count = %u", - m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); - pLastItem = _StoreItem(trans, pTab, pItem, pos, itr != m_vec.end()); + m_container, m_slotId, item->GetEntry(), item->GetCount()); + pLastItem = _StoreItem(trans, pTab, item, pos, itr != m_vec.end()); } return pLastItem; } @@ -946,7 +946,7 @@ void Guild::BankMoveItemData::LogAction(MoveItemData* pFrom) const m_pGuild->GetId()); } -Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab, Item* pItem, ItemPosCount& pos, bool clone) const +Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab, Item* item, ItemPosCount& pos, bool clone) const { uint8 slotId = uint8(pos.pos); uint32 count = pos.count; @@ -957,20 +957,20 @@ Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab, pItemDest->SaveToDB(trans); if (!clone) { - pItem->RemoveFromWorld(); - pItem->DeleteFromDB(trans); - delete pItem; + item->RemoveFromWorld(); + item->DeleteFromDB(trans); + delete item; } return pItemDest; } if (clone) - pItem = pItem->CloneItem(count); + item = item->CloneItem(count); else - pItem->SetCount(count); + item->SetCount(count); - if (pItem && pTab->SetItem(trans, slotId, pItem)) - return pItem; + if (item && pTab->SetItem(trans, slotId, item)) + return item; return NULL; } @@ -979,13 +979,13 @@ Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab, // If item in destination slot exists it must be the item of the same entry // and stack must have enough space to take at least one item. // Returns false if destination item specified and it cannot be used to reserve space. -bool Guild::BankMoveItemData::_ReserveSpace(uint8 slotId, Item* pItem, Item* pItemDest, uint32& count) +bool Guild::BankMoveItemData::_ReserveSpace(uint8 slotId, Item* item, Item* pItemDest, uint32& count) { - uint32 requiredSpace = pItem->GetMaxStackCount(); + uint32 requiredSpace = item->GetMaxStackCount(); if (pItemDest) { // Make sure source and destination items match and destination item has space for more stacks. - if (pItemDest->GetEntry() != pItem->GetEntry() || pItemDest->GetCount() >= pItem->GetMaxStackCount()) + if (pItemDest->GetEntry() != item->GetEntry() || pItemDest->GetCount() >= item->GetMaxStackCount()) return false; requiredSpace -= pItemDest->GetCount(); } @@ -1002,7 +1002,7 @@ bool Guild::BankMoveItemData::_ReserveSpace(uint8 slotId, Item* pItem, Item* pIt return true; } -void Guild::BankMoveItemData::CanStoreItemInTab(Item* pItem, uint8 skipSlotId, bool merge, uint32& count) +void Guild::BankMoveItemData::CanStoreItemInTab(Item* item, uint8 skipSlotId, bool merge, uint32& count) { for (uint8 slotId = 0; (slotId < GUILD_BANK_MAX_SLOTS) && (count > 0); ++slotId) { @@ -1011,25 +1011,25 @@ void Guild::BankMoveItemData::CanStoreItemInTab(Item* pItem, uint8 skipSlotId, b continue; Item* pItemDest = m_pGuild->_GetItem(m_container, slotId); - if (pItemDest == pItem) + if (pItemDest == item) pItemDest = NULL; // If merge skip empty, if not merge skip non-empty if ((pItemDest != NULL) != merge) continue; - _ReserveSpace(slotId, pItem, pItemDest, count); + _ReserveSpace(slotId, item, pItemDest, count); } } -InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) +InventoryResult Guild::BankMoveItemData::CanStore(Item* item, bool swap) { sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: CanStore() tab = %u, slot = %u, item = %u, count = %u", - m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); + m_container, m_slotId, item->GetEntry(), item->GetCount()); - uint32 count = pItem->GetCount(); + uint32 count = item->GetCount(); // Soulbound items cannot be moved - if (pItem->IsSoulBound()) + if (item->IsSoulBound()) return EQUIP_ERR_CANT_DROP_SOULBOUND; // Make sure destination bank tab exists @@ -1041,10 +1041,10 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) { Item* pItemDest = m_pGuild->_GetItem(m_container, m_slotId); // Ignore swapped item (this slot will be empty after move) - if ((pItemDest == pItem) || swap) + if ((pItemDest == item) || swap) pItemDest = NULL; - if (!_ReserveSpace(m_slotId, pItem, pItemDest, count)) + if (!_ReserveSpace(m_slotId, item, pItemDest, count)) return EQUIP_ERR_ITEM_CANT_STACK; if (count == 0) @@ -1053,15 +1053,15 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) // Slot was not specified or it has not enough space for all the items in stack // Search for stacks to merge with - if (pItem->GetMaxStackCount() > 1) + if (item->GetMaxStackCount() > 1) { - CanStoreItemInTab(pItem, m_slotId, true, count); + CanStoreItemInTab(item, m_slotId, true, count); if (count == 0) return EQUIP_ERR_OK; } // Search free slot for item - CanStoreItemInTab(pItem, m_slotId, false, count); + CanStoreItemInTab(item, m_slotId, false, count); if (count == 0) return EQUIP_ERR_OK; diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index e18e62e51b7..6454a979a79 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -476,7 +476,7 @@ private: void SendText(const Guild* guild, WorldSession* session) const; 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; @@ -506,13 +506,13 @@ private: // Defines if player has rights to withdraw item from container virtual bool HasWithdrawRights(MoveItemData* /*pOther*/) const { return true; } // Checks if container can store specified item - bool CanStore(Item* pItem, bool swap, bool sendError); + bool CanStore(Item* item, bool swap, bool sendError); // Clones stored item bool CloneItem(uint32 count); // Remove item from container (if splited update items fields) virtual void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount = 0) = 0; // Saves item to container - virtual Item* StoreItem(SQLTransaction& trans, Item* pItem) = 0; + virtual Item* StoreItem(SQLTransaction& trans, Item* item) = 0; // Log bank event virtual void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const = 0; // Log GM action @@ -524,7 +524,7 @@ private: uint8 GetContainer() const { return m_container; } uint8 GetSlotId() const { return m_slotId; } protected: - virtual InventoryResult CanStore(Item* pItem, bool swap) = 0; + virtual InventoryResult CanStore(Item* item, bool swap) = 0; Guild* m_pGuild; Player* m_pPlayer; @@ -544,10 +544,10 @@ private: bool IsBank() const { return false; } bool InitItem(); void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount = 0); - Item* StoreItem(SQLTransaction& trans, Item* pItem); + Item* StoreItem(SQLTransaction& trans, Item* item); void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const; protected: - InventoryResult CanStore(Item* pItem, bool swap); + InventoryResult CanStore(Item* item, bool swap); }; class BankMoveItemData : public MoveItemData @@ -561,17 +561,17 @@ private: bool HasStoreRights(MoveItemData* pOther) const; bool HasWithdrawRights(MoveItemData* pOther) const; void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount); - Item* StoreItem(SQLTransaction& trans, Item* pItem); + Item* StoreItem(SQLTransaction& trans, Item* item); void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const; void LogAction(MoveItemData* pFrom) const; protected: - InventoryResult CanStore(Item* pItem, bool swap); + InventoryResult CanStore(Item* item, bool swap); private: - Item* _StoreItem(SQLTransaction& trans, BankTab* pTab, Item* pItem, ItemPosCount& pos, bool clone) const; - bool _ReserveSpace(uint8 slotId, Item* pItem, Item* pItemDest, uint32& count); - void CanStoreItemInTab(Item* pItem, uint8 skipSlotId, bool merge, uint32& count); + Item* _StoreItem(SQLTransaction& trans, BankTab* pTab, Item* item, ItemPosCount& pos, bool clone) const; + bool _ReserveSpace(uint8 slotId, Item* item, Item* pItemDest, uint32& count); + void CanStoreItemInTab(Item* item, uint8 skipSlotId, bool merge, uint32& count); }; typedef UNORDERED_MAP Members; diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index f82c52204fb..2188667d042 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -504,8 +504,8 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) SQLTransaction trans = CharacterDatabase.BeginTransaction(); if (auction && auction->owner == player->GetGUIDLow()) { - Item* pItem = sAuctionMgr->GetAItem(auction->item_guidlow); - if (pItem) + Item* item = sAuctionMgr->GetAItem(auction->item_guidlow); + if (item) { if (auction->bidder > 0) // If we have a bidder, we have to send him the money he paid { @@ -522,7 +522,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) // item will deleted or added to received mail list MailDraft(msgAuctionCanceledOwner.str(), "") // TODO: fix body - .AddItem(pItem) + .AddItem(item) .SendMailTo(trans, player, auction, MAIL_CHECK_MASK_COPIED); } else diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 2434ba6eaa7..9e637665f55 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -255,14 +255,14 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) } } - Item* pItem = _player->GetItemByPos(bag, slot); - if (!pItem) + Item* item = _player->GetItemByPos(bag, slot); + if (!item) { _player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } - if (pItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_INDESTRUCTIBLE) + if (item->GetTemplate()->Flags & ITEM_PROTO_FLAG_INDESTRUCTIBLE) { _player->SendEquipError(EQUIP_ERR_CANT_DROP_SOULBOUND, NULL, NULL); return; @@ -271,7 +271,7 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) if (count) { uint32 i_count = count; - _player->DestroyItemCount(pItem, i_count, true); + _player->DestroyItemCount(item, i_count, true); } else _player->DestroyItem(bag, slot, true); @@ -445,13 +445,13 @@ void WorldSession::HandleReadItem(WorldPacket & recv_data) recv_data >> bag >> slot; //sLog->outDetail("STORAGE: Read bag = %u, slot = %u", bag, slot); - Item* pItem = _player->GetItemByPos(bag, slot); + Item* item = _player->GetItemByPos(bag, slot); - if (pItem && pItem->GetTemplate()->PageText) + if (item && item->GetTemplate()->PageText) { WorldPacket data; - InventoryResult msg = _player->CanUseItem(pItem); + InventoryResult msg = _player->CanUseItem(item); if (msg == EQUIP_ERR_OK) { data.Initialize (SMSG_READ_ITEM_OK, 8); @@ -461,9 +461,9 @@ void WorldSession::HandleReadItem(WorldPacket & recv_data) { data.Initialize(SMSG_READ_ITEM_FAILED, 8); sLog->outDetail("STORAGE: Unable to read item"); - _player->SendEquipError(msg, pItem, NULL); + _player->SendEquipError(msg, item, NULL); } - data << pItem->GetGUID(); + data << item->GetGUID(); SendPacket(&data); } else @@ -506,25 +506,25 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - Item* pItem = _player->GetItemByGuid(itemguid); - if (pItem) + Item* item = _player->GetItemByGuid(itemguid); + if (item) { // prevent sell not owner item - if (_player->GetGUID() != pItem->GetOwnerGUID()) + if (_player->GetGUID() != item->GetOwnerGUID()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; } // prevent sell non empty bag by drag-and-drop at vendor's item list - if (pItem->IsNotEmptyBag()) + if (item->IsNotEmptyBag()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; } // prevent sell currently looted item - if (_player->GetLootGUID() == pItem->GetGUID()) + if (_player->GetLootGUID() == item->GetGUID()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; @@ -533,44 +533,44 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) // prevent selling item for sellprice when the item is still refundable // this probably happens when right clicking a refundable item, the client sends both // CMSG_SELL_ITEM and CMSG_REFUND_ITEM (unverified) - if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) + if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) return; // Therefore, no feedback to client // special case at auto sell (sell all) if (count == 0) { - count = pItem->GetCount(); + count = item->GetCount(); } else { // prevent sell more items that exist in stack (possible only not from client) - if (count > pItem->GetCount()) + if (count > item->GetCount()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; } } - ItemTemplate const* pProto = pItem->GetTemplate(); + ItemTemplate const* pProto = item->GetTemplate(); if (pProto) { if (pProto->SellPrice > 0) { - if (count < pItem->GetCount()) // need split items + if (count < item->GetCount()) // need split items { - Item* pNewItem = pItem->CloneItem(count, _player); + Item* pNewItem = item->CloneItem(count, _player); if (!pNewItem) { - sLog->outError("WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), count); + sLog->outError("WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", item->GetEntry(), count); _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; } - pItem->SetCount(pItem->GetCount() - count); - _player->ItemRemovedQuestCheck(pItem->GetEntry(), count); + item->SetCount(item->GetCount() - count); + _player->ItemRemovedQuestCheck(item->GetEntry(), count); if (_player->IsInWorld()) - pItem->SendUpdateToPlayer(_player); - pItem->SetState(ITEM_CHANGED, _player); + item->SendUpdateToPlayer(_player); + item->SetState(ITEM_CHANGED, _player); _player->AddItemToBuyBackSlot(pNewItem); if (_player->IsInWorld()) @@ -578,10 +578,10 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) } else { - _player->ItemRemovedQuestCheck(pItem->GetEntry(), pItem->GetCount()); - _player->RemoveItem(pItem->GetBagSlot(), pItem->GetSlot(), true); - pItem->RemoveFromUpdateQueueOf(_player); - _player->AddItemToBuyBackSlot(pItem); + _player->ItemRemovedQuestCheck(item->GetEntry(), item->GetCount()); + _player->RemoveItem(item->GetBagSlot(), item->GetSlot(), true); + item->RemoveFromUpdateQueueOf(_player); + _player->AddItemToBuyBackSlot(item); } uint32 money = pProto->SellPrice * count; @@ -617,28 +617,28 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - Item* pItem = _player->GetItemFromBuyBackSlot(slot); - if (pItem) + Item* item = _player->GetItemFromBuyBackSlot(slot); + if (item) { uint32 price = _player->GetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + slot - BUYBACK_SLOT_START); if (!_player->HasEnoughMoney(price)) { - _player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, pItem->GetEntry(), 0); + _player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, item->GetEntry(), 0); return; } ItemPosCountVec dest; - InventoryResult msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, pItem, false); + InventoryResult msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, item, false); if (msg == EQUIP_ERR_OK) { _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->StoreItem(dest, pItem, true); + _player->ItemAddedQuestCheck(item->GetEntry(), item->GetCount()); + _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item->GetEntry(), item->GetCount()); + _player->StoreItem(dest, item, true); } else - _player->SendEquipError(msg, pItem, NULL); + _player->SendEquipError(msg, item, NULL); return; } else @@ -815,8 +815,8 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) recv_data >> srcbag >> srcslot >> dstbag; //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u", srcbag, srcslot, dstbag); - Item* pItem = _player->GetItemByPos(srcbag, srcslot); - if (!pItem) + Item* item = _player->GetItemByPos(srcbag, srcslot); + if (!item) return; if (!_player->IsValidPos(dstbag, NULL_SLOT, false)) // can be autostore pos @@ -825,7 +825,7 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) return; } - uint16 src = pItem->GetPos(); + uint16 src = item->GetPos(); // check unequip potability for equipped items and bank bags if (_player->IsEquipmentPos (src) || _player->IsBagPos (src)) @@ -833,16 +833,16 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) InventoryResult msg = _player->CanUnequipItem(src, !_player->IsBagPos (src)); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, pItem, NULL); + _player->SendEquipError(msg, item, NULL); return; } } ItemPosCountVec dest; - InventoryResult msg = _player->CanStoreItem(dstbag, NULL_SLOT, dest, pItem, false); + InventoryResult msg = _player->CanStoreItem(dstbag, NULL_SLOT, dest, item, false); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, pItem, NULL); + _player->SendEquipError(msg, item, NULL); return; } @@ -850,12 +850,12 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) if (dest.size() == 1 && dest[0].pos == src) { // just remove grey item state - _player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); + _player->SendEquipError(EQUIP_ERR_NONE, item, NULL); return; } _player->RemoveItem(srcbag, srcslot, true); - _player->StoreItem(dest, pItem, true); + _player->StoreItem(dest, item, true); } void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) @@ -919,27 +919,27 @@ void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket) recvPacket >> srcbag >> srcslot; sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); - Item* pItem = _player->GetItemByPos(srcbag, srcslot); - if (!pItem) + Item* item = _player->GetItemByPos(srcbag, srcslot); + if (!item) return; ItemPosCountVec dest; - InventoryResult msg = _player->CanBankItem(NULL_BAG, NULL_SLOT, dest, pItem, false); + InventoryResult msg = _player->CanBankItem(NULL_BAG, NULL_SLOT, dest, item, false); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, pItem, NULL); + _player->SendEquipError(msg, item, NULL); return; } - if (dest.size() == 1 && dest[0].pos == pItem->GetPos()) + if (dest.size() == 1 && dest[0].pos == item->GetPos()) { - _player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); + _player->SendEquipError(EQUIP_ERR_NONE, item, NULL); return; } _player->RemoveItem(srcbag, srcslot, true); - _player->ItemRemovedQuestCheck(pItem->GetEntry(), pItem->GetCount()); - _player->BankItem(dest, pItem, true); + _player->ItemRemovedQuestCheck(item->GetEntry(), item->GetCount()); + _player->BankItem(dest, item, true); } void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket) @@ -950,36 +950,36 @@ void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket) recvPacket >> srcbag >> srcslot; sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); - Item* pItem = _player->GetItemByPos(srcbag, srcslot); - if (!pItem) + Item* item = _player->GetItemByPos(srcbag, srcslot); + if (!item) return; if (_player->IsBankPos(srcbag, srcslot)) // moving from bank to inventory { ItemPosCountVec dest; - InventoryResult msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, pItem, false); + InventoryResult msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, item, false); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, pItem, NULL); + _player->SendEquipError(msg, item, NULL); return; } _player->RemoveItem(srcbag, srcslot, true); - _player->StoreItem(dest, pItem, true); - _player->ItemAddedQuestCheck(pItem->GetEntry(), pItem->GetCount()); + _player->StoreItem(dest, item, true); + _player->ItemAddedQuestCheck(item->GetEntry(), item->GetCount()); } else // moving from inventory to bank { ItemPosCountVec dest; - InventoryResult msg = _player->CanBankItem(NULL_BAG, NULL_SLOT, dest, pItem, false); + InventoryResult msg = _player->CanBankItem(NULL_BAG, NULL_SLOT, dest, item, false); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, pItem, NULL); + _player->SendEquipError(msg, item, NULL); return; } _player->RemoveItem(srcbag, srcslot, true); - _player->BankItem(dest, pItem, true); + _player->BankItem(dest, item, true); } } diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 8e4b41a9be4..b4d6db5e80c 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -55,15 +55,15 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data) } else if (IS_ITEM_GUID(lguid)) { - Item* pItem = player->GetItemByGuid(lguid); + Item* item = player->GetItemByGuid(lguid); - if (!pItem) + if (!item) { player->SendLootRelease(lguid); return; } - loot = &pItem->loot; + loot = &item->loot; } else if (IS_CORPSE_GUID(lguid)) { @@ -357,29 +357,29 @@ void WorldSession::DoLootRelease(uint64 lguid) } else if (IS_ITEM_GUID(lguid)) { - Item* pItem = player->GetItemByGuid(lguid); - if (!pItem) + Item* item = player->GetItemByGuid(lguid); + if (!item) return; - ItemTemplate const* proto = pItem->GetTemplate(); + ItemTemplate const* proto = item->GetTemplate(); // destroy only 5 items from stack in case prospecting and milling if (proto->Flags & (ITEM_PROTO_FLAG_PROSPECTABLE | ITEM_PROTO_FLAG_MILLABLE)) { - pItem->m_lootGenerated = false; - pItem->loot.clear(); + item->m_lootGenerated = false; + item->loot.clear(); - uint32 count = pItem->GetCount(); + uint32 count = item->GetCount(); // >=5 checked in spell code, but will work for cheating cases also with removing from another stacks. if (count > 5) count = 5; - player->DestroyItemCount(pItem, count, true); + player->DestroyItemCount(item, count, true); } else // FIXME: item must not be deleted in case not fully looted state. But this pre-request implement loot saving in DB at item save. Or cheating possible. - player->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true); + player->DestroyItem(item->GetBagSlot(), item->GetSlot(), true); return; // item can be looted only single player } else diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 9ea0e124112..a8ebb4722dd 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -86,53 +86,53 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) return; } - Item* pItem = pUser->GetUseableItemByPos(bagIndex, slot); - if (!pItem) + Item* item = pUser->GetUseableItemByPos(bagIndex, slot); + if (!item) { pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } - if (pItem->GetGUID() != itemGUID) + if (item->GetGUID() != itemGUID) { pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } - sLog->outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, castCount: %u, spellId: %u, Item: %u, glyphIndex: %u, data length = %i", bagIndex, slot, castCount, spellId, pItem->GetEntry(), glyphIndex, (uint32)recvPacket.size()); + sLog->outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, castCount: %u, spellId: %u, Item: %u, glyphIndex: %u, data length = %i", bagIndex, slot, castCount, spellId, item->GetEntry(), glyphIndex, (uint32)recvPacket.size()); - ItemTemplate const* proto = pItem->GetTemplate(); + ItemTemplate const* proto = item->GetTemplate(); if (!proto) { - pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pItem, NULL); + pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, item, NULL); return; } // some item classes can be used only in equipped state - if (proto->InventoryType != INVTYPE_NON_EQUIP && !pItem->IsEquipped()) + if (proto->InventoryType != INVTYPE_NON_EQUIP && !item->IsEquipped()) { - pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pItem, NULL); + pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, item, NULL); return; } - InventoryResult msg = pUser->CanUseItem(pItem); + InventoryResult msg = pUser->CanUseItem(item); if (msg != EQUIP_ERR_OK) { - pUser->SendEquipError(msg, pItem, NULL); + pUser->SendEquipError(msg, item, NULL); return; } // only allow conjured consumable, bandage, poisons (all should have the 2^21 item flag set in DB) if (proto->Class == ITEM_CLASS_CONSUMABLE && !(proto->Flags & ITEM_PROTO_FLAG_USEABLE_IN_ARENA) && pUser->InArena()) { - pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, pItem, NULL); + pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, item, NULL); return; } // don't allow items banned in arena if (proto->Flags & ITEM_PROTO_FLAG_NOT_USEABLE_IN_ARENA && pUser->InArena()) { - pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, pItem, NULL); + pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, item, NULL); return; } @@ -144,7 +144,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) { if (!spellInfo->CanBeUsedInCombat()) { - pUser->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT, pItem, NULL); + pUser->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT, item, NULL); return; } } @@ -152,12 +152,12 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) } // check also BIND_WHEN_PICKED_UP and BIND_QUEST_ITEM for .additem or .additemset case by GM (not binded at adding to inventory) - if (pItem->GetTemplate()->Bonding == BIND_WHEN_USE || pItem->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetTemplate()->Bonding == BIND_QUEST_ITEM) + if (item->GetTemplate()->Bonding == BIND_WHEN_USE || item->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || item->GetTemplate()->Bonding == BIND_QUEST_ITEM) { - if (!pItem->IsSoulBound()) + if (!item->IsSoulBound()) { - pItem->SetState(ITEM_CHANGED, pUser); - pItem->SetBinding(true); + item->SetState(ITEM_CHANGED, pUser); + item->SetBinding(true); } } @@ -166,10 +166,10 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) HandleClientCastFlags(recvPacket, castFlags, targets); // Note: If script stop casting it must send appropriate data to client to prevent stuck item in gray state. - if (!sScriptMgr->OnItemUse(pUser, pItem, targets)) + if (!sScriptMgr->OnItemUse(pUser, item, targets)) { // no script or script not process request by self - pUser->CastItemUseSpell(pItem, targets, castCount, glyphIndex); + pUser->CastItemUseSpell(item, targets, castCount, glyphIndex); } } diff --git a/src/server/game/Mails/Mail.cpp b/src/server/game/Mails/Mail.cpp index 3c3888eb9f8..3511e5016fd 100755 --- a/src/server/game/Mails/Mail.cpp +++ b/src/server/game/Mails/Mail.cpp @@ -219,10 +219,10 @@ void MailDraft::SendMailTo(SQLTransaction& trans, MailReceiver const& receiver, for (MailItemMap::const_iterator mailItemIter = m_items.begin(); mailItemIter != m_items.end(); ++mailItemIter) { - Item* pItem = mailItemIter->second; + Item* item = mailItemIter->second; stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_MAIL_ITEM); stmt->setUInt32(0, mailId); - stmt->setUInt32(1, pItem->GetGUIDLow()); + stmt->setUInt32(1, item->GetGUIDLow()); stmt->setUInt32(2, receiver.GetPlayerGUIDLow()); trans->Append(stmt); } diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index fba6b460ec9..15c46a81494 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -1341,10 +1341,10 @@ void ScriptMgr::OnGuildMemberDepositMoney(Guild* guild, Player* player, uint32 & FOREACH_SCRIPT(GuildScript)->OnMemberDepositMoney(guild, player, amount); } -void ScriptMgr::OnGuildItemMove(Guild* guild, Player* player, Item* pItem, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId, +void ScriptMgr::OnGuildItemMove(Guild* guild, Player* player, Item* item, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId, bool isDestBank, uint8 destContainer, uint8 destSlotId) { - FOREACH_SCRIPT(GuildScript)->OnItemMove(guild, player, pItem, isSrcBank, srcContainer, srcSlotId, isDestBank, destContainer, destSlotId); + FOREACH_SCRIPT(GuildScript)->OnItemMove(guild, player, item, isSrcBank, srcContainer, srcSlotId, isDestBank, destContainer, destSlotId); } void ScriptMgr::OnGuildEvent(Guild* guild, uint8 eventType, uint32 playerGuid1, uint32 playerGuid2, uint8 newRank) diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 3b65a5cf256..13c14113627 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -764,7 +764,7 @@ class GuildScript : public ScriptObject virtual void OnMemberDepositMoney(Guild* /*guild*/, Player* /*player*/, uint32& /*amount*/) { } // Called when a guild member moves an item in a guild bank. - virtual void OnItemMove(Guild* /*guild*/, Player* /*player*/, Item* /*pItem*/, bool /*isSrcBank*/, uint8 /*srcContainer*/, uint8 /*srcSlotId*/, + virtual void OnItemMove(Guild* /*guild*/, Player* /*player*/, Item* /*item*/, bool /*isSrcBank*/, uint8 /*srcContainer*/, uint8 /*srcSlotId*/, bool /*isDestBank*/, uint8 /*destContainer*/, uint8 /*destSlotId*/) { } virtual void OnEvent(Guild* /*guild*/, uint8 /*eventType*/, uint32 /*playerGuid1*/, uint32 /*playerGuid2*/, uint8 /*newRank*/) { } @@ -1008,7 +1008,7 @@ class ScriptMgr void OnGuildDisband(Guild* guild); void OnGuildMemberWitdrawMoney(Guild* guild, Player* player, uint32 &amount, bool isRepair); void OnGuildMemberDepositMoney(Guild* guild, Player* player, uint32 &amount); - void OnGuildItemMove(Guild* guild, Player* player, Item* pItem, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId, + void OnGuildItemMove(Guild* guild, Player* player, Item* item, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId, bool isDestBank, uint8 destContainer, uint8 destSlotId); void OnGuildEvent(Guild* guild, uint8 eventType, uint32 playerGuid1, uint32 playerGuid2, uint8 newRank); void OnGuildBankEvent(Guild* guild, uint8 eventType, uint8 tabId, uint32 playerGuid, uint32 itemOrMoney, uint16 itemStackCount, uint8 destTabId); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 387f76bbc7f..a8e7d33e9eb 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2102,9 +2102,9 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo // and also HandleAuraModDisarm is not triggered if (!target->CanUseAttackType(BASE_ATTACK)) { - if (Item* pItem = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND)) + if (Item* item = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND)) { - target->ToPlayer()->_ApplyWeaponDamage(EQUIPMENT_SLOT_MAINHAND, pItem->GetTemplate(), NULL, apply); + target->ToPlayer()->_ApplyWeaponDamage(EQUIPMENT_SLOT_MAINHAND, item->GetTemplate(), NULL, apply); } } } @@ -2536,14 +2536,14 @@ void AuraEffect::HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode, // Handle damage modification, shapeshifted druids are not affected if (target->GetTypeId() == TYPEID_PLAYER && !target->IsInFeralForm()) { - if (Item* pItem = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) + if (Item* item = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) { uint8 attacktype = Player::GetAttackBySlot(slot); if (attacktype < MAX_ATTACK) { - target->ToPlayer()->_ApplyWeaponDamage(slot, pItem->GetTemplate(), NULL, !apply); - target->ToPlayer()->_ApplyWeaponDependentAuraMods(pItem, WeaponAttackType(attacktype), !apply); + target->ToPlayer()->_ApplyWeaponDamage(slot, item->GetTemplate(), NULL, !apply); + target->ToPlayer()->_ApplyWeaponDependentAuraMods(item, WeaponAttackType(attacktype), !apply); } } } @@ -4082,8 +4082,8 @@ void AuraEffect::HandleAuraModWeaponCritPercent(AuraApplication const* aurApp, u return; for (int i = 0; i < MAX_ATTACK; ++i) - if (Item* pItem = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) - target->ToPlayer()->_ApplyWeaponDependentAuraCritMod(pItem, WeaponAttackType(i), this, apply); + if (Item* item = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) + target->ToPlayer()->_ApplyWeaponDependentAuraCritMod(item, WeaponAttackType(i), this, apply); // mods must be applied base at equipped weapon class and subclass comparison // with spell->EquippedItemClass and EquippedItemSubClassMask and EquippedItemInventoryTypeMask @@ -4395,8 +4395,8 @@ void AuraEffect::HandleModDamageDone(AuraApplication const* aurApp, uint8 mode, if (target->GetTypeId() == TYPEID_PLAYER) { for (int i = 0; i < MAX_ATTACK; ++i) - if (Item* pItem = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) - target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(pItem, WeaponAttackType(i), this, apply); + if (Item* item = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) + target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(item, WeaponAttackType(i), this, apply); } // GetMiscValue() is bitmask of spell schools diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index ae5b14989af..2d3bd095360 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -530,8 +530,8 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme if (m_attackType == RANGED_ATTACK) // 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); + if (Item* item = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK)) + m_spellSchoolMask = SpellSchoolMask(1 << item->GetTemplate()->Damage[0].DamageType); if (originalCasterGUID) m_originalCasterGUID = originalCasterGUID; @@ -3952,12 +3952,12 @@ void Spell::WriteAmmoToPacket(WorldPacket* data) if (m_caster->GetTypeId() == TYPEID_PLAYER) { - Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); - if (pItem) + Item* item = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); + if (item) { - ammoInventoryType = pItem->GetTemplate()->InventoryType; + ammoInventoryType = item->GetTemplate()->InventoryType; if (ammoInventoryType == INVTYPE_THROWN) - ammoDisplayID = pItem->GetTemplate()->DisplayInfoID; + ammoDisplayID = item->GetTemplate()->DisplayInfoID; else { uint32 ammoID = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID); @@ -4361,15 +4361,15 @@ void Spell::TakeAmmo() { if (m_attackType == RANGED_ATTACK && m_caster->GetTypeId() == TYPEID_PLAYER) { - Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); + Item* item = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); // wands don't have ammo - if (!pItem || pItem->IsBroken() || pItem->GetTemplate()->SubClass == ITEM_SUBCLASS_WEAPON_WAND) + if (!item || item->IsBroken() || item->GetTemplate()->SubClass == ITEM_SUBCLASS_WEAPON_WAND) return; - if (pItem->GetTemplate()->InventoryType == INVTYPE_THROWN) + if (item->GetTemplate()->InventoryType == INVTYPE_THROWN) { - if (pItem->GetMaxStackCount() == 1) + if (item->GetMaxStackCount() == 1) { // decrease durability for non-stackable throw weapon m_caster->ToPlayer()->DurabilityPointLossForEquipSlot(EQUIPMENT_SLOT_RANGED); @@ -4378,7 +4378,7 @@ void Spell::TakeAmmo() { // decrease items amount for stackable throw weapon uint32 count = 1; - m_caster->ToPlayer()->DestroyItemCount(pItem, count, true); + m_caster->ToPlayer()->DestroyItemCount(item, count, true); } } else if (uint32 ammo = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID)) @@ -6216,15 +6216,15 @@ SpellCastResult Spell::CheckItems() 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()) + Item* item = m_caster->ToPlayer()->GetWeaponForAttack(m_attackType); + if (!item || item->IsBroken()) return SPELL_FAILED_EQUIPPED_ITEM; - switch (pItem->GetTemplate()->SubClass) + switch (item->GetTemplate()->SubClass) { case ITEM_SUBCLASS_WEAPON_THROWN: { - uint32 ammo = pItem->GetEntry(); + uint32 ammo = item->GetEntry(); if (!m_caster->ToPlayer()->HasItemCount(ammo, 1)) return SPELL_FAILED_NO_AMMO; }; break; @@ -6250,7 +6250,7 @@ SpellCastResult Spell::CheckItems() return SPELL_FAILED_NO_AMMO; // check ammo ws. weapon compatibility - switch (pItem->GetTemplate()->SubClass) + switch (item->GetTemplate()->SubClass) { case ITEM_SUBCLASS_WEAPON_BOW: case ITEM_SUBCLASS_WEAPON_CROSSBOW: @@ -6286,10 +6286,10 @@ SpellCastResult Spell::CheckItems() if (!pProto) return SPELL_FAILED_ITEM_AT_MAX_CHARGES; - if (Item* pitem = p_caster->GetItemByEntry(item_id)) + if (Item* item = p_caster->GetItemByEntry(item_id)) { for (int x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) - if (pProto->Spells[x].SpellCharges != 0 && pitem->GetSpellCharges(x) == pProto->Spells[x].SpellCharges) + if (pProto->Spells[x].SpellCharges != 0 && item->GetSpellCharges(x) == pProto->Spells[x].SpellCharges) return SPELL_FAILED_ITEM_AT_MAX_CHARGES; } break; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 59b6d8971cf..07b7921e6e3 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1777,22 +1777,22 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype) if (num_to_add) { // create the new item and store it - Item* pItem = player->StoreNewItem(dest, newitemid, true, Item::GenerateItemRandomPropertyId(newitemid)); + Item* item = player->StoreNewItem(dest, newitemid, true, Item::GenerateItemRandomPropertyId(newitemid)); // was it successful? return error if not - if (!pItem) + if (!item) { player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } // set the "Crafted by ..." property of the item - if (pItem->GetTemplate()->Class != ITEM_CLASS_CONSUMABLE && pItem->GetTemplate()->Class != ITEM_CLASS_QUEST && newitemid != 6265 && newitemid != 6948) - pItem->SetUInt32Value(ITEM_FIELD_CREATOR, player->GetGUIDLow()); + if (item->GetTemplate()->Class != ITEM_CLASS_CONSUMABLE && item->GetTemplate()->Class != ITEM_CLASS_QUEST && newitemid != 6265 && newitemid != 6948) + item->SetUInt32Value(ITEM_FIELD_CREATOR, player->GetGUIDLow()); // send info to the client - if (pItem) - player->SendNewItem(pItem, num_to_add, true, bgType == 0); + if (item) + player->SendNewItem(item, num_to_add, true, bgType == 0); // we succeeded in creating at least one item, so a levelup is possible if (bgType == 0) @@ -6672,11 +6672,11 @@ void Spell::EffectRechargeManaGem(SpellEffIndex /*effIndex*/) return; } - if (Item* pItem = player->GetItemByEntry(item_id)) + if (Item* item = player->GetItemByEntry(item_id)) { for (int x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) - pItem->SetSpellCharges(x, pProto->Spells[x].SpellCharges); - pItem->SetState(ITEM_CHANGED, player); + item->SetSpellCharges(x, pProto->Spells[x].SpellCharges); + item->SetState(ITEM_CHANGED, player); } } diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 67ac6f8ff76..8d803a54096 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -163,15 +163,15 @@ public: if (!*args) return false; - char* pitem = handler->extractKeyFromLink((char*)args, "Hitem"); - if (!pitem) + char* item = handler->extractKeyFromLink((char*)args, "Hitem"); + if (!item) { handler->SendSysMessage(LANG_COMMAND_NEEDITEMSEND); handler->SetSentErrorMessage(true); return false; } - int32 item_int = atol(pitem); + int32 item_int = atol(item); if (item_int <= 0) return false; @@ -411,14 +411,14 @@ public: return false; } - char* pitem = handler->extractKeyFromLink((char*)args, "Hitem"); - if (!pitem) + char* item = handler->extractKeyFromLink((char*)args, "Hitem"); + if (!item) { handler->SendSysMessage(LANG_COMMAND_NEEDITEMSEND); handler->SetSentErrorMessage(true); return false; } - uint32 itemId = atol(pitem); + uint32 itemId = atol(item); if (!sObjectMgr->RemoveVendorItem(vendor->GetEntry(), itemId)) { 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 7c82454ba87..10227910ec8 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -267,11 +267,11 @@ public: //dosen't work at all if (uiShieldBreakerTimer <= uiDiff) { - Vehicle* pVehicle = me->GetVehicleKit(); - if (!pVehicle) + Vehicle* vehicle = me->GetVehicleKit(); + if (!vehicle) return; - if (Unit* pPassenger = pVehicle->GetPassenger(SEAT_ID_0)) + if (Unit* pPassenger = vehicle->GetPassenger(SEAT_ID_0)) { Map::PlayerList const& players = me->GetMap()->GetPlayers(); if (me->GetMap()->IsDungeon() && !players.isEmpty()) 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 a2919de0149..7f12853ef0b 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 @@ -221,8 +221,8 @@ public: { uiVehicle1GUID = pBoss->GetGUID(); uint64 uiGrandChampionBoss1 = 0; - if (Vehicle* pVehicle = pBoss->GetVehicleKit()) - if (Unit* unit = pVehicle->GetPassenger(0)) + if (Vehicle* vehicle = pBoss->GetVehicleKit()) + if (Unit* unit = vehicle->GetPassenger(0)) uiGrandChampionBoss1 = unit->GetGUID(); if (instance) { @@ -236,8 +236,8 @@ public: { uiVehicle2GUID = pBoss->GetGUID(); uint64 uiGrandChampionBoss2 = 0; - if (Vehicle* pVehicle = pBoss->GetVehicleKit()) - if (Unit* unit = pVehicle->GetPassenger(0)) + if (Vehicle* vehicle = pBoss->GetVehicleKit()) + if (Unit* unit = vehicle->GetPassenger(0)) uiGrandChampionBoss2 = unit->GetGUID(); if (instance) { @@ -251,8 +251,8 @@ public: { uiVehicle3GUID = pBoss->GetGUID(); uint64 uiGrandChampionBoss3 = 0; - if (Vehicle* pVehicle = pBoss->GetVehicleKit()) - if (Unit* unit = pVehicle->GetPassenger(0)) + if (Vehicle* vehicle = pBoss->GetVehicleKit()) + if (Unit* unit = vehicle->GetPassenger(0)) uiGrandChampionBoss3 = unit->GetGUID(); if (instance) { diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index c313a2138a6..fab0188de4d 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -176,9 +176,9 @@ public: { if (AggroYellTimer <= diff) { - if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter])) + if (Unit* member = Unit::GetUnit(*me, Council[YellCounter])) { - DoScriptText(CouncilAggro[YellCounter].entry, pMember); + DoScriptText(CouncilAggro[YellCounter].entry, member); AggroYellTimer = CouncilAggro[YellCounter].timer; } ++YellCounter; @@ -191,10 +191,10 @@ public: { if (EnrageTimer <= diff) { - if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter])) + if (Unit* member = Unit::GetUnit(*me, Council[YellCounter])) { - pMember->CastSpell(pMember, SPELL_BERSERK, true); - DoScriptText(CouncilEnrage[YellCounter].entry, pMember); + member->CastSpell(member, SPELL_BERSERK, true); + DoScriptText(CouncilEnrage[YellCounter].entry, member); EnrageTimer = CouncilEnrage[YellCounter].timer; } ++YellCounter; @@ -242,19 +242,19 @@ public: DeathCount = 0; - Creature* pMember = NULL; + Creature* member = NULL; for (uint8 i = 0; i < 4; ++i) { - pMember = Unit::GetCreature((*me), Council[i]); - if (!pMember) + member = Unit::GetCreature((*me), Council[i]); + if (!member) continue; - if (!pMember->isAlive()) + if (!member->isAlive()) { - pMember->RemoveCorpse(); - pMember->Respawn(); + member->RemoveCorpse(); + member->Respawn(); } - pMember->AI()->EnterEvadeMode(); + member->AI()->EnterEvadeMode(); } if (instance) @@ -332,9 +332,9 @@ public: return; } - Creature* pMember = (Unit::GetCreature(*me, Council[DeathCount])); - if (pMember && pMember->isAlive()) - pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + Creature* member = (Unit::GetCreature(*me, Council[DeathCount])); + if (member && member->isAlive()) + member->DealDamage(member, member->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); ++DeathCount; EndEventTimer = 1500; } else EndEventTimer -= diff; diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 079221a97e8..f2f2f9e3cdd 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() diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index cf55bb14895..bb5d7380695 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 @@ -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; } }; @@ -110,13 +110,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 +130,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; } } @@ -219,7 +219,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,14 +264,14 @@ 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 & /*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, pItem, NULL); + 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); @@ -330,7 +330,7 @@ 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 & /*targets*/) + bool OnUse(Player* player, Item* /*item*/, const SpellCastTargets & /*targets*/) { if (player->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) != QUEST_STATUS_INCOMPLETE) return false; @@ -367,7 +367,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 & /*targets*/) + bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/) { if (player->GetQuestStatus(QUEST_THE_EMISSARY) == QUEST_STATUS_INCOMPLETE) { @@ -376,9 +376,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 +394,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/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index a1920e06ad1..48be9bdba33 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -241,14 +241,14 @@ bool EquippedOk(Player* player, uint32 spellId) if (!reqSpell) continue; - Item* pItem; + Item* item; 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; } } -- cgit v1.2.3 From 2a5caef4a64645f788f6d3e33d6159725358f1dd Mon Sep 17 00:00:00 2001 From: leak Date: Wed, 14 Mar 2012 18:51:51 +0100 Subject: Revert "Core: more more cleanup" - Build test anyone? This reverts commit 20cd4c71ee6336610daab304959909b2f6397287. --- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 20 +- src/server/game/AuctionHouse/AuctionHouseMgr.h | 2 +- src/server/game/Entities/Item/Container/Bag.cpp | 36 +- src/server/game/Entities/Item/Container/Bag.h | 2 +- src/server/game/Entities/Item/Item.cpp | 10 +- src/server/game/Entities/Player/Player.cpp | 946 ++++++++++----------- src/server/game/Entities/Player/Player.h | 54 +- src/server/game/Groups/Group.cpp | 8 +- src/server/game/Guilds/Guild.cpp | 128 +-- src/server/game/Guilds/Guild.h | 22 +- src/server/game/Handlers/AuctionHouseHandler.cpp | 6 +- src/server/game/Handlers/ItemHandler.cpp | 124 +-- src/server/game/Handlers/LootHandler.cpp | 22 +- src/server/game/Handlers/SpellHandler.cpp | 38 +- src/server/game/Mails/Mail.cpp | 4 +- src/server/game/Scripting/ScriptMgr.cpp | 4 +- src/server/game/Scripting/ScriptMgr.h | 4 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 18 +- src/server/game/Spells/Spell.cpp | 36 +- src/server/game/Spells/SpellEffects.cpp | 18 +- src/server/scripts/Commands/cs_npc.cpp | 12 +- .../TrialOfTheChampion/boss_grand_champions.cpp | 6 +- .../TrialOfTheChampion/trial_of_the_champion.cpp | 12 +- .../Outland/BlackTemple/illidari_council.cpp | 30 +- src/server/scripts/Spells/spell_item.cpp | 4 +- src/server/scripts/World/item_scripts.cpp | 34 +- src/server/scripts/World/npc_professions.cpp | 8 +- 27 files changed, 804 insertions(+), 804 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 43f3ff50fd8..a2e958d680f 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -64,9 +64,9 @@ AuctionHouseObject* AuctionHouseMgr::GetAuctionsMap(uint32 factionTemplateId) return &mNeutralAuctions; } -uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* item, uint32 count) +uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* pItem, uint32 count) { - uint32 MSV = item->GetTemplate()->SellPrice; + uint32 MSV = pItem->GetTemplate()->SellPrice; if (MSV <= 0) return AH_MINIMUM_DEPOSIT; @@ -89,8 +89,8 @@ uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 //does not clear ram void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& trans) { - Item* item = GetAItem(auction->item_guidlow); - if (!item) + Item* pItem = GetAItem(auction->item_guidlow); + if (!pItem) return; uint32 bidder_accId = 0; @@ -127,7 +127,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& uint32 owner_accid = sObjectMgr->GetPlayerAccountIdByGUID(auction->owner); sLog->outCommand(bidder_accId, "GM %s (Account: %u) won item in auction: %s (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)", - bidder_name.c_str(), bidder_accId, item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount(), auction->bid, owner_name.c_str(), owner_accid); + bidder_name.c_str(), bidder_accId, pItem->GetTemplate()->Name1.c_str(), pItem->GetEntry(), pItem->GetCount(), auction->bid, owner_name.c_str(), owner_accid); } } @@ -147,7 +147,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& // owner in `data` will set at mail receive and item extracting PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_OWNER); stmt->setUInt32(0, auction->bidder); - stmt->setUInt32(1, item->GetGUIDLow()); + stmt->setUInt32(1, pItem->GetGUIDLow()); trans->Append(stmt); if (bidder) @@ -158,7 +158,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& } MailDraft(msgAuctionWonSubject.str(), msgAuctionWonBody.str()) - .AddItem(item) + .AddItem(pItem) .SendMailTo(trans, MailReceiver(bidder, auction->bidder), auction, MAIL_CHECK_MASK_COPIED); } } @@ -234,8 +234,8 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry* auction, SQLTransa void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, SQLTransaction& trans) { //return an item in auction to its owner by mail - Item* item = GetAItem(auction->item_guidlow); - if (!item) + Item* pItem = GetAItem(auction->item_guidlow); + if (!pItem) return; uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER); @@ -251,7 +251,7 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, SQLTransacti owner->GetSession()->SendAuctionOwnerNotification(auction); MailDraft(subject.str(), "") // TODO: fix body - .AddItem(item) + .AddItem(pItem) .SendMailTo(trans, MailReceiver(owner, auction->owner), auction, MAIL_CHECK_MASK_COPIED, 0); } } diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h index d5432f7b00c..190fbcc5107 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.h +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h @@ -154,7 +154,7 @@ class AuctionHouseMgr void SendAuctionOutbiddedMail(AuctionEntry* auction, uint32 newPrice, Player* newBidder, SQLTransaction& trans); void SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQLTransaction& trans); - static uint32 GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* item, uint32 count); + static uint32 GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* pItem, uint32 count); static AuctionHouseEntry const* GetAuctionHouseEntry(uint32 factionTemplateId); public: diff --git a/src/server/game/Entities/Item/Container/Bag.cpp b/src/server/game/Entities/Item/Container/Bag.cpp index 1b9d5c12978..4eede93bd37 100755 --- a/src/server/game/Entities/Item/Container/Bag.cpp +++ b/src/server/game/Entities/Item/Container/Bag.cpp @@ -153,18 +153,18 @@ void Bag::RemoveItem(uint8 slot, bool /*update*/) SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), 0); } -void Bag::StoreItem(uint8 slot, Item* item, bool /*update*/) +void Bag::StoreItem(uint8 slot, Item* pItem, bool /*update*/) { ASSERT(slot < MAX_BAG_SIZE); - if (item && item->GetGUID() != this->GetGUID()) + if (pItem && pItem->GetGUID() != this->GetGUID()) { - m_bagslot[slot] = item; - SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), item->GetGUID()); - item->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); - item->SetUInt64Value(ITEM_FIELD_OWNER, GetOwnerGUID()); - item->SetContainer(this); - item->SetSlot(slot); + m_bagslot[slot] = pItem; + SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), pItem->GetGUID()); + pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); + pItem->SetUInt64Value(ITEM_FIELD_OWNER, GetOwnerGUID()); + pItem->SetContainer(this); + pItem->SetSlot(slot); } } @@ -189,22 +189,22 @@ bool Bag::IsEmpty() const uint32 Bag::GetItemCount(uint32 item, Item* eItem) const { - Item* item; + Item* pItem; uint32 count = 0; for (uint32 i=0; i < GetBagSize(); ++i) { - item = m_bagslot[i]; - if (item && item != eItem && item->GetEntry() == item) - count += item->GetCount(); + pItem = m_bagslot[i]; + if (pItem && pItem != eItem && pItem->GetEntry() == item) + count += pItem->GetCount(); } if (eItem && eItem->GetTemplate()->GemProperties) { for (uint32 i=0; i < GetBagSize(); ++i) { - item = m_bagslot[i]; - if (item && item != eItem && item->GetTemplate()->Socket[0].Color) - count += item->GetGemCountWithID(item); + pItem = m_bagslot[i]; + if (pItem && pItem != eItem && pItem->GetTemplate()->Socket[0].Color) + count += pItem->GetGemCountWithID(item); } } @@ -215,9 +215,9 @@ uint32 Bag::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem) { uint32 count = 0; for (uint32 i = 0; i < GetBagSize(); ++i) - if (Item* item = m_bagslot[i]) - if (item != skipItem) - if (ItemTemplate const* pProto = item->GetTemplate()) + if (Item* pItem = m_bagslot[i]) + if (pItem != skipItem) + if (ItemTemplate const* pProto = pItem->GetTemplate()) if (pProto->ItemLimitCategory == limitCategory) count += m_bagslot[i]->GetCount(); diff --git a/src/server/game/Entities/Item/Container/Bag.h b/src/server/game/Entities/Item/Container/Bag.h index 79acd9ba4af..5a533d9cf57 100755 --- a/src/server/game/Entities/Item/Container/Bag.h +++ b/src/server/game/Entities/Item/Container/Bag.h @@ -38,7 +38,7 @@ class Bag : public Item bool Create(uint32 guidlow, uint32 itemid, Player const* owner); void Clear(); - void StoreItem(uint8 slot, Item* item, bool update); + void StoreItem(uint8 slot, Item* pItem, bool update); void RemoveItem(uint8 slot, bool update); Item* GetItemByPos(uint8 slot) const; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 4e76ddfe0a8..90f6f4a217c 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1021,14 +1021,14 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player) ASSERT(count !=0 && "pProto->Stackable == 0 but checked at loading already"); - Item* item = NewItemOrBag(pProto); - if (item->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), item, player)) + Item* pItem = NewItemOrBag(pProto); + if (pItem->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), item, player)) { - item->SetCount(count); - return item; + pItem->SetCount(count); + return pItem; } else - delete item; + delete pItem; } else ASSERT(false); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a1e8ddd95d1..f0b974fa673 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1160,31 +1160,31 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) // or ammo not equipped in special bag for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) { - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { uint16 eDest; // equip offhand weapon/shield if it attempt equipped before main-hand weapon - InventoryResult msg = CanEquipItem(NULL_SLOT, eDest, item, false); + InventoryResult msg = CanEquipItem(NULL_SLOT, eDest, pItem, false); if (msg == EQUIP_ERR_OK) { RemoveItem(INVENTORY_SLOT_BAG_0, i, true); - EquipItem(eDest, item, true); + EquipItem(eDest, pItem, true); } // move other items to more appropriate slots (ammo not equipped in special bag) else { ItemPosCountVec sDest; - msg = CanStoreItem(NULL_BAG, NULL_SLOT, sDest, item, false); + msg = CanStoreItem(NULL_BAG, NULL_SLOT, sDest, pItem, false); if (msg == EQUIP_ERR_OK) { RemoveItem(INVENTORY_SLOT_BAG_0, i, true); - item = StoreItem(sDest, item, true); + pItem = StoreItem(sDest, pItem, true); } // if this is ammo then use it - msg = CanUseAmmo(item->GetEntry()); + msg = CanUseAmmo(pItem->GetEntry()); if (msg == EQUIP_ERR_OK) - SetAmmo(item->GetEntry()); + SetAmmo(pItem->GetEntry()); } } } @@ -4854,15 +4854,15 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC continue; } - Item* item = NewItemOrBag(itemProto); - if (!item->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), fields, item_template)) + Item* pItem = NewItemOrBag(itemProto); + if (!pItem->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), fields, item_template)) { - item->FSetState(ITEM_REMOVED); - item->SaveToDB(trans); // it also deletes item object! + pItem->FSetState(ITEM_REMOVED); + pItem->SaveToDB(trans); // it also deletes item object! continue; } - draft.AddItem(item); + draft.AddItem(pItem); } while (resultItems->NextRow()); } @@ -5270,8 +5270,8 @@ Corpse* Player::GetCorpse() const void Player::DurabilityLossAll(double percent, bool inventory) { for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityLoss(item, percent); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + DurabilityLoss(pItem, percent); if (inventory) { @@ -5279,8 +5279,8 @@ void Player::DurabilityLossAll(double percent, bool inventory) // for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityLoss(item, percent); + 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++) @@ -5288,8 +5288,8 @@ void Player::DurabilityLossAll(double percent, bool inventory) 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++) - if (Item* item = GetItemByPos(i, j)) - DurabilityLoss(item, percent); + if (Item* pItem = GetItemByPos(i, j)) + DurabilityLoss(pItem, percent); } } @@ -5314,8 +5314,8 @@ void Player::DurabilityLoss(Item* item, double percent) void Player::DurabilityPointsLossAll(int32 points, bool inventory) { for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityPointsLoss(item, points); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + DurabilityPointsLoss(pItem, points); if (inventory) { @@ -5323,8 +5323,8 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory) // for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityPointsLoss(item, points); + 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++) @@ -5332,8 +5332,8 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory) 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++) - if (Item* item = GetItemByPos(i, j)) - DurabilityPointsLoss(item, points); + if (Item* pItem = GetItemByPos(i, j)) + DurabilityPointsLoss(pItem, points); } } @@ -5366,8 +5366,8 @@ void Player::DurabilityPointsLoss(Item* item, int32 points) void Player::DurabilityPointLossForEquipSlot(EquipmentSlots slot) { - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) - DurabilityPointsLoss(item, 1); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) + DurabilityPointsLoss(pItem, 1); } uint32 Player::DurabilityRepairAll(bool cost, float discountMod, bool guildBank) @@ -9916,13 +9916,13 @@ InventoryResult Player::CanUnequipItems(uint32 item, uint32 count) const InventoryResult res = EQUIP_ERR_OK; for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetEntry() == item) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetEntry() == item) { InventoryResult ires = CanUnequipItem(INVENTORY_SLOT_BAG_0 << 8 | i, false); if (ires == EQUIP_ERR_OK) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return EQUIP_ERR_OK; } @@ -9931,19 +9931,19 @@ InventoryResult Player::CanUnequipItems(uint32 item, uint32 count) const } for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetEntry() == item) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetEntry() == item) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return EQUIP_ERR_OK; } for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetEntry() == item) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetEntry() == item) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return EQUIP_ERR_OK; } @@ -9951,10 +9951,10 @@ InventoryResult Player::CanUnequipItems(uint32 item, uint32 count) const 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) - if (Item* item = GetItemByPos(i, j)) - if (item->GetEntry() == item) + if (Item* pItem = GetItemByPos(i, j)) + if (pItem->GetEntry() == item) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return EQUIP_ERR_OK; } @@ -9967,14 +9967,14 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const { uint32 count = 0; for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item != skipItem && item->GetEntry() == item) - count += item->GetCount(); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem != skipItem && pItem->GetEntry() == item) + count += pItem->GetCount(); for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item != skipItem && item->GetEntry() == item) - count += item->GetCount(); + 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)) @@ -9982,16 +9982,16 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const if (skipItem && skipItem->GetTemplate()->GemProperties) for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item != skipItem && item->GetTemplate()->Socket[0].Color) - count += item->GetGemCountWithID(item); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem != skipItem && pItem->GetTemplate()->Socket[0].Color) + count += pItem->GetGemCountWithID(item); if (inBankAlso) { for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item != skipItem && item->GetEntry() == item) - count += item->GetCount(); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem != skipItem && pItem->GetEntry() == item) + count += pItem->GetCount(); for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) @@ -9999,9 +9999,9 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const if (skipItem && skipItem->GetTemplate()->GemProperties) for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item != skipItem && item->GetTemplate()->Socket[0].Color) - count += item->GetGemCountWithID(item); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem != skipItem && pItem->GetTemplate()->Socket[0].Color) + count += pItem->GetGemCountWithID(item); } return count; @@ -10011,29 +10011,29 @@ uint32 Player::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipIte { uint32 count = 0; for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item != skipItem) - if (ItemTemplate const* pProto = item->GetTemplate()) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem != skipItem) + if (ItemTemplate const* pProto = pItem->GetTemplate()) if (pProto->ItemLimitCategory == limitCategory) - count += item->GetCount(); + count += pItem->GetCount(); for (int i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item != skipItem) - if (ItemTemplate const* pProto = item->GetTemplate()) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem != skipItem) + if (ItemTemplate const* pProto = pItem->GetTemplate()) if (pProto->ItemLimitCategory == limitCategory) - count += item->GetCount(); + 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); for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item != skipItem) - if (ItemTemplate const* pProto = item->GetTemplate()) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem != skipItem) + if (ItemTemplate const* pProto = pItem->GetTemplate()) if (pProto->ItemLimitCategory == limitCategory) - count += item->GetCount(); + count += pItem->GetCount(); for (int i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) @@ -10045,33 +10045,33 @@ uint32 Player::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipIte Item* Player::GetItemByGuid(uint64 guid) const { for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetGUID() == guid) - return item; + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetGUID() == guid) + return pItem; for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetGUID() == guid) - return item; + 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_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetGUID() == guid) - return item; + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetGUID() == guid) + return pItem; 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) - if (Item* item = pBag->GetItemByPos(j)) - if (item->GetGUID() == guid) - return item; + if (Item* pItem = pBag->GetItemByPos(j)) + if (pItem->GetGUID() == guid) + return pItem; for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) - if (Item* item = pBag->GetItemByPos(j)) - if (item->GetGUID() == guid) - return item; + if (Item* pItem = pBag->GetItemByPos(j)) + if (pItem->GetGUID() == guid) + return pItem; return NULL; } @@ -10262,20 +10262,20 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const uint32 tempcount = 0; for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; i++) { - Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (item && item->GetEntry() == item && !item->IsInTrade()) + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return true; } } for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) { - Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (item && item->GetEntry() == item && !item->IsInTrade()) + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return true; } @@ -10286,10 +10286,10 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const { for (uint32 j = 0; j < pBag->GetBagSize(); j++) { - Item* item = GetItemByPos(i, j); - if (item && item->GetEntry() == item && !item->IsInTrade()) + Item* pItem = GetItemByPos(i, j); + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return true; } @@ -10301,10 +10301,10 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const { for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; i++) { - Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (item && item->GetEntry() == item && !item->IsInTrade()) + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return true; } @@ -10315,10 +10315,10 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const { for (uint32 j = 0; j < pBag->GetBagSize(); j++) { - Item* item = GetItemByPos(i, j); - if (item && item->GetEntry() == item && !item->IsInTrade()) + Item* pItem = GetItemByPos(i, j); + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return true; } @@ -10338,10 +10338,10 @@ bool Player::HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_ if (i == except_slot) continue; - Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (item && item->GetEntry() == item) + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (pItem && pItem->GetEntry() == item) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return true; } @@ -10355,10 +10355,10 @@ bool Player::HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_ if (i == except_slot) continue; - Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (item && item->GetTemplate()->Socket[0].Color) + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (pItem && pItem->GetTemplate()->Socket[0].Color) { - tempcount += item->GetGemCountWithID(item); + tempcount += pItem->GetGemCountWithID(item); if (tempcount >= count) return true; } @@ -10376,24 +10376,24 @@ bool Player::HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 if (i == except_slot) continue; - Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (!item) + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (!pItem) continue; - ItemTemplate const* pProto = item->GetTemplate(); + ItemTemplate const* pProto = pItem->GetTemplate(); if (!pProto) continue; if (pProto->ItemLimitCategory == limitCategory) { - tempcount += item->GetCount(); + tempcount += pItem->GetCount(); if (tempcount >= count) return true; } - if (pProto->Socket[0].Color || item->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT)) + if (pProto->Socket[0].Color || pItem->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT)) { - tempcount += item->GetGemCountWithLimitCategory(limitCategory); + tempcount += pItem->GetGemCountWithLimitCategory(limitCategory); if (tempcount >= count) return true; } @@ -10402,7 +10402,7 @@ bool Player::HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 return false; } -InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* item, uint32* no_space_count) const +InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count) const { ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(entry); if (!pProto) @@ -10412,7 +10412,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - if (item && item->m_lootGenerated) + if (pItem && pItem->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; // no maximum @@ -10421,7 +10421,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item if (pProto->MaxCount > 0) { - uint32 curcount = GetItemCount(pProto->ItemId, true, item); + uint32 curcount = GetItemCount(pProto->ItemId, true, pItem); if (curcount + count > uint32(pProto->MaxCount)) { if (no_space_count) @@ -10443,7 +10443,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item if (limitEntry->mode == ITEM_LIMIT_CATEGORY_MODE_HAVE) { - uint32 curcount = GetItemCountWithLimitCategory(pProto->ItemLimitCategory, item); + uint32 curcount = GetItemCountWithLimitCategory(pProto->ItemLimitCategory, pItem); if (curcount + count > uint32(limitEntry->maxCount)) { if (no_space_count) @@ -10458,17 +10458,17 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item bool Player::HasItemTotemCategory(uint32 TotemCategory) const { - Item* item; + Item* pItem; for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) { - item = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i); - if (item && IsTotemCategoryCompatiableWith(item->GetTemplate()->TotemCategory, TotemCategory)) + pItem = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i); + if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory, TotemCategory)) return true; } for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) { - item = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i); - if (item && IsTotemCategoryCompatiableWith(item->GetTemplate()->TotemCategory, TotemCategory)) + 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) @@ -10477,8 +10477,8 @@ bool Player::HasItemTotemCategory(uint32 TotemCategory) const { for (uint32 j = 0; j < pBag->GetBagSize(); ++j) { - item = GetUseableItemByPos(i, j); - if (item && IsTotemCategoryCompatiableWith(item->GetTemplate()->TotemCategory, TotemCategory)) + pItem = GetUseableItemByPos(i, j); + if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory, TotemCategory)) return true; } } @@ -10681,7 +10681,7 @@ InventoryResult Player::CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 sl return EQUIP_ERR_OK; } -InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 entry, uint32 count, Item* item, bool swap, uint32* no_space_count) const +InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 entry, uint32 count, Item* pItem, bool swap, uint32* no_space_count) const { sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count); @@ -10693,17 +10693,17 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED :EQUIP_ERR_ITEM_NOT_FOUND; } - if (item) + if (pItem) { // item used - if (item->m_lootGenerated) + if (pItem->m_lootGenerated) { if (no_space_count) *no_space_count = count; return EQUIP_ERR_ALREADY_LOOTED; } - if (item->IsBindedNotWith(this)) + if (pItem->IsBindedNotWith(this)) { if (no_space_count) *no_space_count = count; @@ -10713,7 +10713,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des // check count of items (skip for auto move for same player from bank) uint32 no_similar_count = 0; // can't store this amount similar items - InventoryResult res = CanTakeMoreSimilarItems(entry, count, item, &no_similar_count); + InventoryResult res = CanTakeMoreSimilarItems(entry, count, pItem, &no_similar_count); if (res != EQUIP_ERR_OK) { if (count == no_similar_count) @@ -10728,7 +10728,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des // in specific slot if (bag != NULL_BAG && slot != NULL_SLOT) { - res = CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, item); + res = CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, pItem); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10757,7 +10757,7 @@ 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, item, bag, slot); + 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) @@ -10775,7 +10775,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, item, bag, slot); + res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10796,9 +10796,9 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des else // equipped bag { // we need check 2 time (specialized/non_specialized), use NULL_BAG to prevent skipping bag - res = CanStoreItem_InBag(bag, dest, pProto, count, true, false, item, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, true, false, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = CanStoreItem_InBag(bag, dest, pProto, count, true, true, item, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, true, true, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) { @@ -10826,7 +10826,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des if (pProto->BagFamily & BAG_FAMILY_MASK_KEYS) { uint32 keyringSize = GetMaxKeyringSize(); - res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, KEYRING_SLOT_START+keyringSize, dest, pProto, count, false, item, bag, slot); + 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) @@ -10844,7 +10844,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, item, bag, slot); + 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) @@ -10864,7 +10864,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) { - res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, item, bag, slot); + 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) @@ -10883,7 +10883,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } } - res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, item, bag, slot); + res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10903,9 +10903,9 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } else // equipped bag { - res = CanStoreItem_InBag(bag, dest, pProto, count, false, false, item, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, false, false, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = CanStoreItem_InBag(bag, dest, pProto, count, false, true, item, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, false, true, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) { @@ -10931,7 +10931,7 @@ 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, item, bag, slot); + 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) @@ -10949,7 +10949,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, item, bag, slot); + res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10971,7 +10971,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des { for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, true, false, item, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, true, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -10989,7 +10989,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, true, true, item, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, true, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11011,7 +11011,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des if (pProto->BagFamily & BAG_FAMILY_MASK_KEYS) { uint32 keyringSize = GetMaxKeyringSize(); - res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, KEYRING_SLOT_START+keyringSize, dest, pProto, count, false, item, bag, slot); + 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) @@ -11031,7 +11031,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) { - res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, item, bag, slot); + 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) @@ -11052,7 +11052,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, false, false, item, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, false, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11068,11 +11068,11 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } } - if (item && item->IsNotEmptyBag()) + if (pItem && pItem->IsNotEmptyBag()) return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG; // search free slot - res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, item, bag, slot); + res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -11092,7 +11092,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, false, true, item, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, false, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11162,30 +11162,30 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const // check free space for all items for (int k = 0; k < count; ++k) { - Item* item = pItems[k]; + Item* pItem = pItems[k]; // no item - if (!item) continue; + if (!pItem) continue; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItems %i. item = %u, count = %u", k + 1, item->GetEntry(), item->GetCount()); - ItemTemplate const* pProto = item->GetTemplate(); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItems %i. item = %u, count = %u", k + 1, pItem->GetEntry(), pItem->GetCount()); + ItemTemplate const* pProto = pItem->GetTemplate(); // strange item if (!pProto) return EQUIP_ERR_ITEM_NOT_FOUND; // item used - if (item->m_lootGenerated) + if (pItem->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; // item it 'bind' - if (item->IsBindedNotWith(this)) + if (pItem->IsBindedNotWith(this)) return EQUIP_ERR_DONT_OWN_THAT_ITEM; ItemTemplate const* pBagProto; // item is 'one item only' - InventoryResult res = CanTakeMoreSimilarItems(item); + InventoryResult res = CanTakeMoreSimilarItems(pItem); if (res != EQUIP_ERR_OK) return res; @@ -11197,9 +11197,9 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const 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] + item->GetCount() <= pProto->GetMaxStackSize()) + if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_keys[t-KEYRING_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize()) { - inv_keys[t-KEYRING_SLOT_START] += item->GetCount(); + inv_keys[t-KEYRING_SLOT_START] += pItem->GetCount(); b_found = true; break; } @@ -11209,9 +11209,9 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const 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] + item->GetCount() <= pProto->GetMaxStackSize()) + if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_tokens[t-CURRENCYTOKEN_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize()) { - inv_tokens[t-CURRENCYTOKEN_SLOT_START] += item->GetCount(); + inv_tokens[t-CURRENCYTOKEN_SLOT_START] += pItem->GetCount(); b_found = true; break; } @@ -11221,9 +11221,9 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const for (int t = INVENTORY_SLOT_ITEM_START; t < INVENTORY_SLOT_ITEM_END; ++t) { pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, t); - if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_slot_items[t-INVENTORY_SLOT_ITEM_START] + item->GetCount() <= pProto->GetMaxStackSize()) + if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_slot_items[t-INVENTORY_SLOT_ITEM_START] + pItem->GetCount() <= pProto->GetMaxStackSize()) { - inv_slot_items[t-INVENTORY_SLOT_ITEM_START] += item->GetCount(); + inv_slot_items[t-INVENTORY_SLOT_ITEM_START] += pItem->GetCount(); b_found = true; break; } @@ -11234,14 +11234,14 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const { if (Bag* bag = GetBagByPos(t)) { - if (ItemCanGoIntoBag(item->GetTemplate(), bag->GetTemplate())) + if (ItemCanGoIntoBag(pItem->GetTemplate(), bag->GetTemplate())) { for (uint32 j = 0; j < bag->GetBagSize(); j++) { pItem2 = GetItemByPos(t, j); - if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_bags[t-INVENTORY_SLOT_BAG_START][j] + item->GetCount() <= pProto->GetMaxStackSize()) + if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_bags[t-INVENTORY_SLOT_BAG_START][j] + pItem->GetCount() <= pProto->GetMaxStackSize()) { - inv_bags[t-INVENTORY_SLOT_BAG_START][j] += item->GetCount(); + inv_bags[t-INVENTORY_SLOT_BAG_START][j] += pItem->GetCount(); b_found = true; break; } @@ -11360,35 +11360,35 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const InventoryResult Player::CanEquipNewItem(uint8 slot, uint16 &dest, uint32 item, bool swap) const { dest = 0; - Item* item = Item::CreateItem(item, 1, this); - if (item) + Item* pItem = Item::CreateItem(item, 1, this); + if (pItem) { - InventoryResult result = CanEquipItem(slot, dest, item, swap); - delete item; + InventoryResult result = CanEquipItem(slot, dest, pItem, swap); + delete pItem; return result; } return EQUIP_ERR_ITEM_NOT_FOUND; } -InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* item, bool swap, bool not_loading) const +InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool swap, bool not_loading) const { dest = 0; - if (item) + if (pItem) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, item->GetEntry(), item->GetCount()); - ItemTemplate const* pProto = item->GetTemplate(); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, pItem->GetEntry(), pItem->GetCount()); + ItemTemplate const* pProto = pItem->GetTemplate(); if (pProto) { // item used - if (item->m_lootGenerated) + if (pItem->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; - if (item->IsBindedNotWith(this)) + if (pItem->IsBindedNotWith(this)) return EQUIP_ERR_DONT_OWN_THAT_ITEM; // check count of items (skip for auto move for same player from bank) - InventoryResult res = CanTakeMoreSimilarItems(item); + InventoryResult res = CanTakeMoreSimilarItems(pItem); if (res != EQUIP_ERR_OK) return res; @@ -11429,7 +11429,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* item, bool if (eslot == NULL_SLOT) return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED; - res = CanUseItem(item, not_loading); + res = CanUseItem(pItem, not_loading); if (res != EQUIP_ERR_OK) return res; @@ -11437,7 +11437,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* item, bool return EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE; // if swap ignore item (equipped also) - InventoryResult res2 = CanEquipUniqueItem(item, swap ? eslot : uint8(NULL_SLOT)); + InventoryResult res2 = CanEquipUniqueItem(pItem, swap ? eslot : uint8(NULL_SLOT)); if (res2 != EQUIP_ERR_OK) return res2; @@ -11445,7 +11445,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* item, bool if (pProto->Class == ITEM_CLASS_QUIVER) for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Item* pBag = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pBag != item) + if (pBag != pItem) if (ItemTemplate const* pBagProto = pBag->GetTemplate()) if (pBagProto->Class == pProto->Class && (!swap || pBag->GetSlot() != eslot)) return (pBagProto->SubClass == ITEM_SUBCLASS_AMMO_POUCH) @@ -11507,20 +11507,20 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const if (!IsEquipmentPos(pos) && !IsBagPos(pos)) return EQUIP_ERR_OK; - Item* item = GetItemByPos(pos); + Item* pItem = GetItemByPos(pos); // Applied only to existed equipped item - if (!item) + if (!pItem) return EQUIP_ERR_OK; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, item->GetEntry(), item->GetCount()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, pItem->GetEntry(), pItem->GetCount()); - ItemTemplate const* pProto = item->GetTemplate(); + ItemTemplate const* pProto = pItem->GetTemplate(); if (!pProto) return EQUIP_ERR_ITEM_NOT_FOUND; // item used - if (item->m_lootGenerated) + if (pItem->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; // do not allow unequipping gear except weapons, offhands, projectiles, relics in @@ -11536,42 +11536,42 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const return EQUIP_ERR_NOT_DURING_ARENA_MATCH; } - if (!swap && item->IsNotEmptyBag()) + if (!swap && pItem->IsNotEmptyBag()) return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS; return EQUIP_ERR_OK; } -InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item* item, bool swap, bool not_loading) const +InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item* pItem, bool swap, bool not_loading) const { - if (!item) + if (!pItem) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; - uint32 count = item->GetCount(); + uint32 count = pItem->GetCount(); - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, item->GetEntry(), item->GetCount()); - ItemTemplate const* pProto = item->GetTemplate(); + 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; // item used - if (item->m_lootGenerated) + if (pItem->m_lootGenerated) return EQUIP_ERR_ALREADY_LOOTED; - if (item->IsBindedNotWith(this)) + if (pItem->IsBindedNotWith(this)) return EQUIP_ERR_DONT_OWN_THAT_ITEM; // Currency tokens are not supposed to be swapped out of their hidden bag - uint8 pItemslot = item->GetSlot(); + uint8 pItemslot = pItem->GetSlot(); if (pItemslot >= CURRENCYTOKEN_SLOT_START && pItemslot < CURRENCYTOKEN_SLOT_END) { sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to move token [guid: %u, entry: %u] out of the currency bag!", - GetName(), GetGUIDLow(), item->GetGUIDLow(), pProto->ItemId); + GetName(), GetGUIDLow(), pItem->GetGUIDLow(), pProto->ItemId); return EQUIP_ERR_ITEMS_CANT_BE_SWAPPED; } // check count of items (skip for auto move for same player from bank) - InventoryResult res = CanTakeMoreSimilarItems(item); + InventoryResult res = CanTakeMoreSimilarItems(pItem); if (res != EQUIP_ERR_OK) return res; @@ -11580,18 +11580,18 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { if (slot >= BANK_SLOT_BAG_START && slot < BANK_SLOT_BAG_END) { - if (!item->IsBag()) + if (!pItem->IsBag()) return EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT; if (slot - BANK_SLOT_BAG_START >= GetBankBagSlotCount()) return EQUIP_ERR_MUST_PURCHASE_THAT_BAG_SLOT; - res = CanUseItem(item, not_loading); + res = CanUseItem(pItem, not_loading); if (res != EQUIP_ERR_OK) return res; } - res = CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, item); + res = CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, pItem); if (res != EQUIP_ERR_OK) return res; @@ -11604,7 +11604,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest // in specific bag if (bag != NULL_BAG) { - if (item->IsNotEmptyBag()) + if (pItem->IsNotEmptyBag()) return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG; // search stack in bag for merge to @@ -11612,7 +11612,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { if (bag == INVENTORY_SLOT_BAG_0) { - res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, item, bag, slot); + res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11621,9 +11621,9 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest } else { - res = CanStoreItem_InBag(bag, dest, pProto, count, true, false, item, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, true, false, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = CanStoreItem_InBag(bag, dest, pProto, count, true, true, item, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, true, true, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) return res; @@ -11636,7 +11636,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest // search free slot in bag if (bag == INVENTORY_SLOT_BAG_0) { - res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, item, bag, slot); + res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11645,9 +11645,9 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest } else { - res = CanStoreItem_InBag(bag, dest, pProto, count, false, false, item, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, false, false, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = CanStoreItem_InBag(bag, dest, pProto, count, false, true, item, NULL_BAG, slot); + res = CanStoreItem_InBag(bag, dest, pProto, count, false, true, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) return res; @@ -11663,7 +11663,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest if (pProto->Stackable != 1) { // in slots - res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, item, bag, slot); + res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11675,7 +11675,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, true, false, item, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, true, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11686,7 +11686,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, true, true, item, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, true, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11700,7 +11700,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, false, false, item, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, false, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11710,7 +11710,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest } // search free space - res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, item, bag, slot); + res = CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11719,7 +11719,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = CanStoreItem_InBag(i, dest, pProto, count, false, true, item, bag, slot); + res = CanStoreItem_InBag(i, dest, pProto, count, false, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11729,11 +11729,11 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest return EQUIP_ERR_BANK_FULL; } -InventoryResult Player::CanUseItem(Item* item, bool not_loading) const +InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const { - if (item) + if (pItem) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", item->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", pItem->GetEntry()); if (!isAlive() && not_loading) return EQUIP_ERR_YOU_ARE_DEAD; @@ -11741,20 +11741,20 @@ InventoryResult Player::CanUseItem(Item* item, bool not_loading) const //if (isStunned()) // return EQUIP_ERR_YOU_ARE_STUNNED; - ItemTemplate const* pProto = item->GetTemplate(); + ItemTemplate const* pProto = pItem->GetTemplate(); if (pProto) { - if (item->IsBindedNotWith(this)) + if (pItem->IsBindedNotWith(this)) return EQUIP_ERR_DONT_OWN_THAT_ITEM; InventoryResult res = CanUseItem(pProto); if (res != EQUIP_ERR_OK) return res; - if (item->GetSkill() != 0) + if (pItem->GetSkill() != 0) { bool allowEquip = false; - uint32 itemSkill = item->GetSkill(); + uint32 itemSkill = pItem->GetSkill(); // 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)) { @@ -11985,33 +11985,33 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update return StoreNewItem(dest, item, update, randomPropertyId, allowedLooters); } -// Return stored item (if stored to stack, it can diff. from item). And item ca be deleted in this case. +// Return stored item (if stored to stack, it can diff. from pItem). And pItem ca be deleted in this case. Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update, int32 randomPropertyId, AllowedLooterSet& allowedLooters) { uint32 count = 0; for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr) count += itr->count; - Item* item = Item::CreateItem(item, count, this); - if (item) + Item* pItem = Item::CreateItem(item, count, this); + if (pItem) { ItemAddedQuestCheck(item, count); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, count); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, item, 1); if (randomPropertyId) - item->SetItemRandomProperties(randomPropertyId); - item = StoreItem(dest, item, update); + pItem->SetItemRandomProperties(randomPropertyId); + pItem = StoreItem(dest, pItem, update); - const ItemTemplate* proto = item->GetTemplate(); + 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, item); + CastSpell(this, proto->Spells[i].SpellId, true, pItem); - if (allowedLooters.size() > 1 && item->GetTemplate()->GetMaxStackSize() == 1 && item->IsSoulBound()) + if (allowedLooters.size() > 1 && pItem->GetTemplate()->GetMaxStackSize() == 1 && pItem->IsSoulBound()) { - item->SetSoulboundTradeable(allowedLooters); - item->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, GetTotalPlayedTime()); - AddTradeableItem(item); + pItem->SetSoulboundTradeable(allowedLooters); + pItem->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, GetTotalPlayedTime()); + AddTradeableItem(pItem); // save data std::ostringstream ss; @@ -12021,20 +12021,20 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update ss << ' ' << *itr; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_BOP_TRADE); - stmt->setUInt32(0, item->GetGUIDLow()); + stmt->setUInt32(0, pItem->GetGUIDLow()); stmt->setString(1, ss.str()); CharacterDatabase.Execute(stmt); } } - return item; + return pItem; } -Item* Player::StoreItem(ItemPosCountVec const& dest, Item* item, bool update) +Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update) { - if (!item) + if (!pItem) return NULL; - Item* lastItem = item; + Item* lastItem = pItem; for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end();) { uint16 pos = itr->pos; @@ -12044,75 +12044,75 @@ Item* Player::StoreItem(ItemPosCountVec const& dest, Item* item, bool update) if (itr == dest.end()) { - lastItem = _StoreItem(pos, item, count, false, update); + lastItem = _StoreItem(pos, pItem, count, false, update); break; } - lastItem = _StoreItem(pos, item, count, true, update); + lastItem = _StoreItem(pos, pItem, count, true, update); } return lastItem; } -// Return stored item (if stored to stack, it can diff. from item). And item ca be deleted in this case. -Item* Player::_StoreItem(uint16 pos, Item* item, uint32 count, bool clone, bool update) +// Return stored item (if stored to stack, it can diff. from pItem). And pItem ca be deleted in this case. +Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool update) { - if (!item) + if (!pItem) return NULL; 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, item->GetEntry(), count, item->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); if (!pItem2) { if (clone) - item = item->CloneItem(count, this); + pItem = pItem->CloneItem(count, this); else - item->SetCount(count); + pItem->SetCount(count); - if (!item) + if (!pItem) return NULL; - if (item->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || - item->GetTemplate()->Bonding == BIND_QUEST_ITEM || - (item->GetTemplate()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos))) - item->SetBinding(true); + if (pItem->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || + pItem->GetTemplate()->Bonding == BIND_QUEST_ITEM || + (pItem->GetTemplate()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos))) + pItem->SetBinding(true); Bag* pBag = (bag == INVENTORY_SLOT_BAG_0) ? NULL : GetBagByPos(bag); if (!pBag) { - m_items[slot] = item; - SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), item->GetGUID()); - item->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); - item->SetUInt64Value(ITEM_FIELD_OWNER, GetGUID()); + m_items[slot] = pItem; + SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), pItem->GetGUID()); + pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); + pItem->SetUInt64Value(ITEM_FIELD_OWNER, GetGUID()); - item->SetSlot(slot); - item->SetContainer(NULL); + pItem->SetSlot(slot); + pItem->SetContainer(NULL); // need update known currency if (slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END) - AddKnownCurrency(item->GetEntry()); + AddKnownCurrency(pItem->GetEntry()); } else - pBag->StoreItem(slot, item, update); + pBag->StoreItem(slot, pItem, update); if (IsInWorld() && update) { - item->AddToWorld(); - item->SendUpdateToPlayer(this); + pItem->AddToWorld(); + pItem->SendUpdateToPlayer(this); } - item->SetState(ITEM_CHANGED, this); + pItem->SetState(ITEM_CHANGED, this); if (pBag) pBag->SetState(ITEM_CHANGED, this); - AddEnchantmentDurations(item); - AddItemDurations(item); + AddEnchantmentDurations(pItem); + AddItemDurations(pItem); - return item; + return pItem; } else { @@ -12130,18 +12130,18 @@ Item* Player::_StoreItem(uint16 pos, Item* item, uint32 count, bool clone, bool // delete item (it not in any slot currently) if (IsInWorld() && update) { - item->RemoveFromWorld(); - item->DestroyForPlayer(this); + pItem->RemoveFromWorld(); + pItem->DestroyForPlayer(this); } - RemoveEnchantmentDurations(item); - RemoveItemDurations(item); + RemoveEnchantmentDurations(pItem); + RemoveItemDurations(pItem); - item->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor - item->SetNotRefundable(this); - item->ClearSoulboundTradeable(this); - RemoveTradeableItem(item); - item->SetState(ITEM_REMOVED, this); + pItem->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor + pItem->SetNotRefundable(this); + pItem->ClearSoulboundTradeable(this); + RemoveTradeableItem(pItem); + pItem->SetState(ITEM_REMOVED, this); } AddEnchantmentDurations(pItem2); @@ -12154,20 +12154,20 @@ Item* Player::_StoreItem(uint16 pos, Item* item, uint32 count, bool clone, bool Item* Player::EquipNewItem(uint16 pos, uint32 item, bool update) { - if (Item* item = Item::CreateItem(item, 1, this)) + if (Item* pItem = Item::CreateItem(item, 1, this)) { ItemAddedQuestCheck(item, 1); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, 1); - return EquipItem(pos, item, update); + return EquipItem(pos, pItem, update); } return NULL; } -Item* Player::EquipItem(uint16 pos, Item* item, bool update) +Item* Player::EquipItem(uint16 pos, Item* pItem, bool update) { - AddEnchantmentDurations(item); - AddItemDurations(item); + AddEnchantmentDurations(pItem); + AddItemDurations(pItem); uint8 bag = pos >> 8; uint8 slot = pos & 255; @@ -12176,17 +12176,17 @@ Item* Player::EquipItem(uint16 pos, Item* item, bool update) if (!pItem2) { - VisualizeItem(slot, item); + VisualizeItem(slot, pItem); if (isAlive()) { - ItemTemplate const* pProto = item->GetTemplate(); + ItemTemplate const* pProto = pItem->GetTemplate(); // item set bonuses applied only at equip and removed at unequip, and still active for broken items if (pProto && pProto->ItemSet) - AddItemsSetItem(this, item); + AddItemsSetItem(this, pItem); - _ApplyItemMods(item, slot, true); + _ApplyItemMods(pItem, slot, true); if (pProto && isInCombat() && (pProto->Class == ITEM_CLASS_WEAPON || pProto->InventoryType == INVTYPE_RELIC) && m_weaponChangeTimer == 0) { @@ -12213,11 +12213,11 @@ Item* Player::EquipItem(uint16 pos, Item* item, bool update) if (IsInWorld() && update) { - item->AddToWorld(); - item->SendUpdateToPlayer(this); + pItem->AddToWorld(); + pItem->SendUpdateToPlayer(this); } - ApplyEquipCooldown(item); + ApplyEquipCooldown(pItem); // update expertise and armor penetration - passive auras may need it @@ -12239,26 +12239,26 @@ Item* Player::EquipItem(uint16 pos, Item* item, bool update) } else { - pItem2->SetCount(pItem2->GetCount() + item->GetCount()); + pItem2->SetCount(pItem2->GetCount() + pItem->GetCount()); if (IsInWorld() && update) pItem2->SendUpdateToPlayer(this); // delete item (it not in any slot currently) - //item->DeleteFromDB(); + //pItem->DeleteFromDB(); if (IsInWorld() && update) { - item->RemoveFromWorld(); - item->DestroyForPlayer(this); + pItem->RemoveFromWorld(); + pItem->DestroyForPlayer(this); } - RemoveEnchantmentDurations(item); - RemoveItemDurations(item); + RemoveEnchantmentDurations(pItem); + RemoveItemDurations(pItem); - item->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor - item->SetNotRefundable(this); - item->ClearSoulboundTradeable(this); - RemoveTradeableItem(item); - item->SetState(ITEM_REMOVED, this); + pItem->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor + pItem->SetNotRefundable(this); + pItem->ClearSoulboundTradeable(this); + RemoveTradeableItem(pItem); + pItem->SetState(ITEM_REMOVED, this); pItem2->SetState(ITEM_CHANGED, this); ApplyEquipCooldown(pItem2); @@ -12267,40 +12267,40 @@ Item* Player::EquipItem(uint16 pos, Item* item, bool update) } // only for full equip instead adding to stack - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, item->GetEntry()); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, item->GetEntry(), slot); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry()); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot); - return item; + return pItem; } -void Player::QuickEquipItem(uint16 pos, Item* item) +void Player::QuickEquipItem(uint16 pos, Item* pItem) { - if (item) + if (pItem) { - AddEnchantmentDurations(item); - AddItemDurations(item); + AddEnchantmentDurations(pItem); + AddItemDurations(pItem); uint8 slot = pos & 255; - VisualizeItem(slot, item); + VisualizeItem(slot, pItem); if (IsInWorld()) { - item->AddToWorld(); - item->SendUpdateToPlayer(this); + pItem->AddToWorld(); + pItem->SendUpdateToPlayer(this); } - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, item->GetEntry()); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, item->GetEntry(), slot); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry()); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot); } } -void Player::SetVisibleItemSlot(uint8 slot, Item* item) +void Player::SetVisibleItemSlot(uint8 slot, Item* pItem) { - if (item) + if (pItem) { - SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), item->GetEntry()); - SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 0, item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT)); - SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 1, item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT)); + SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), pItem->GetEntry()); + 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)); } else { @@ -12309,28 +12309,28 @@ void Player::SetVisibleItemSlot(uint8 slot, Item* item) } } -void Player::VisualizeItem(uint8 slot, Item* item) +void Player::VisualizeItem(uint8 slot, Item* pItem) { - if (!item) + if (!pItem) return; // check also BIND_WHEN_PICKED_UP and BIND_QUEST_ITEM for .additem or .additemset case by GM (not binded at adding to inventory) - if (item->GetTemplate()->Bonding == BIND_WHEN_EQUIPED || item->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || item->GetTemplate()->Bonding == BIND_QUEST_ITEM) - item->SetBinding(true); + 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, item->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry()); - m_items[slot] = item; - SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), item->GetGUID()); - item->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); - item->SetUInt64Value(ITEM_FIELD_OWNER, GetGUID()); - item->SetSlot(slot); - item->SetContainer(NULL); + m_items[slot] = pItem; + SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), pItem->GetGUID()); + pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID()); + pItem->SetUInt64Value(ITEM_FIELD_OWNER, GetGUID()); + pItem->SetSlot(slot); + pItem->SetContainer(NULL); if (slot < EQUIPMENT_SLOT_END) - SetVisibleItemSlot(slot, item); + SetVisibleItemSlot(slot, pItem); - item->SetState(ITEM_CHANGED, this); + pItem->SetState(ITEM_CHANGED, this); } void Player::RemoveItem(uint8 bag, uint8 slot, bool update) @@ -12340,44 +12340,44 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) // note2: if removeitem is to be used for delinking // the item must be removed from the player's updatequeue - Item* item = GetItemByPos(bag, slot); - if (item) + Item* pItem = GetItemByPos(bag, slot); + if (pItem) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, item->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); - RemoveEnchantmentDurations(item); - RemoveItemDurations(item); - RemoveTradeableItem(item); + RemoveEnchantmentDurations(pItem); + RemoveItemDurations(pItem); + RemoveTradeableItem(pItem); if (bag == INVENTORY_SLOT_BAG_0) { if (slot < INVENTORY_SLOT_BAG_END) { - ItemTemplate const* pProto = item->GetTemplate(); + ItemTemplate const* pProto = pItem->GetTemplate(); // item set bonuses applied only at equip and removed at unequip, and still active for broken items if (pProto && pProto->ItemSet) RemoveItemsSetItem(this, pProto); - _ApplyItemMods(item, slot, false); + _ApplyItemMods(pItem, slot, false); // remove item dependent auras and casts (only weapon and armor slots) if (slot < EQUIPMENT_SLOT_END) { - RemoveItemDependentAurasAndCasts(item); + RemoveItemDependentAurasAndCasts(pItem); // remove held enchantments, update expertise if (slot == EQUIPMENT_SLOT_MAINHAND) { - if (item->GetItemSuffixFactor()) + if (pItem->GetItemSuffixFactor()) { - item->ClearEnchantment(PROP_ENCHANTMENT_SLOT_3); - item->ClearEnchantment(PROP_ENCHANTMENT_SLOT_4); + pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_3); + pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_4); } else { - item->ClearEnchantment(PROP_ENCHANTMENT_SLOT_0); - item->ClearEnchantment(PROP_ENCHANTMENT_SLOT_1); + pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_0); + pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_1); } UpdateExpertise(BASE_ATTACK); @@ -12406,11 +12406,11 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) else if (Bag* pBag = GetBagByPos(bag)) pBag->RemoveItem(slot, update); - item->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); - // item->SetUInt64Value(ITEM_FIELD_OWNER, 0); not clear owner at remove (it will be set at store). This used in mail and auction code - item->SetSlot(NULL_SLOT); + pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); + // pItem->SetUInt64Value(ITEM_FIELD_OWNER, 0); not clear owner at remove (it will be set at store). This used in mail and auction code + pItem->SetSlot(NULL_SLOT); if (IsInWorld() && update) - item->SendUpdateToPlayer(this); + pItem->SendUpdateToPlayer(this); } } @@ -12432,17 +12432,17 @@ void Player::MoveItemFromInventory(uint8 bag, uint8 slot, bool update) } // Common operation need to add item from inventory without delete in trade, guild bank, mail.... -void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* item, bool update, bool in_characterInventoryDB) +void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool update, bool in_characterInventoryDB) { // update quest counters - ItemAddedQuestCheck(item->GetEntry(), item->GetCount()); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item->GetEntry(), item->GetCount()); + ItemAddedQuestCheck(pItem->GetEntry(), pItem->GetCount()); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, pItem->GetEntry(), pItem->GetCount()); // store item - Item* pLastItem = StoreItem(dest, item, update); + Item* pLastItem = StoreItem(dest, pItem, update); - // only set if not merged to existed stack (item can be deleted already but we can compare pointers any way) - if (pLastItem == item) + // only set if not merged to existed stack (pItem can be deleted already but we can compare pointers any way) + if (pLastItem == pItem) { // update owner for last item (this can be original item with wrong owner if (pLastItem->GetOwnerGUID() != GetGUID()) @@ -12459,38 +12459,38 @@ void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* item, bool u void Player::DestroyItem(uint8 bag, uint8 slot, bool update) { - Item* item = GetItemByPos(bag, slot); - if (item) + Item* pItem = GetItemByPos(bag, slot); + if (pItem) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, item->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 (item->IsNotEmptyBag()) + if (pItem->IsNotEmptyBag()) for (uint8 i = 0; i < MAX_BAG_SIZE; ++i) DestroyItem(slot, i, update); - if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) + if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT); - stmt->setUInt32(0, item->GetGUIDLow()); + stmt->setUInt32(0, pItem->GetGUIDLow()); CharacterDatabase.Execute(stmt); } - RemoveEnchantmentDurations(item); - RemoveItemDurations(item); + RemoveEnchantmentDurations(pItem); + RemoveItemDurations(pItem); - item->SetNotRefundable(this); - item->ClearSoulboundTradeable(this); - RemoveTradeableItem(item); + pItem->SetNotRefundable(this); + pItem->ClearSoulboundTradeable(this); + RemoveTradeableItem(pItem); - const ItemTemplate* proto = item->GetTemplate(); + 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 RemoveAurasDueToSpell(proto->Spells[i].SpellId); - ItemRemovedQuestCheck(item->GetEntry(), item->GetCount()); + ItemRemovedQuestCheck(pItem->GetEntry(), pItem->GetCount()); if (bag == INVENTORY_SLOT_BAG_0) { @@ -12499,19 +12499,19 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) // equipment and equipped bags can have applied bonuses if (slot < INVENTORY_SLOT_BAG_END) { - ItemTemplate const* pProto = item->GetTemplate(); + ItemTemplate const* pProto = pItem->GetTemplate(); // item set bonuses applied only at equip and removed at unequip, and still active for broken items if (pProto && pProto->ItemSet) RemoveItemsSetItem(this, pProto); - _ApplyItemMods(item, slot, false); + _ApplyItemMods(pItem, slot, false); } if (slot < EQUIPMENT_SLOT_END) { // remove item dependent auras and casts (only weapon and armor slots) - RemoveItemDependentAurasAndCasts(item); + RemoveItemDependentAurasAndCasts(pItem); // update expertise and armor penetration - passive auras may need it switch (slot) @@ -12540,14 +12540,14 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) if (IsInWorld() && update) { - item->RemoveFromWorld(); - item->DestroyForPlayer(this); + pItem->RemoveFromWorld(); + pItem->DestroyForPlayer(this); } - //item->SetOwnerGUID(0); - item->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); - item->SetSlot(NULL_SLOT); - item->SetState(ITEM_REMOVED, this); + //pItem->SetOwnerGUID(0); + pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); + pItem->SetSlot(NULL_SLOT); + pItem->SetState(ITEM_REMOVED, this); } } @@ -12559,14 +12559,14 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) { - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { - if (item->GetEntry() == item && !item->IsInTrade()) + if (pItem->GetEntry() == item && !pItem->IsInTrade()) { - if (item->GetCount() + remcount <= count) + if (pItem->GetCount() + remcount <= count) { // all items in inventory can unequipped - remcount += item->GetCount(); + remcount += pItem->GetCount(); DestroyItem(INVENTORY_SLOT_BAG_0, i, update); if (remcount >= count) @@ -12574,11 +12574,11 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ } else { - ItemRemovedQuestCheck(item->GetEntry(), count - remcount); - item->SetCount(item->GetCount() - count + remcount); + ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); + pItem->SetCount(pItem->GetCount() - count + remcount); if (IsInWorld() & update) - item->SendUpdateToPlayer(this); - item->SetState(ITEM_CHANGED, this); + pItem->SendUpdateToPlayer(this); + pItem->SetState(ITEM_CHANGED, this); return; } } @@ -12587,14 +12587,14 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) { - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { - if (item->GetEntry() == item && !item->IsInTrade()) + if (pItem->GetEntry() == item && !pItem->IsInTrade()) { - if (item->GetCount() + remcount <= count) + if (pItem->GetCount() + remcount <= count) { // all keys can be unequipped - remcount += item->GetCount(); + remcount += pItem->GetCount(); DestroyItem(INVENTORY_SLOT_BAG_0, i, update); if (remcount >= count) @@ -12602,11 +12602,11 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ } else { - ItemRemovedQuestCheck(item->GetEntry(), count - remcount); - item->SetCount(item->GetCount() - count + remcount); + ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); + pItem->SetCount(pItem->GetCount() - count + remcount); if (IsInWorld() & update) - item->SendUpdateToPlayer(this); - item->SetState(ITEM_CHANGED, this); + pItem->SendUpdateToPlayer(this); + pItem->SetState(ITEM_CHANGED, this); return; } } @@ -12620,14 +12620,14 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ { for (uint32 j = 0; j < pBag->GetBagSize(); j++) { - if (Item* item = pBag->GetItemByPos(j)) + if (Item* pItem = pBag->GetItemByPos(j)) { - if (item->GetEntry() == item && !item->IsInTrade()) + if (pItem->GetEntry() == item && !pItem->IsInTrade()) { // all items in bags can be unequipped - if (item->GetCount() + remcount <= count) + if (pItem->GetCount() + remcount <= count) { - remcount += item->GetCount(); + remcount += pItem->GetCount(); DestroyItem(i, j, update); if (remcount >= count) @@ -12635,11 +12635,11 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ } else { - ItemRemovedQuestCheck(item->GetEntry(), count - remcount); - item->SetCount(item->GetCount() - count + remcount); + ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); + pItem->SetCount(pItem->GetCount() - count + remcount); if (IsInWorld() && update) - item->SendUpdateToPlayer(this); - item->SetState(ITEM_CHANGED, this); + pItem->SendUpdateToPlayer(this); + pItem->SetState(ITEM_CHANGED, this); return; } } @@ -12651,15 +12651,15 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ // in equipment and bag list for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++) { - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { - if (item && item->GetEntry() == item && !item->IsInTrade()) + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { - if (item->GetCount() + remcount <= count) + if (pItem->GetCount() + remcount <= count) { if (!unequip_check || CanUnequipItem(INVENTORY_SLOT_BAG_0 << 8 | i, false) == EQUIP_ERR_OK) { - remcount += item->GetCount(); + remcount += pItem->GetCount(); DestroyItem(INVENTORY_SLOT_BAG_0, i, update); if (remcount >= count) @@ -12668,11 +12668,11 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ } else { - ItemRemovedQuestCheck(item->GetEntry(), count - remcount); - item->SetCount(item->GetCount() - count + remcount); + ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); + pItem->SetCount(pItem->GetCount() - count + remcount); if (IsInWorld() & update) - item->SendUpdateToPlayer(this); - item->SetState(ITEM_CHANGED, this); + pItem->SendUpdateToPlayer(this); + pItem->SetState(ITEM_CHANGED, this); return; } } @@ -12686,27 +12686,27 @@ void Player::DestroyZoneLimitedItem(bool update, uint32 new_zone) // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + 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* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) + 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)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) - if (Item* item = pBag->GetItemByPos(j)) - if (item->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) + if (Item* pItem = pBag->GetItemByPos(j)) + if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) DestroyItem(i, j, update); // in equipment and bag list for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) DestroyItem(INVENTORY_SLOT_BAG_0, i, update); } @@ -12718,22 +12718,22 @@ void Player::DestroyConjuredItems(bool update) // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->IsConjuredConsumable()) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->IsConjuredConsumable()) 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)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) - if (Item* item = pBag->GetItemByPos(j)) - if (item->IsConjuredConsumable()) + if (Item* pItem = pBag->GetItemByPos(j)) + if (pItem->IsConjuredConsumable()) DestroyItem(i, j, update); // in equipment and bag list for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->IsConjuredConsumable()) + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->IsConjuredConsumable()) DestroyItem(INVENTORY_SLOT_BAG_0, i, update); } @@ -12741,46 +12741,46 @@ Item* Player::GetItemByEntry(uint32 entry) const { // in inventory for (int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetEntry() == entry) - return item; + 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) - if (Item* item = pBag->GetItemByPos(j)) - if (item->GetEntry() == entry) - return item; + if (Item* pItem = pBag->GetItemByPos(j)) + if (pItem->GetEntry() == entry) + return pItem; for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetEntry() == entry) - return item; + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetEntry() == entry) + return pItem; return NULL; } -void Player::DestroyItemCount(Item* item, uint32 &count, bool update) +void Player::DestroyItemCount(Item* pItem, uint32 &count, bool update) { - if (!item) + if (!pItem) return; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", item->GetGUIDLow(), item->GetEntry(), count); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->GetGUIDLow(), pItem->GetEntry(), count); - if (item->GetCount() <= count) + if (pItem->GetCount() <= count) { - count -= item->GetCount(); + count -= pItem->GetCount(); - DestroyItem(item->GetBagSlot(), item->GetSlot(), update); + DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), update); } else { - ItemRemovedQuestCheck(item->GetEntry(), count); - item->SetCount(item->GetCount() - count); + ItemRemovedQuestCheck(pItem->GetEntry(), count); + pItem->SetCount(pItem->GetCount() - count); count = 0; if (IsInWorld() & update) - item->SendUpdateToPlayer(this); - item->SetState(ITEM_CHANGED, this); + pItem->SendUpdateToPlayer(this); + pItem->SetState(ITEM_CHANGED, this); } } @@ -13255,9 +13255,9 @@ void Player::SwapItem(uint16 src, uint16 dst) AutoUnequipOffhandIfNeed(); } -void Player::AddItemToBuyBackSlot(Item* item) +void Player::AddItemToBuyBackSlot(Item* pItem) { - if (item) + if (pItem) { uint32 slot = m_currentBuybackSlot; // if current back slot non-empty search oldest or free @@ -13289,16 +13289,16 @@ void Player::AddItemToBuyBackSlot(Item* item) } RemoveItemFromBuyBackSlot(slot, true); - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", item->GetEntry(), slot); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->GetEntry(), slot); - m_items[slot] = item; + m_items[slot] = pItem; time_t base = time(NULL); uint32 etime = uint32(base - m_logintime + (30 * 3600)); uint32 eslot = slot - BUYBACK_SLOT_START; - SetUInt64Value(PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), item->GetGUID()); - if (ItemTemplate const* proto = item->GetTemplate()) - SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, proto->SellPrice * item->GetCount()); + SetUInt64Value(PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), pItem->GetGUID()); + 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); @@ -13322,12 +13322,12 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot); if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) { - Item* item = m_items[slot]; - if (item) + Item* pItem = m_items[slot]; + if (pItem) { - item->RemoveFromWorld(); + pItem->RemoveFromWorld(); if (del) - item->SetState(ITEM_REMOVED, this); + pItem->SetState(ITEM_REMOVED, this); } m_items[slot] = NULL; @@ -13343,7 +13343,7 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) } } -void Player::SendEquipError(InventoryResult msg, Item* item, Item* pItem2, uint32 itemid) +void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint32 itemid) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg); WorldPacket data(SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : 18)); @@ -13351,7 +13351,7 @@ void Player::SendEquipError(InventoryResult msg, Item* item, Item* pItem2, uint3 if (msg != EQUIP_ERR_OK) { - data << uint64(item ? item->GetGUID() : 0); + data << uint64(pItem ? pItem->GetGUID() : 0); data << uint64(pItem2 ? pItem2->GetGUID() : 0); data << uint8(0); // bag type subclass, used with EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM and EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2 @@ -13360,7 +13360,7 @@ void Player::SendEquipError(InventoryResult msg, Item* item, Item* pItem2, uint3 case EQUIP_ERR_CANT_EQUIP_LEVEL_I: case EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW: { - ItemTemplate const* proto = item ? item->GetTemplate() : sObjectMgr->GetItemTemplate(itemid); + ItemTemplate const* proto = pItem ? pItem->GetTemplate() : sObjectMgr->GetItemTemplate(itemid); data << uint32(proto ? proto->RequiredLevel : 0); break; } @@ -13375,7 +13375,7 @@ void Player::SendEquipError(InventoryResult msg, Item* item, Item* pItem2, uint3 case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED: case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED: { - ItemTemplate const* proto = item ? item->GetTemplate() : sObjectMgr->GetItemTemplate(itemid); + ItemTemplate const* proto = pItem ? pItem->GetTemplate() : sObjectMgr->GetItemTemplate(itemid); data << uint32(proto ? proto->ItemLimitCategory : 0); break; } @@ -13565,17 +13565,17 @@ void Player::RemoveArenaEnchantments(EnchantmentSlot slot) // NOTE: no need to remove these from stats, since these aren't equipped // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) - if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (item->GetEnchantmentId(slot)) - item->ClearEnchantment(slot); + if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetEnchantmentId(slot)) + pItem->ClearEnchantment(slot); // in inventory bags 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++) - if (Item* item = pBag->GetItemByPos(j)) - if (item->GetEnchantmentId(slot)) - item->ClearEnchantment(slot); + if (Item* pItem = pBag->GetItemByPos(j)) + if (pItem->GetEnchantmentId(slot)) + pItem->ClearEnchantment(slot); } // duration == 0 will remove item enchant @@ -21217,14 +21217,14 @@ void Player::CorrectMetaGemEnchants(uint8 exceptslot, bool apply) if (slot == exceptslot) continue; - Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); - if (!item || !item->GetTemplate()->Socket[0].Color) + if (!pItem || !pItem->GetTemplate()->Socket[0].Color) continue; for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot) { - uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(enchant_slot)); + uint32 enchant_id = pItem->GetEnchantmentId(EnchantmentSlot(enchant_slot)); if (!enchant_id) continue; @@ -21242,7 +21242,7 @@ void Player::CorrectMetaGemEnchants(uint8 exceptslot, bool apply) { // ignore item gem conditions //if state changed, (dis)apply enchant - ApplyEnchantment(item, EnchantmentSlot(enchant_slot), !wasactive, true, true); + ApplyEnchantment(pItem, EnchantmentSlot(enchant_slot), !wasactive, true, true); } } } @@ -21259,15 +21259,15 @@ void Player::ToggleMetaGemsActive(uint8 exceptslot, bool apply) if (slot == exceptslot) continue; - Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); - if (!item || !item->GetTemplate()->Socket[0].Color) //if item has no sockets or no item is equipped go to next item + if (!pItem || !pItem->GetTemplate()->Socket[0].Color) //if item has no sockets or no item is equipped go to next item continue; //cycle all (gem)enchants for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot) { - uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(enchant_slot)); + uint32 enchant_id = pItem->GetEnchantmentId(EnchantmentSlot(enchant_slot)); if (!enchant_id) //if no enchant go to next enchant(slot) continue; @@ -21278,7 +21278,7 @@ void Player::ToggleMetaGemsActive(uint8 exceptslot, bool apply) //only metagems to be (de)activated, so only enchants with condition uint32 condition = enchantEntry->EnchantmentCondition; if (condition) - ApplyEnchantment(item, EnchantmentSlot(enchant_slot), apply); + ApplyEnchantment(pItem, EnchantmentSlot(enchant_slot), apply); } } } @@ -21940,14 +21940,14 @@ void Player::SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint3 GetSession()->SendPacket(&data); } -void Player::ApplyEquipCooldown(Item* item) +void Player::ApplyEquipCooldown(Item* pItem) { - if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_PROTO_FLAG_NO_EQUIP_COOLDOWN)) + if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_PROTO_FLAG_NO_EQUIP_COOLDOWN)) return; for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) { - _Spell const& spellData = item->GetTemplate()->Spells[i]; + _Spell const& spellData = pItem->GetTemplate()->Spells[i]; // no spell if (!spellData.SpellId) @@ -21957,10 +21957,10 @@ void Player::ApplyEquipCooldown(Item* item) if (spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_USE) continue; - AddSpellCooldown(spellData.SpellId, item->GetEntry(), time(NULL) + 30); + AddSpellCooldown(spellData.SpellId, pItem->GetEntry(), time(NULL) + 30); WorldPacket data(SMSG_ITEM_COOLDOWN, 12); - data << item->GetGUID(); + data << pItem->GetGUID(); data << uint32(spellData.SpellId); GetSession()->SendPacket(&data); } @@ -22574,7 +22574,7 @@ bool Player::CanNoReagentCast(SpellInfo const* spellInfo) const return false; } -void Player::RemoveItemDependentAurasAndCasts(Item* item) +void Player::RemoveItemDependentAurasAndCasts(Item* pItem) { for (AuraMap::iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end();) { @@ -22589,7 +22589,7 @@ void Player::RemoveItemDependentAurasAndCasts(Item* item) } // skip if not item dependent or have alternative item - if (HasItemFitToSpellRequirements(spellInfo, item)) + if (HasItemFitToSpellRequirements(spellInfo, pItem)) { ++itr; continue; @@ -22602,7 +22602,7 @@ void Player::RemoveItemDependentAurasAndCasts(Item* item) // currently casted spells can be dependent from item for (uint32 i = 0; i < CURRENT_MAX_SPELL; ++i) if (Spell* spell = GetCurrentSpell(CurrentSpellTypes(i))) - if (spell->getState() != SPELL_STATE_DELAYED && !HasItemFitToSpellRequirements(spell->m_spellInfo, item)) + if (spell->getState() != SPELL_STATE_DELAYED && !HasItemFitToSpellRequirements(spell->m_spellInfo, pItem)) InterruptSpell(CurrentSpellTypes(i)); } @@ -23548,8 +23548,8 @@ void Player::AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore cons continue; } - Item* item = StoreNewItem(dest, lootItem->itemid, true, lootItem->randomPropertyId); - SendNewItem(item, lootItem->count, false, false, broadcast); + Item* pItem = StoreNewItem(dest, lootItem->itemid, true, lootItem->randomPropertyId); + SendNewItem(pItem, lootItem->count, false, false, broadcast); } } @@ -23780,9 +23780,9 @@ uint32 Player::GetPhaseMaskForSpawn() const return PHASEMASK_NORMAL; } -InventoryResult Player::CanEquipUniqueItem(Item* item, uint8 eslot, uint32 limit_count) const +InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limit_count) const { - ItemTemplate const* pProto = item->GetTemplate(); + ItemTemplate const* pProto = pItem->GetTemplate(); // proto based limitations if (InventoryResult res = CanEquipUniqueItem(pProto, eslot, limit_count)) @@ -23791,7 +23791,7 @@ InventoryResult Player::CanEquipUniqueItem(Item* item, uint8 eslot, uint32 limit // check unique-equipped on gems for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot) { - uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(enchant_slot)); + uint32 enchant_id = pItem->GetEnchantmentId(EnchantmentSlot(enchant_slot)); if (!enchant_id) continue; SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id); @@ -23803,8 +23803,8 @@ InventoryResult Player::CanEquipUniqueItem(Item* item, uint8 eslot, uint32 limit continue; // include for check equip another gems with same limit category for not equipped item (and then not counted) - uint32 gem_limit_count = !item->IsEquipped() && pGem->ItemLimitCategory - ? item->GetGemCountWithLimitCategory(pGem->ItemLimitCategory) : 1; + uint32 gem_limit_count = !pItem->IsEquipped() && pGem->ItemLimitCategory + ? pItem->GetGemCountWithLimitCategory(pGem->ItemLimitCategory) : 1; if (InventoryResult res = CanEquipUniqueItem(pGem, eslot, gem_limit_count)) return res; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 0ee2743e319..7f6b2322e93 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1233,70 +1233,70 @@ class Player : public Unit, public GridObject bool CanNoReagentCast(SpellInfo const* spellInfo) const; bool HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_slot = NULL_SLOT) const; bool HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot = NULL_SLOT) const; - InventoryResult CanTakeMoreSimilarItems(Item* item) const { return CanTakeMoreSimilarItems(item->GetEntry(), item->GetCount(), item); } + InventoryResult CanTakeMoreSimilarItems(Item* pItem) const { return CanTakeMoreSimilarItems(pItem->GetEntry(), pItem->GetCount(), pItem); } InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count) const { return CanTakeMoreSimilarItems(entry, count, NULL); } InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = NULL) const { return CanStoreItem(bag, slot, dest, item, count, NULL, false, no_space_count); } - InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* item, bool swap = false) const + InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* pItem, bool swap = false) const { - if (!item) + if (!pItem) return EQUIP_ERR_ITEM_NOT_FOUND; - uint32 count = item->GetCount(); - return CanStoreItem(bag, slot, dest, item->GetEntry(), count, item, swap, NULL); + uint32 count = pItem->GetCount(); + return CanStoreItem(bag, slot, dest, pItem->GetEntry(), count, pItem, swap, NULL); } - InventoryResult CanStoreItems(Item** item, int count) const; + InventoryResult CanStoreItems(Item** pItem, int count) const; InventoryResult CanEquipNewItem(uint8 slot, uint16& dest, uint32 item, bool swap) const; - InventoryResult CanEquipItem(uint8 slot, uint16& dest, Item* item, bool swap, bool not_loading = true) const; + InventoryResult CanEquipItem(uint8 slot, uint16& dest, Item* pItem, bool swap, bool not_loading = true) const; - InventoryResult CanEquipUniqueItem(Item* item, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1) const; + InventoryResult CanEquipUniqueItem(Item* pItem, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1) const; InventoryResult CanEquipUniqueItem(ItemTemplate const* itemProto, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1) const; InventoryResult CanUnequipItems(uint32 item, uint32 count) const; InventoryResult CanUnequipItem(uint16 src, bool swap) const; - InventoryResult CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* item, bool swap, bool not_loading = true) const; - InventoryResult CanUseItem(Item* item, bool not_loading = true) const; + InventoryResult CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* pItem, bool swap, bool not_loading = true) const; + InventoryResult CanUseItem(Item* pItem, bool not_loading = true) const; bool HasItemTotemCategory(uint32 TotemCategory) const; - InventoryResult CanUseItem(ItemTemplate const* item) const; + InventoryResult CanUseItem(ItemTemplate const* pItem) const; InventoryResult CanUseAmmo(uint32 item) const; InventoryResult CanRollForItemInLFG(ItemTemplate const* item, WorldObject const* lootedObject) const; Item* StoreNewItem(ItemPosCountVec const& pos, uint32 item, bool update, int32 randomPropertyId = 0); Item* StoreNewItem(ItemPosCountVec const& pos, uint32 item, bool update, int32 randomPropertyId, AllowedLooterSet &allowedLooters); - Item* StoreItem(ItemPosCountVec const& pos, Item* item, bool update); + Item* StoreItem(ItemPosCountVec const& pos, Item* pItem, bool update); Item* EquipNewItem(uint16 pos, uint32 item, bool update); - Item* EquipItem(uint16 pos, Item* item, bool update); + Item* EquipItem(uint16 pos, Item* pItem, bool update); void AutoUnequipOffhandIfNeed(bool force = false); bool StoreNewItemInBestSlots(uint32 item_id, uint32 item_count); void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store, bool broadcast = false); void AutoStoreLoot(uint32 loot_id, LootStore const& store, bool broadcast = false) { AutoStoreLoot(NULL_BAG, NULL_SLOT, loot_id, store, broadcast); } void StoreLootItem(uint8 lootSlot, Loot* loot); - InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* item, uint32* no_space_count = NULL) const; - InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* item = NULL, bool swap = false, uint32* no_space_count = NULL) const; + InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = NULL) const; + InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* pItem = NULL, bool swap = false, uint32* no_space_count = NULL) const; void AddRefundReference(uint32 it); void DeleteRefundReference(uint32 it); - void ApplyEquipCooldown(Item* item); + 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* item); - void VisualizeItem(uint8 slot, Item* item); - void SetVisibleItemSlot(uint8 slot, Item* item); - Item* BankItem(ItemPosCountVec const& dest, Item* item, bool update) + void QuickEquipItem(uint16 pos, Item* pItem); + void VisualizeItem(uint8 slot, Item* pItem); + void SetVisibleItemSlot(uint8 slot, Item* pItem); + Item* BankItem(ItemPosCountVec const& dest, Item* pItem, bool update) { - return StoreItem(dest, item, update); + return StoreItem(dest, pItem, update); } - Item* BankItem(uint16 pos, Item* item, bool update); + Item* BankItem(uint16 pos, Item* pItem, bool update); void RemoveItem(uint8 bag, uint8 slot, bool update); void MoveItemFromInventory(uint8 bag, uint8 slot, bool update); // in trade, auction, guild bank, mail.... - void MoveItemToInventory(ItemPosCountVec const& dest, Item* item, bool update, bool in_characterInventoryDB = false); + void MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool update, bool in_characterInventoryDB = false); // in trade, guild bank, mail.... - void RemoveItemDependentAurasAndCasts(Item* item); + void RemoveItemDependentAurasAndCasts(Item* pItem); void DestroyItem(uint8 bag, uint8 slot, bool update); void DestroyItemCount(uint32 item, uint32 count, bool update, bool unequip_check = false); void DestroyItemCount(Item* item, uint32& count, bool update); @@ -1304,11 +1304,11 @@ class Player : public Unit, public GridObject void DestroyZoneLimitedItem(bool update, uint32 new_zone); void SplitItem(uint16 src, uint16 dst, uint32 count); void SwapItem(uint16 src, uint16 dst); - void AddItemToBuyBackSlot(Item* item); + 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* item, Item* pItem2 = NULL, uint32 itemid = 0); + 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 AddWeaponProficiency(uint32 newflag) { m_WeaponProficiency |= newflag; } @@ -2789,7 +2789,7 @@ class Player : public Unit, public GridObject InventoryResult CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool swap, Item* pSrcItem) const; InventoryResult CanStoreItem_InBag(uint8 bag, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool merge, bool non_specialized, Item* pSrcItem, uint8 skip_bag, uint8 skip_slot) const; InventoryResult CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool merge, Item* pSrcItem, uint8 skip_bag, uint8 skip_slot) const; - Item* _StoreItem(uint16 pos, Item* item, uint32 count, bool clone, bool update); + Item* _StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool update); Item* _LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, Field* fields); std::set m_refundableItems; diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 396e01cb269..9879ef7ff3b 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1927,12 +1927,12 @@ void Group::BroadcastGroupUpdate(void) void Group::ResetMaxEnchantingLevel() { m_maxEnchantingLevel = 0; - Player* member = NULL; + Player* pMember = NULL; for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr) { - member = ObjectAccessor::FindPlayer(citr->guid); - if (member && m_maxEnchantingLevel < member->GetSkillValue(SKILL_ENCHANTING)) - m_maxEnchantingLevel = member->GetSkillValue(SKILL_ENCHANTING); + pMember = ObjectAccessor::FindPlayer(citr->guid); + if (pMember && m_maxEnchantingLevel < pMember->GetSkillValue(SKILL_ENCHANTING)) + m_maxEnchantingLevel = pMember->GetSkillValue(SKILL_ENCHANTING); } } diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 9a453ed8033..f97b907828a 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -348,8 +348,8 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields) return false; } - Item* item = NewItemOrBag(proto); - if (!item->LoadFromDB(itemGuid, 0, fields, itemEntry)) + Item* pItem = NewItemOrBag(proto); + if (!pItem->LoadFromDB(itemGuid, 0, fields, itemEntry)) { sLog->outError("Item (GUID %u, id: %u) not found in item_instance, deleting from guild bank!", itemGuid, itemEntry); @@ -359,12 +359,12 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields) stmt->setUInt8 (2, slotId); CharacterDatabase.Execute(stmt); - delete item; + delete pItem; return false; } - item->AddToWorld(); - m_items[slotId] = item; + pItem->AddToWorld(); + m_items[slotId] = pItem; return true; } @@ -372,13 +372,13 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields) void Guild::BankTab::Delete(SQLTransaction& trans, bool removeItemsFromDB) { for (uint8 slotId = 0; slotId < GUILD_BANK_MAX_SLOTS; ++slotId) - if (Item* item = m_items[slotId]) + if (Item* pItem = m_items[slotId]) { - item->RemoveFromWorld(); + pItem->RemoveFromWorld(); if (removeItemsFromDB) - item->DeleteFromDB(trans); - delete item; - item = NULL; + pItem->DeleteFromDB(trans); + delete pItem; + pItem = NULL; } } @@ -392,29 +392,29 @@ inline void Guild::BankTab::WritePacket(WorldPacket& data) const // Writes information about contents of specified slot into packet. void Guild::BankTab::WriteSlotPacket(WorldPacket& data, uint8 slotId) const { - Item* item = GetItem(slotId); - uint32 itemEntry = item ? item->GetEntry() : 0; + 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(item->GetItemRandomPropertyId()); // Random item property id + data << uint32(pItem->GetItemRandomPropertyId()); // Random item property id - if (item->GetItemRandomPropertyId()) - data << uint32(item->GetItemSuffixFactor()); // SuffixFactor + if (pItem->GetItemRandomPropertyId()) + data << uint32(pItem->GetItemSuffixFactor()); // SuffixFactor - data << uint32(item->GetCount()); // ITEM_FIELD_STACK_COUNT + data << uint32(pItem->GetCount()); // ITEM_FIELD_STACK_COUNT data << uint32(0); - data << uint8(abs(item->GetSpellCharges())); // Spell charges + 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 = item->GetEnchantmentId(EnchantmentSlot(i))) + if (uint32 enchId = pItem->GetEnchantmentId(EnchantmentSlot(i))) { data << uint8(i); data << uint32(enchId); @@ -456,13 +456,13 @@ void Guild::BankTab::SetText(const std::string& text) } // Sets/removes contents of specified slot. -// If item == NULL contents are removed. -bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* item) +// If pItem == NULL contents are removed. +bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem) { if (slotId >= GUILD_BANK_MAX_SLOTS) return false; - m_items[slotId] = item; + m_items[slotId] = pItem; PreparedStatement* stmt = NULL; @@ -472,19 +472,19 @@ bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* item) stmt->setUInt8 (2, slotId); CharacterDatabase.ExecuteOrAppend(trans, stmt); - if (item) + if (pItem) { 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, item->GetGUIDLow()); + stmt->setUInt32(3, pItem->GetGUIDLow()); CharacterDatabase.ExecuteOrAppend(trans, stmt); - 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 + 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 } return true; } @@ -759,12 +759,12 @@ bool Guild::MoveItemData::CheckItem(uint32& splitedAmount) return true; } -bool Guild::MoveItemData::CanStore(Item* item, bool swap, bool sendError) +bool Guild::MoveItemData::CanStore(Item* pItem, bool swap, bool sendError) { m_vec.clear(); - InventoryResult msg = CanStore(item, swap); + InventoryResult msg = CanStore(pItem, swap); if (sendError && msg != EQUIP_ERR_OK) - m_pPlayer->SendEquipError(msg, item); + m_pPlayer->SendEquipError(msg, pItem); return (msg == EQUIP_ERR_OK); } @@ -834,12 +834,12 @@ void Guild::PlayerMoveItemData::RemoveItem(SQLTransaction& trans, MoveItemData* } } -Item* Guild::PlayerMoveItemData::StoreItem(SQLTransaction& trans, Item* item) +Item* Guild::PlayerMoveItemData::StoreItem(SQLTransaction& trans, Item* pItem) { - ASSERT(item); - m_pPlayer->MoveItemToInventory(m_vec, item, true); + ASSERT(pItem); + m_pPlayer->MoveItemToInventory(m_vec, pItem, true); m_pPlayer->SaveInventoryAndGoldToDB(trans); - return item; + return pItem; } void Guild::PlayerMoveItemData::LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const @@ -850,9 +850,9 @@ void Guild::PlayerMoveItemData::LogBankEvent(SQLTransaction& trans, MoveItemData pFrom->GetItem()->GetEntry(), count); } -inline InventoryResult Guild::PlayerMoveItemData::CanStore(Item* item, bool swap) +inline InventoryResult Guild::PlayerMoveItemData::CanStore(Item* pItem, bool swap) { - return m_pPlayer->CanStoreItem(m_container, m_slotId, m_vec, item, swap); + return m_pPlayer->CanStoreItem(m_container, m_slotId, m_vec, pItem, swap); } /////////////////////////////////////////////////////////////////////////////// @@ -900,24 +900,24 @@ void Guild::BankMoveItemData::RemoveItem(SQLTransaction& trans, MoveItemData* pO m_pGuild->_DecreaseMemberRemainingSlots(trans, m_pPlayer->GetGUID(), m_container); } -Item* Guild::BankMoveItemData::StoreItem(SQLTransaction& trans, Item* item) +Item* Guild::BankMoveItemData::StoreItem(SQLTransaction& trans, Item* pItem) { - if (!item) + if (!pItem) return NULL; BankTab* pTab = m_pGuild->GetBankTab(m_container); if (!pTab) return NULL; - Item* pLastItem = item; + Item* pLastItem = pItem; for (ItemPosCountVec::const_iterator itr = m_vec.begin(); itr != m_vec.end(); ) { ItemPosCount pos(*itr); ++itr; sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: StoreItem tab = %u, slot = %u, item = %u, count = %u", - m_container, m_slotId, item->GetEntry(), item->GetCount()); - pLastItem = _StoreItem(trans, pTab, item, pos, itr != m_vec.end()); + m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); + pLastItem = _StoreItem(trans, pTab, pItem, pos, itr != m_vec.end()); } return pLastItem; } @@ -946,7 +946,7 @@ void Guild::BankMoveItemData::LogAction(MoveItemData* pFrom) const m_pGuild->GetId()); } -Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab, Item* item, ItemPosCount& pos, bool clone) const +Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab, Item* pItem, ItemPosCount& pos, bool clone) const { uint8 slotId = uint8(pos.pos); uint32 count = pos.count; @@ -957,20 +957,20 @@ Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab, pItemDest->SaveToDB(trans); if (!clone) { - item->RemoveFromWorld(); - item->DeleteFromDB(trans); - delete item; + pItem->RemoveFromWorld(); + pItem->DeleteFromDB(trans); + delete pItem; } return pItemDest; } if (clone) - item = item->CloneItem(count); + pItem = pItem->CloneItem(count); else - item->SetCount(count); + pItem->SetCount(count); - if (item && pTab->SetItem(trans, slotId, item)) - return item; + if (pItem && pTab->SetItem(trans, slotId, pItem)) + return pItem; return NULL; } @@ -979,13 +979,13 @@ Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab, // If item in destination slot exists it must be the item of the same entry // and stack must have enough space to take at least one item. // Returns false if destination item specified and it cannot be used to reserve space. -bool Guild::BankMoveItemData::_ReserveSpace(uint8 slotId, Item* item, Item* pItemDest, uint32& count) +bool Guild::BankMoveItemData::_ReserveSpace(uint8 slotId, Item* pItem, Item* pItemDest, uint32& count) { - uint32 requiredSpace = item->GetMaxStackCount(); + uint32 requiredSpace = pItem->GetMaxStackCount(); if (pItemDest) { // Make sure source and destination items match and destination item has space for more stacks. - if (pItemDest->GetEntry() != item->GetEntry() || pItemDest->GetCount() >= item->GetMaxStackCount()) + if (pItemDest->GetEntry() != pItem->GetEntry() || pItemDest->GetCount() >= pItem->GetMaxStackCount()) return false; requiredSpace -= pItemDest->GetCount(); } @@ -1002,7 +1002,7 @@ bool Guild::BankMoveItemData::_ReserveSpace(uint8 slotId, Item* item, Item* pIte return true; } -void Guild::BankMoveItemData::CanStoreItemInTab(Item* item, uint8 skipSlotId, bool merge, uint32& count) +void Guild::BankMoveItemData::CanStoreItemInTab(Item* pItem, uint8 skipSlotId, bool merge, uint32& count) { for (uint8 slotId = 0; (slotId < GUILD_BANK_MAX_SLOTS) && (count > 0); ++slotId) { @@ -1011,25 +1011,25 @@ void Guild::BankMoveItemData::CanStoreItemInTab(Item* item, uint8 skipSlotId, bo continue; Item* pItemDest = m_pGuild->_GetItem(m_container, slotId); - if (pItemDest == item) + if (pItemDest == pItem) pItemDest = NULL; // If merge skip empty, if not merge skip non-empty if ((pItemDest != NULL) != merge) continue; - _ReserveSpace(slotId, item, pItemDest, count); + _ReserveSpace(slotId, pItem, pItemDest, count); } } -InventoryResult Guild::BankMoveItemData::CanStore(Item* item, bool swap) +InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) { sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: CanStore() tab = %u, slot = %u, item = %u, count = %u", - m_container, m_slotId, item->GetEntry(), item->GetCount()); + m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); - uint32 count = item->GetCount(); + uint32 count = pItem->GetCount(); // Soulbound items cannot be moved - if (item->IsSoulBound()) + if (pItem->IsSoulBound()) return EQUIP_ERR_CANT_DROP_SOULBOUND; // Make sure destination bank tab exists @@ -1041,10 +1041,10 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* item, bool swap) { Item* pItemDest = m_pGuild->_GetItem(m_container, m_slotId); // Ignore swapped item (this slot will be empty after move) - if ((pItemDest == item) || swap) + if ((pItemDest == pItem) || swap) pItemDest = NULL; - if (!_ReserveSpace(m_slotId, item, pItemDest, count)) + if (!_ReserveSpace(m_slotId, pItem, pItemDest, count)) return EQUIP_ERR_ITEM_CANT_STACK; if (count == 0) @@ -1053,15 +1053,15 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* item, bool swap) // Slot was not specified or it has not enough space for all the items in stack // Search for stacks to merge with - if (item->GetMaxStackCount() > 1) + if (pItem->GetMaxStackCount() > 1) { - CanStoreItemInTab(item, m_slotId, true, count); + CanStoreItemInTab(pItem, m_slotId, true, count); if (count == 0) return EQUIP_ERR_OK; } // Search free slot for item - CanStoreItemInTab(item, m_slotId, false, count); + CanStoreItemInTab(pItem, m_slotId, false, count); if (count == 0) return EQUIP_ERR_OK; diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 6454a979a79..e18e62e51b7 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -476,7 +476,7 @@ private: void SendText(const Guild* guild, WorldSession* session) const; inline Item* GetItem(uint8 slotId) const { return slotId < GUILD_BANK_MAX_SLOTS ? m_items[slotId] : NULL; } - bool SetItem(SQLTransaction& trans, uint8 slotId, Item* item); + bool SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem); private: uint32 m_guildId; @@ -506,13 +506,13 @@ private: // Defines if player has rights to withdraw item from container virtual bool HasWithdrawRights(MoveItemData* /*pOther*/) const { return true; } // Checks if container can store specified item - bool CanStore(Item* item, bool swap, bool sendError); + bool CanStore(Item* pItem, bool swap, bool sendError); // Clones stored item bool CloneItem(uint32 count); // Remove item from container (if splited update items fields) virtual void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount = 0) = 0; // Saves item to container - virtual Item* StoreItem(SQLTransaction& trans, Item* item) = 0; + virtual Item* StoreItem(SQLTransaction& trans, Item* pItem) = 0; // Log bank event virtual void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const = 0; // Log GM action @@ -524,7 +524,7 @@ private: uint8 GetContainer() const { return m_container; } uint8 GetSlotId() const { return m_slotId; } protected: - virtual InventoryResult CanStore(Item* item, bool swap) = 0; + virtual InventoryResult CanStore(Item* pItem, bool swap) = 0; Guild* m_pGuild; Player* m_pPlayer; @@ -544,10 +544,10 @@ private: bool IsBank() const { return false; } bool InitItem(); void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount = 0); - Item* StoreItem(SQLTransaction& trans, Item* item); + Item* StoreItem(SQLTransaction& trans, Item* pItem); void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const; protected: - InventoryResult CanStore(Item* item, bool swap); + InventoryResult CanStore(Item* pItem, bool swap); }; class BankMoveItemData : public MoveItemData @@ -561,17 +561,17 @@ private: bool HasStoreRights(MoveItemData* pOther) const; bool HasWithdrawRights(MoveItemData* pOther) const; void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount); - Item* StoreItem(SQLTransaction& trans, Item* item); + Item* StoreItem(SQLTransaction& trans, Item* pItem); void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const; void LogAction(MoveItemData* pFrom) const; protected: - InventoryResult CanStore(Item* item, bool swap); + InventoryResult CanStore(Item* pItem, bool swap); private: - Item* _StoreItem(SQLTransaction& trans, BankTab* pTab, Item* item, ItemPosCount& pos, bool clone) const; - bool _ReserveSpace(uint8 slotId, Item* item, Item* pItemDest, uint32& count); - void CanStoreItemInTab(Item* item, uint8 skipSlotId, bool merge, uint32& count); + Item* _StoreItem(SQLTransaction& trans, BankTab* pTab, Item* pItem, ItemPosCount& pos, bool clone) const; + bool _ReserveSpace(uint8 slotId, Item* pItem, Item* pItemDest, uint32& count); + void CanStoreItemInTab(Item* pItem, uint8 skipSlotId, bool merge, uint32& count); }; typedef UNORDERED_MAP Members; diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 2188667d042..f82c52204fb 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -504,8 +504,8 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) SQLTransaction trans = CharacterDatabase.BeginTransaction(); if (auction && auction->owner == player->GetGUIDLow()) { - Item* item = sAuctionMgr->GetAItem(auction->item_guidlow); - if (item) + Item* pItem = sAuctionMgr->GetAItem(auction->item_guidlow); + if (pItem) { if (auction->bidder > 0) // If we have a bidder, we have to send him the money he paid { @@ -522,7 +522,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) // item will deleted or added to received mail list MailDraft(msgAuctionCanceledOwner.str(), "") // TODO: fix body - .AddItem(item) + .AddItem(pItem) .SendMailTo(trans, player, auction, MAIL_CHECK_MASK_COPIED); } else diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 9e637665f55..2434ba6eaa7 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -255,14 +255,14 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) } } - Item* item = _player->GetItemByPos(bag, slot); - if (!item) + Item* pItem = _player->GetItemByPos(bag, slot); + if (!pItem) { _player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } - if (item->GetTemplate()->Flags & ITEM_PROTO_FLAG_INDESTRUCTIBLE) + if (pItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_INDESTRUCTIBLE) { _player->SendEquipError(EQUIP_ERR_CANT_DROP_SOULBOUND, NULL, NULL); return; @@ -271,7 +271,7 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) if (count) { uint32 i_count = count; - _player->DestroyItemCount(item, i_count, true); + _player->DestroyItemCount(pItem, i_count, true); } else _player->DestroyItem(bag, slot, true); @@ -445,13 +445,13 @@ void WorldSession::HandleReadItem(WorldPacket & recv_data) recv_data >> bag >> slot; //sLog->outDetail("STORAGE: Read bag = %u, slot = %u", bag, slot); - Item* item = _player->GetItemByPos(bag, slot); + Item* pItem = _player->GetItemByPos(bag, slot); - if (item && item->GetTemplate()->PageText) + if (pItem && pItem->GetTemplate()->PageText) { WorldPacket data; - InventoryResult msg = _player->CanUseItem(item); + InventoryResult msg = _player->CanUseItem(pItem); if (msg == EQUIP_ERR_OK) { data.Initialize (SMSG_READ_ITEM_OK, 8); @@ -461,9 +461,9 @@ void WorldSession::HandleReadItem(WorldPacket & recv_data) { data.Initialize(SMSG_READ_ITEM_FAILED, 8); sLog->outDetail("STORAGE: Unable to read item"); - _player->SendEquipError(msg, item, NULL); + _player->SendEquipError(msg, pItem, NULL); } - data << item->GetGUID(); + data << pItem->GetGUID(); SendPacket(&data); } else @@ -506,25 +506,25 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - Item* item = _player->GetItemByGuid(itemguid); - if (item) + Item* pItem = _player->GetItemByGuid(itemguid); + if (pItem) { // prevent sell not owner item - if (_player->GetGUID() != item->GetOwnerGUID()) + if (_player->GetGUID() != pItem->GetOwnerGUID()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; } // prevent sell non empty bag by drag-and-drop at vendor's item list - if (item->IsNotEmptyBag()) + if (pItem->IsNotEmptyBag()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; } // prevent sell currently looted item - if (_player->GetLootGUID() == item->GetGUID()) + if (_player->GetLootGUID() == pItem->GetGUID()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; @@ -533,44 +533,44 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) // prevent selling item for sellprice when the item is still refundable // this probably happens when right clicking a refundable item, the client sends both // CMSG_SELL_ITEM and CMSG_REFUND_ITEM (unverified) - if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) + if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) return; // Therefore, no feedback to client // special case at auto sell (sell all) if (count == 0) { - count = item->GetCount(); + count = pItem->GetCount(); } else { // prevent sell more items that exist in stack (possible only not from client) - if (count > item->GetCount()) + if (count > pItem->GetCount()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; } } - ItemTemplate const* pProto = item->GetTemplate(); + ItemTemplate const* pProto = pItem->GetTemplate(); if (pProto) { if (pProto->SellPrice > 0) { - if (count < item->GetCount()) // need split items + if (count < pItem->GetCount()) // need split items { - Item* pNewItem = item->CloneItem(count, _player); + Item* pNewItem = pItem->CloneItem(count, _player); if (!pNewItem) { - sLog->outError("WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", item->GetEntry(), count); + sLog->outError("WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), count); _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); return; } - item->SetCount(item->GetCount() - count); - _player->ItemRemovedQuestCheck(item->GetEntry(), count); + pItem->SetCount(pItem->GetCount() - count); + _player->ItemRemovedQuestCheck(pItem->GetEntry(), count); if (_player->IsInWorld()) - item->SendUpdateToPlayer(_player); - item->SetState(ITEM_CHANGED, _player); + pItem->SendUpdateToPlayer(_player); + pItem->SetState(ITEM_CHANGED, _player); _player->AddItemToBuyBackSlot(pNewItem); if (_player->IsInWorld()) @@ -578,10 +578,10 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) } else { - _player->ItemRemovedQuestCheck(item->GetEntry(), item->GetCount()); - _player->RemoveItem(item->GetBagSlot(), item->GetSlot(), true); - item->RemoveFromUpdateQueueOf(_player); - _player->AddItemToBuyBackSlot(item); + _player->ItemRemovedQuestCheck(pItem->GetEntry(), pItem->GetCount()); + _player->RemoveItem(pItem->GetBagSlot(), pItem->GetSlot(), true); + pItem->RemoveFromUpdateQueueOf(_player); + _player->AddItemToBuyBackSlot(pItem); } uint32 money = pProto->SellPrice * count; @@ -617,28 +617,28 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - Item* item = _player->GetItemFromBuyBackSlot(slot); - if (item) + Item* pItem = _player->GetItemFromBuyBackSlot(slot); + if (pItem) { uint32 price = _player->GetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + slot - BUYBACK_SLOT_START); if (!_player->HasEnoughMoney(price)) { - _player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, item->GetEntry(), 0); + _player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, pItem->GetEntry(), 0); return; } ItemPosCountVec dest; - InventoryResult msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, item, false); + InventoryResult msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, pItem, false); if (msg == EQUIP_ERR_OK) { _player->ModifyMoney(-(int32)price); _player->RemoveItemFromBuyBackSlot(slot, false); - _player->ItemAddedQuestCheck(item->GetEntry(), item->GetCount()); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item->GetEntry(), item->GetCount()); - _player->StoreItem(dest, item, true); + _player->ItemAddedQuestCheck(pItem->GetEntry(), pItem->GetCount()); + _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, pItem->GetEntry(), pItem->GetCount()); + _player->StoreItem(dest, pItem, true); } else - _player->SendEquipError(msg, item, NULL); + _player->SendEquipError(msg, pItem, NULL); return; } else @@ -815,8 +815,8 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) recv_data >> srcbag >> srcslot >> dstbag; //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u", srcbag, srcslot, dstbag); - Item* item = _player->GetItemByPos(srcbag, srcslot); - if (!item) + Item* pItem = _player->GetItemByPos(srcbag, srcslot); + if (!pItem) return; if (!_player->IsValidPos(dstbag, NULL_SLOT, false)) // can be autostore pos @@ -825,7 +825,7 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) return; } - uint16 src = item->GetPos(); + uint16 src = pItem->GetPos(); // check unequip potability for equipped items and bank bags if (_player->IsEquipmentPos (src) || _player->IsBagPos (src)) @@ -833,16 +833,16 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) InventoryResult msg = _player->CanUnequipItem(src, !_player->IsBagPos (src)); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, item, NULL); + _player->SendEquipError(msg, pItem, NULL); return; } } ItemPosCountVec dest; - InventoryResult msg = _player->CanStoreItem(dstbag, NULL_SLOT, dest, item, false); + InventoryResult msg = _player->CanStoreItem(dstbag, NULL_SLOT, dest, pItem, false); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, item, NULL); + _player->SendEquipError(msg, pItem, NULL); return; } @@ -850,12 +850,12 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) if (dest.size() == 1 && dest[0].pos == src) { // just remove grey item state - _player->SendEquipError(EQUIP_ERR_NONE, item, NULL); + _player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); return; } _player->RemoveItem(srcbag, srcslot, true); - _player->StoreItem(dest, item, true); + _player->StoreItem(dest, pItem, true); } void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) @@ -919,27 +919,27 @@ void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket) recvPacket >> srcbag >> srcslot; sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); - Item* item = _player->GetItemByPos(srcbag, srcslot); - if (!item) + Item* pItem = _player->GetItemByPos(srcbag, srcslot); + if (!pItem) return; ItemPosCountVec dest; - InventoryResult msg = _player->CanBankItem(NULL_BAG, NULL_SLOT, dest, item, false); + InventoryResult msg = _player->CanBankItem(NULL_BAG, NULL_SLOT, dest, pItem, false); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, item, NULL); + _player->SendEquipError(msg, pItem, NULL); return; } - if (dest.size() == 1 && dest[0].pos == item->GetPos()) + if (dest.size() == 1 && dest[0].pos == pItem->GetPos()) { - _player->SendEquipError(EQUIP_ERR_NONE, item, NULL); + _player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); return; } _player->RemoveItem(srcbag, srcslot, true); - _player->ItemRemovedQuestCheck(item->GetEntry(), item->GetCount()); - _player->BankItem(dest, item, true); + _player->ItemRemovedQuestCheck(pItem->GetEntry(), pItem->GetCount()); + _player->BankItem(dest, pItem, true); } void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket) @@ -950,36 +950,36 @@ void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket) recvPacket >> srcbag >> srcslot; sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); - Item* item = _player->GetItemByPos(srcbag, srcslot); - if (!item) + Item* pItem = _player->GetItemByPos(srcbag, srcslot); + if (!pItem) return; if (_player->IsBankPos(srcbag, srcslot)) // moving from bank to inventory { ItemPosCountVec dest; - InventoryResult msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, item, false); + InventoryResult msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, pItem, false); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, item, NULL); + _player->SendEquipError(msg, pItem, NULL); return; } _player->RemoveItem(srcbag, srcslot, true); - _player->StoreItem(dest, item, true); - _player->ItemAddedQuestCheck(item->GetEntry(), item->GetCount()); + _player->StoreItem(dest, pItem, true); + _player->ItemAddedQuestCheck(pItem->GetEntry(), pItem->GetCount()); } else // moving from inventory to bank { ItemPosCountVec dest; - InventoryResult msg = _player->CanBankItem(NULL_BAG, NULL_SLOT, dest, item, false); + InventoryResult msg = _player->CanBankItem(NULL_BAG, NULL_SLOT, dest, pItem, false); if (msg != EQUIP_ERR_OK) { - _player->SendEquipError(msg, item, NULL); + _player->SendEquipError(msg, pItem, NULL); return; } _player->RemoveItem(srcbag, srcslot, true); - _player->BankItem(dest, item, true); + _player->BankItem(dest, pItem, true); } } diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index b4d6db5e80c..8e4b41a9be4 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -55,15 +55,15 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data) } else if (IS_ITEM_GUID(lguid)) { - Item* item = player->GetItemByGuid(lguid); + Item* pItem = player->GetItemByGuid(lguid); - if (!item) + if (!pItem) { player->SendLootRelease(lguid); return; } - loot = &item->loot; + loot = &pItem->loot; } else if (IS_CORPSE_GUID(lguid)) { @@ -357,29 +357,29 @@ void WorldSession::DoLootRelease(uint64 lguid) } else if (IS_ITEM_GUID(lguid)) { - Item* item = player->GetItemByGuid(lguid); - if (!item) + Item* pItem = player->GetItemByGuid(lguid); + if (!pItem) return; - ItemTemplate const* proto = item->GetTemplate(); + ItemTemplate const* proto = pItem->GetTemplate(); // destroy only 5 items from stack in case prospecting and milling if (proto->Flags & (ITEM_PROTO_FLAG_PROSPECTABLE | ITEM_PROTO_FLAG_MILLABLE)) { - item->m_lootGenerated = false; - item->loot.clear(); + pItem->m_lootGenerated = false; + pItem->loot.clear(); - uint32 count = item->GetCount(); + uint32 count = pItem->GetCount(); // >=5 checked in spell code, but will work for cheating cases also with removing from another stacks. if (count > 5) count = 5; - player->DestroyItemCount(item, count, true); + player->DestroyItemCount(pItem, count, true); } else // FIXME: item must not be deleted in case not fully looted state. But this pre-request implement loot saving in DB at item save. Or cheating possible. - player->DestroyItem(item->GetBagSlot(), item->GetSlot(), true); + player->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true); return; // item can be looted only single player } else diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index a8ebb4722dd..9ea0e124112 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -86,53 +86,53 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) return; } - Item* item = pUser->GetUseableItemByPos(bagIndex, slot); - if (!item) + Item* pItem = pUser->GetUseableItemByPos(bagIndex, slot); + if (!pItem) { pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } - if (item->GetGUID() != itemGUID) + if (pItem->GetGUID() != itemGUID) { pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } - sLog->outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, castCount: %u, spellId: %u, Item: %u, glyphIndex: %u, data length = %i", bagIndex, slot, castCount, spellId, item->GetEntry(), glyphIndex, (uint32)recvPacket.size()); + sLog->outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, castCount: %u, spellId: %u, Item: %u, glyphIndex: %u, data length = %i", bagIndex, slot, castCount, spellId, pItem->GetEntry(), glyphIndex, (uint32)recvPacket.size()); - ItemTemplate const* proto = item->GetTemplate(); + ItemTemplate const* proto = pItem->GetTemplate(); if (!proto) { - pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, item, NULL); + pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pItem, NULL); return; } // some item classes can be used only in equipped state - if (proto->InventoryType != INVTYPE_NON_EQUIP && !item->IsEquipped()) + if (proto->InventoryType != INVTYPE_NON_EQUIP && !pItem->IsEquipped()) { - pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, item, NULL); + pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pItem, NULL); return; } - InventoryResult msg = pUser->CanUseItem(item); + InventoryResult msg = pUser->CanUseItem(pItem); if (msg != EQUIP_ERR_OK) { - pUser->SendEquipError(msg, item, NULL); + pUser->SendEquipError(msg, pItem, NULL); return; } // only allow conjured consumable, bandage, poisons (all should have the 2^21 item flag set in DB) if (proto->Class == ITEM_CLASS_CONSUMABLE && !(proto->Flags & ITEM_PROTO_FLAG_USEABLE_IN_ARENA) && pUser->InArena()) { - pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, item, NULL); + pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, pItem, NULL); return; } // don't allow items banned in arena if (proto->Flags & ITEM_PROTO_FLAG_NOT_USEABLE_IN_ARENA && pUser->InArena()) { - pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, item, NULL); + pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, pItem, NULL); return; } @@ -144,7 +144,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) { if (!spellInfo->CanBeUsedInCombat()) { - pUser->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT, item, NULL); + pUser->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT, pItem, NULL); return; } } @@ -152,12 +152,12 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) } // check also BIND_WHEN_PICKED_UP and BIND_QUEST_ITEM for .additem or .additemset case by GM (not binded at adding to inventory) - if (item->GetTemplate()->Bonding == BIND_WHEN_USE || item->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || item->GetTemplate()->Bonding == BIND_QUEST_ITEM) + if (pItem->GetTemplate()->Bonding == BIND_WHEN_USE || pItem->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetTemplate()->Bonding == BIND_QUEST_ITEM) { - if (!item->IsSoulBound()) + if (!pItem->IsSoulBound()) { - item->SetState(ITEM_CHANGED, pUser); - item->SetBinding(true); + pItem->SetState(ITEM_CHANGED, pUser); + pItem->SetBinding(true); } } @@ -166,10 +166,10 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) HandleClientCastFlags(recvPacket, castFlags, targets); // Note: If script stop casting it must send appropriate data to client to prevent stuck item in gray state. - if (!sScriptMgr->OnItemUse(pUser, item, targets)) + if (!sScriptMgr->OnItemUse(pUser, pItem, targets)) { // no script or script not process request by self - pUser->CastItemUseSpell(item, targets, castCount, glyphIndex); + pUser->CastItemUseSpell(pItem, targets, castCount, glyphIndex); } } diff --git a/src/server/game/Mails/Mail.cpp b/src/server/game/Mails/Mail.cpp index 3511e5016fd..3c3888eb9f8 100755 --- a/src/server/game/Mails/Mail.cpp +++ b/src/server/game/Mails/Mail.cpp @@ -219,10 +219,10 @@ void MailDraft::SendMailTo(SQLTransaction& trans, MailReceiver const& receiver, for (MailItemMap::const_iterator mailItemIter = m_items.begin(); mailItemIter != m_items.end(); ++mailItemIter) { - Item* item = mailItemIter->second; + Item* pItem = mailItemIter->second; stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_MAIL_ITEM); stmt->setUInt32(0, mailId); - stmt->setUInt32(1, item->GetGUIDLow()); + stmt->setUInt32(1, pItem->GetGUIDLow()); stmt->setUInt32(2, receiver.GetPlayerGUIDLow()); trans->Append(stmt); } diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 15c46a81494..fba6b460ec9 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -1341,10 +1341,10 @@ void ScriptMgr::OnGuildMemberDepositMoney(Guild* guild, Player* player, uint32 & FOREACH_SCRIPT(GuildScript)->OnMemberDepositMoney(guild, player, amount); } -void ScriptMgr::OnGuildItemMove(Guild* guild, Player* player, Item* item, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId, +void ScriptMgr::OnGuildItemMove(Guild* guild, Player* player, Item* pItem, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId, bool isDestBank, uint8 destContainer, uint8 destSlotId) { - FOREACH_SCRIPT(GuildScript)->OnItemMove(guild, player, item, isSrcBank, srcContainer, srcSlotId, isDestBank, destContainer, destSlotId); + FOREACH_SCRIPT(GuildScript)->OnItemMove(guild, player, pItem, isSrcBank, srcContainer, srcSlotId, isDestBank, destContainer, destSlotId); } void ScriptMgr::OnGuildEvent(Guild* guild, uint8 eventType, uint32 playerGuid1, uint32 playerGuid2, uint8 newRank) diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 13c14113627..3b65a5cf256 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -764,7 +764,7 @@ class GuildScript : public ScriptObject virtual void OnMemberDepositMoney(Guild* /*guild*/, Player* /*player*/, uint32& /*amount*/) { } // Called when a guild member moves an item in a guild bank. - virtual void OnItemMove(Guild* /*guild*/, Player* /*player*/, Item* /*item*/, bool /*isSrcBank*/, uint8 /*srcContainer*/, uint8 /*srcSlotId*/, + virtual void OnItemMove(Guild* /*guild*/, Player* /*player*/, Item* /*pItem*/, bool /*isSrcBank*/, uint8 /*srcContainer*/, uint8 /*srcSlotId*/, bool /*isDestBank*/, uint8 /*destContainer*/, uint8 /*destSlotId*/) { } virtual void OnEvent(Guild* /*guild*/, uint8 /*eventType*/, uint32 /*playerGuid1*/, uint32 /*playerGuid2*/, uint8 /*newRank*/) { } @@ -1008,7 +1008,7 @@ class ScriptMgr void OnGuildDisband(Guild* guild); void OnGuildMemberWitdrawMoney(Guild* guild, Player* player, uint32 &amount, bool isRepair); void OnGuildMemberDepositMoney(Guild* guild, Player* player, uint32 &amount); - void OnGuildItemMove(Guild* guild, Player* player, Item* item, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId, + void OnGuildItemMove(Guild* guild, Player* player, Item* pItem, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId, bool isDestBank, uint8 destContainer, uint8 destSlotId); void OnGuildEvent(Guild* guild, uint8 eventType, uint32 playerGuid1, uint32 playerGuid2, uint8 newRank); void OnGuildBankEvent(Guild* guild, uint8 eventType, uint8 tabId, uint32 playerGuid, uint32 itemOrMoney, uint16 itemStackCount, uint8 destTabId); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index a8e7d33e9eb..387f76bbc7f 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2102,9 +2102,9 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo // and also HandleAuraModDisarm is not triggered if (!target->CanUseAttackType(BASE_ATTACK)) { - if (Item* item = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND)) + if (Item* pItem = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND)) { - target->ToPlayer()->_ApplyWeaponDamage(EQUIPMENT_SLOT_MAINHAND, item->GetTemplate(), NULL, apply); + target->ToPlayer()->_ApplyWeaponDamage(EQUIPMENT_SLOT_MAINHAND, pItem->GetTemplate(), NULL, apply); } } } @@ -2536,14 +2536,14 @@ void AuraEffect::HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode, // Handle damage modification, shapeshifted druids are not affected if (target->GetTypeId() == TYPEID_PLAYER && !target->IsInFeralForm()) { - if (Item* item = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) + if (Item* pItem = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) { uint8 attacktype = Player::GetAttackBySlot(slot); if (attacktype < MAX_ATTACK) { - target->ToPlayer()->_ApplyWeaponDamage(slot, item->GetTemplate(), NULL, !apply); - target->ToPlayer()->_ApplyWeaponDependentAuraMods(item, WeaponAttackType(attacktype), !apply); + target->ToPlayer()->_ApplyWeaponDamage(slot, pItem->GetTemplate(), NULL, !apply); + target->ToPlayer()->_ApplyWeaponDependentAuraMods(pItem, WeaponAttackType(attacktype), !apply); } } } @@ -4082,8 +4082,8 @@ void AuraEffect::HandleAuraModWeaponCritPercent(AuraApplication const* aurApp, u return; for (int i = 0; i < MAX_ATTACK; ++i) - if (Item* item = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) - target->ToPlayer()->_ApplyWeaponDependentAuraCritMod(item, WeaponAttackType(i), this, apply); + if (Item* pItem = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) + target->ToPlayer()->_ApplyWeaponDependentAuraCritMod(pItem, WeaponAttackType(i), this, apply); // mods must be applied base at equipped weapon class and subclass comparison // with spell->EquippedItemClass and EquippedItemSubClassMask and EquippedItemInventoryTypeMask @@ -4395,8 +4395,8 @@ void AuraEffect::HandleModDamageDone(AuraApplication const* aurApp, uint8 mode, if (target->GetTypeId() == TYPEID_PLAYER) { for (int i = 0; i < MAX_ATTACK; ++i) - if (Item* item = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) - target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(item, WeaponAttackType(i), this, apply); + if (Item* pItem = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) + target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(pItem, WeaponAttackType(i), this, apply); } // GetMiscValue() is bitmask of spell schools diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 2d3bd095360..ae5b14989af 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -530,8 +530,8 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme if (m_attackType == RANGED_ATTACK) // wand case if ((m_caster->getClassMask() & CLASSMASK_WAND_USERS) != 0 && m_caster->GetTypeId() == TYPEID_PLAYER) - if (Item* item = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK)) - m_spellSchoolMask = SpellSchoolMask(1 << item->GetTemplate()->Damage[0].DamageType); + if (Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK)) + m_spellSchoolMask = SpellSchoolMask(1 << pItem->GetTemplate()->Damage[0].DamageType); if (originalCasterGUID) m_originalCasterGUID = originalCasterGUID; @@ -3952,12 +3952,12 @@ void Spell::WriteAmmoToPacket(WorldPacket* data) if (m_caster->GetTypeId() == TYPEID_PLAYER) { - Item* item = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); - if (item) + Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); + if (pItem) { - ammoInventoryType = item->GetTemplate()->InventoryType; + ammoInventoryType = pItem->GetTemplate()->InventoryType; if (ammoInventoryType == INVTYPE_THROWN) - ammoDisplayID = item->GetTemplate()->DisplayInfoID; + ammoDisplayID = pItem->GetTemplate()->DisplayInfoID; else { uint32 ammoID = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID); @@ -4361,15 +4361,15 @@ void Spell::TakeAmmo() { if (m_attackType == RANGED_ATTACK && m_caster->GetTypeId() == TYPEID_PLAYER) { - Item* item = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); + Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); // wands don't have ammo - if (!item || item->IsBroken() || item->GetTemplate()->SubClass == ITEM_SUBCLASS_WEAPON_WAND) + if (!pItem || pItem->IsBroken() || pItem->GetTemplate()->SubClass == ITEM_SUBCLASS_WEAPON_WAND) return; - if (item->GetTemplate()->InventoryType == INVTYPE_THROWN) + if (pItem->GetTemplate()->InventoryType == INVTYPE_THROWN) { - if (item->GetMaxStackCount() == 1) + if (pItem->GetMaxStackCount() == 1) { // decrease durability for non-stackable throw weapon m_caster->ToPlayer()->DurabilityPointLossForEquipSlot(EQUIPMENT_SLOT_RANGED); @@ -4378,7 +4378,7 @@ void Spell::TakeAmmo() { // decrease items amount for stackable throw weapon uint32 count = 1; - m_caster->ToPlayer()->DestroyItemCount(item, count, true); + m_caster->ToPlayer()->DestroyItemCount(pItem, count, true); } } else if (uint32 ammo = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID)) @@ -6216,15 +6216,15 @@ SpellCastResult Spell::CheckItems() if (m_caster->GetTypeId() != TYPEID_PLAYER) return SPELL_FAILED_TARGET_NOT_PLAYER; if (m_attackType != RANGED_ATTACK) break; - Item* item = m_caster->ToPlayer()->GetWeaponForAttack(m_attackType); - if (!item || item->IsBroken()) + Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(m_attackType); + if (!pItem || pItem->IsBroken()) return SPELL_FAILED_EQUIPPED_ITEM; - switch (item->GetTemplate()->SubClass) + switch (pItem->GetTemplate()->SubClass) { case ITEM_SUBCLASS_WEAPON_THROWN: { - uint32 ammo = item->GetEntry(); + uint32 ammo = pItem->GetEntry(); if (!m_caster->ToPlayer()->HasItemCount(ammo, 1)) return SPELL_FAILED_NO_AMMO; }; break; @@ -6250,7 +6250,7 @@ SpellCastResult Spell::CheckItems() return SPELL_FAILED_NO_AMMO; // check ammo ws. weapon compatibility - switch (item->GetTemplate()->SubClass) + switch (pItem->GetTemplate()->SubClass) { case ITEM_SUBCLASS_WEAPON_BOW: case ITEM_SUBCLASS_WEAPON_CROSSBOW: @@ -6286,10 +6286,10 @@ SpellCastResult Spell::CheckItems() if (!pProto) return SPELL_FAILED_ITEM_AT_MAX_CHARGES; - if (Item* item = p_caster->GetItemByEntry(item_id)) + if (Item* pitem = p_caster->GetItemByEntry(item_id)) { for (int x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) - if (pProto->Spells[x].SpellCharges != 0 && item->GetSpellCharges(x) == pProto->Spells[x].SpellCharges) + if (pProto->Spells[x].SpellCharges != 0 && pitem->GetSpellCharges(x) == pProto->Spells[x].SpellCharges) return SPELL_FAILED_ITEM_AT_MAX_CHARGES; } break; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 07b7921e6e3..59b6d8971cf 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1777,22 +1777,22 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype) if (num_to_add) { // create the new item and store it - Item* item = player->StoreNewItem(dest, newitemid, true, Item::GenerateItemRandomPropertyId(newitemid)); + Item* pItem = player->StoreNewItem(dest, newitemid, true, Item::GenerateItemRandomPropertyId(newitemid)); // was it successful? return error if not - if (!item) + if (!pItem) { player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); return; } // set the "Crafted by ..." property of the item - if (item->GetTemplate()->Class != ITEM_CLASS_CONSUMABLE && item->GetTemplate()->Class != ITEM_CLASS_QUEST && newitemid != 6265 && newitemid != 6948) - item->SetUInt32Value(ITEM_FIELD_CREATOR, player->GetGUIDLow()); + if (pItem->GetTemplate()->Class != ITEM_CLASS_CONSUMABLE && pItem->GetTemplate()->Class != ITEM_CLASS_QUEST && newitemid != 6265 && newitemid != 6948) + pItem->SetUInt32Value(ITEM_FIELD_CREATOR, player->GetGUIDLow()); // send info to the client - if (item) - player->SendNewItem(item, num_to_add, true, bgType == 0); + if (pItem) + player->SendNewItem(pItem, num_to_add, true, bgType == 0); // we succeeded in creating at least one item, so a levelup is possible if (bgType == 0) @@ -6672,11 +6672,11 @@ void Spell::EffectRechargeManaGem(SpellEffIndex /*effIndex*/) return; } - if (Item* item = player->GetItemByEntry(item_id)) + if (Item* pItem = player->GetItemByEntry(item_id)) { for (int x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) - item->SetSpellCharges(x, pProto->Spells[x].SpellCharges); - item->SetState(ITEM_CHANGED, player); + pItem->SetSpellCharges(x, pProto->Spells[x].SpellCharges); + pItem->SetState(ITEM_CHANGED, player); } } diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 8d803a54096..67ac6f8ff76 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -163,15 +163,15 @@ public: if (!*args) return false; - char* item = handler->extractKeyFromLink((char*)args, "Hitem"); - if (!item) + char* pitem = handler->extractKeyFromLink((char*)args, "Hitem"); + if (!pitem) { handler->SendSysMessage(LANG_COMMAND_NEEDITEMSEND); handler->SetSentErrorMessage(true); return false; } - int32 item_int = atol(item); + int32 item_int = atol(pitem); if (item_int <= 0) return false; @@ -411,14 +411,14 @@ public: return false; } - char* item = handler->extractKeyFromLink((char*)args, "Hitem"); - if (!item) + char* pitem = handler->extractKeyFromLink((char*)args, "Hitem"); + if (!pitem) { handler->SendSysMessage(LANG_COMMAND_NEEDITEMSEND); handler->SetSentErrorMessage(true); return false; } - uint32 itemId = atol(item); + uint32 itemId = atol(pitem); if (!sObjectMgr->RemoveVendorItem(vendor->GetEntry(), itemId)) { 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 10227910ec8..7c82454ba87 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -267,11 +267,11 @@ public: //dosen't work at all if (uiShieldBreakerTimer <= uiDiff) { - Vehicle* vehicle = me->GetVehicleKit(); - if (!vehicle) + Vehicle* pVehicle = me->GetVehicleKit(); + if (!pVehicle) return; - if (Unit* pPassenger = vehicle->GetPassenger(SEAT_ID_0)) + if (Unit* pPassenger = pVehicle->GetPassenger(SEAT_ID_0)) { Map::PlayerList const& players = me->GetMap()->GetPlayers(); if (me->GetMap()->IsDungeon() && !players.isEmpty()) 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 7f12853ef0b..a2919de0149 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 @@ -221,8 +221,8 @@ public: { uiVehicle1GUID = pBoss->GetGUID(); uint64 uiGrandChampionBoss1 = 0; - if (Vehicle* vehicle = pBoss->GetVehicleKit()) - if (Unit* unit = vehicle->GetPassenger(0)) + if (Vehicle* pVehicle = pBoss->GetVehicleKit()) + if (Unit* unit = pVehicle->GetPassenger(0)) uiGrandChampionBoss1 = unit->GetGUID(); if (instance) { @@ -236,8 +236,8 @@ public: { uiVehicle2GUID = pBoss->GetGUID(); uint64 uiGrandChampionBoss2 = 0; - if (Vehicle* vehicle = pBoss->GetVehicleKit()) - if (Unit* unit = vehicle->GetPassenger(0)) + if (Vehicle* pVehicle = pBoss->GetVehicleKit()) + if (Unit* unit = pVehicle->GetPassenger(0)) uiGrandChampionBoss2 = unit->GetGUID(); if (instance) { @@ -251,8 +251,8 @@ public: { uiVehicle3GUID = pBoss->GetGUID(); uint64 uiGrandChampionBoss3 = 0; - if (Vehicle* vehicle = pBoss->GetVehicleKit()) - if (Unit* unit = vehicle->GetPassenger(0)) + if (Vehicle* pVehicle = pBoss->GetVehicleKit()) + if (Unit* unit = pVehicle->GetPassenger(0)) uiGrandChampionBoss3 = unit->GetGUID(); if (instance) { diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index fab0188de4d..c313a2138a6 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -176,9 +176,9 @@ public: { if (AggroYellTimer <= diff) { - if (Unit* member = Unit::GetUnit(*me, Council[YellCounter])) + if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter])) { - DoScriptText(CouncilAggro[YellCounter].entry, member); + DoScriptText(CouncilAggro[YellCounter].entry, pMember); AggroYellTimer = CouncilAggro[YellCounter].timer; } ++YellCounter; @@ -191,10 +191,10 @@ public: { if (EnrageTimer <= diff) { - if (Unit* member = Unit::GetUnit(*me, Council[YellCounter])) + if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter])) { - member->CastSpell(member, SPELL_BERSERK, true); - DoScriptText(CouncilEnrage[YellCounter].entry, member); + pMember->CastSpell(pMember, SPELL_BERSERK, true); + DoScriptText(CouncilEnrage[YellCounter].entry, pMember); EnrageTimer = CouncilEnrage[YellCounter].timer; } ++YellCounter; @@ -242,19 +242,19 @@ public: DeathCount = 0; - Creature* member = NULL; + Creature* pMember = NULL; for (uint8 i = 0; i < 4; ++i) { - member = Unit::GetCreature((*me), Council[i]); - if (!member) + pMember = Unit::GetCreature((*me), Council[i]); + if (!pMember) continue; - if (!member->isAlive()) + if (!pMember->isAlive()) { - member->RemoveCorpse(); - member->Respawn(); + pMember->RemoveCorpse(); + pMember->Respawn(); } - member->AI()->EnterEvadeMode(); + pMember->AI()->EnterEvadeMode(); } if (instance) @@ -332,9 +332,9 @@ public: return; } - Creature* member = (Unit::GetCreature(*me, Council[DeathCount])); - if (member && member->isAlive()) - member->DealDamage(member, member->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + Creature* pMember = (Unit::GetCreature(*me, Council[DeathCount])); + if (pMember && pMember->isAlive()) + pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); ++DeathCount; EndEventTimer = 1500; } else EndEventTimer -= diff; diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index f2f2f9e3cdd..079221a97e8 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* item = GetCastItem()) - caster->CastSpell(caster, _triggeredSpellId, true, item); + if (Item* pItem = GetCastItem()) + caster->CastSpell(caster, _triggeredSpellId, true, pItem); } void Register() diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index bb5d7380695..cf55bb14895 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* item, SpellCastTargets const& /*targets*/) + bool OnUse(Player* player, Item* pItem, SpellCastTargets const& /*targets*/) { - uint32 itemId = item->GetEntry(); + uint32 itemId = pItem->GetEntry(); bool disabled = false; //for special scripts @@ -74,7 +74,7 @@ public: return false; // error - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); return true; } }; @@ -110,13 +110,13 @@ class item_gor_dreks_ointment : public ItemScript public: item_gor_dreks_ointment() : ItemScript("item_gor_dreks_ointment") { } - bool OnUse(Player* player, Item* item, SpellCastTargets const& targets) + bool OnUse(Player* player, Item* pItem, 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, item, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); return true; } }; @@ -130,13 +130,13 @@ class item_incendiary_explosives : public ItemScript public: item_incendiary_explosives() : ItemScript("item_incendiary_explosives") { } - bool OnUse(Player* player, Item* item, SpellCastTargets const & /*targets*/) + bool OnUse(Player* player, Item* pItem, SpellCastTargets const & /*targets*/) { if (player->FindNearestCreature(26248, 15) || player->FindNearestCreature(26249, 15)) return false; else { - player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL); return true; } } @@ -219,7 +219,7 @@ class item_pile_fake_furs : public ItemScript public: item_pile_fake_furs() : ItemScript("item_pile_fake_furs") { } - bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const & /*targets*/) + bool OnUse(Player* player, Item* /*pItem*/, SpellCastTargets const & /*targets*/) { GameObject* go = NULL; for (uint8 i = 0; i < CaribouTrapsNum; ++i) @@ -264,14 +264,14 @@ 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* pItem, 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); + player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB)) Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_HERE); @@ -330,7 +330,7 @@ class item_dehta_trap_smasher : public ItemScript public: item_dehta_trap_smasher() : ItemScript("item_dehta_trap_smasher") { } - bool OnUse(Player* player, Item* /*item*/, const SpellCastTargets & /*targets*/) + bool OnUse(Player* player, Item* /*pItem*/, const SpellCastTargets & /*targets*/) { if (player->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) != QUEST_STATUS_INCOMPLETE) return false; @@ -367,7 +367,7 @@ class item_trident_of_nazjan : public ItemScript public: item_trident_of_nazjan() : ItemScript("item_Trident_of_Nazjan") { } - bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/) + bool OnUse(Player* player, Item* pItem, const SpellCastTargets & /*targets*/) { if (player->GetQuestStatus(QUEST_THE_EMISSARY) == QUEST_STATUS_INCOMPLETE) { @@ -376,9 +376,9 @@ public: pLeviroth->AI()->AttackStart(player); return false; } else - player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL); } else - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); return true; } }; @@ -394,17 +394,17 @@ class item_captured_frog : public ItemScript public: item_captured_frog() : ItemScript("item_captured_frog") { } - bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/) + bool OnUse(Player* player, Item* pItem, 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, item, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL); } else - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); return true; } }; diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index 48be9bdba33..a1920e06ad1 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -241,14 +241,14 @@ bool EquippedOk(Player* player, uint32 spellId) if (!reqSpell) continue; - Item* item; + Item* pItem; for (uint8 j = EQUIPMENT_SLOT_START; j < EQUIPMENT_SLOT_END; ++j) { - item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, j); - if (item && item->GetTemplate()->RequiredSpell == reqSpell) + pItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, j); + if (pItem && pItem->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, item->GetEntry()); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, pItem->GetEntry()); return false; } } -- cgit v1.2.3 From bef1b0c4028a3986d63c3b2c9ebdf532a3c73b5b Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Fri, 16 Mar 2012 19:40:57 +0800 Subject: Core/Script: Code style. Signed-off-by: Gyx <2359980687@qq.com> --- src/server/scripts/Commands/cs_account.cpp | 2 +- src/server/scripts/Commands/cs_modify.cpp | 8 ++-- src/server/scripts/Commands/cs_npc.cpp | 17 +++---- src/server/scripts/Commands/cs_wp.cpp | 3 +- .../EasternKingdoms/ScarletEnclave/chapter1.cpp | 14 ++++-- .../ScarletMonastery/boss_headless_horseman.cpp | 9 +++- .../SunwellPlateau/boss_kalecgos.cpp | 4 +- .../EasternKingdoms/Uldaman/boss_archaedas.cpp | 2 +- .../EasternKingdoms/Uldaman/instance_uldaman.cpp | 17 +++---- .../EasternKingdoms/ZulAman/boss_janalai.cpp | 4 +- .../EasternKingdoms/ZulAman/instance_zulaman.cpp | 7 ++- .../BattleForMountHyjal/boss_anetheron.cpp | 3 -- .../BattleForMountHyjal/instance_hyjal.cpp | 3 +- .../Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp | 3 +- .../instance_temple_of_ahnqiraj.cpp | 2 +- .../scripts/Kalimdor/ZulFarrak/zulfarrak.cpp | 24 +++++----- src/server/scripts/Kalimdor/durotar.cpp | 2 +- src/server/scripts/Kalimdor/the_barrens.cpp | 9 ++-- .../AzjolNerub/Ahnkahet/instance_ahnkahet.cpp | 6 ++- .../AzjolNerub/AzjolNerub/boss_hadronox.cpp | 3 +- .../AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp | 3 +- .../TrialOfTheCrusader/boss_faction_champions.cpp | 54 ++++++++++++++-------- .../TrialOfTheCrusader/boss_northrend_beasts.cpp | 3 +- .../TrialOfTheCrusader/boss_twin_valkyr.cpp | 6 ++- .../TrialOfTheCrusader/trial_of_the_crusader.cpp | 30 ++++++++---- .../DraktharonKeep/instance_drak_tharon_keep.cpp | 3 +- .../scripts/Northrend/Gundrak/instance_gundrak.cpp | 3 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 2 +- .../UtgardeKeep/instance_utgarde_keep.cpp | 3 +- .../UtgardePinnacle/instance_pinnacle.cpp | 3 +- .../Northrend/VioletHold/instance_violet_hold.cpp | 3 +- src/server/scripts/Northrend/grizzly_hills.cpp | 2 +- src/server/scripts/Northrend/howling_fjord.cpp | 2 +- .../ShadowLabyrinth/instance_shadow_labyrinth.cpp | 3 +- .../scripts/Outland/BlackTemple/boss_illidan.cpp | 13 ++++-- .../BlackTemple/boss_reliquary_of_souls.cpp | 5 +- .../Outland/BlackTemple/boss_shade_of_akama.cpp | 3 +- .../Outland/BlackTemple/boss_teron_gorefiend.cpp | 3 +- .../Outland/BlackTemple/boss_warlord_najentus.cpp | 4 +- .../Outland/BlackTemple/illidari_council.cpp | 3 +- .../Outland/BlackTemple/instance_black_temple.cpp | 3 +- .../SerpentShrine/boss_leotheras_the_blind.cpp | 3 +- .../SerpentShrine/boss_lurker_below.cpp | 5 +- .../Outland/GruulsLair/instance_gruuls_lair.cpp | 3 +- .../BloodFurnace/boss_kelidan_the_breaker.cpp | 4 +- .../instance_magtheridons_lair.cpp | 4 +- .../Outland/TempestKeep/Eye/instance_the_eye.cpp | 3 +- .../TempestKeep/Mechanar/instance_mechanar.cpp | 2 +- .../TempestKeep/arcatraz/instance_arcatraz.cpp | 3 +- .../scripts/Outland/blades_edge_mountains.cpp | 3 +- .../scripts/Outland/boss_doomlord_kazzak.cpp | 2 +- src/server/scripts/Outland/boss_doomwalker.cpp | 2 +- src/server/scripts/Outland/netherstorm.cpp | 2 +- src/server/scripts/Outland/shadowmoon_valley.cpp | 5 +- src/server/scripts/World/go_scripts.cpp | 20 ++++---- 55 files changed, 220 insertions(+), 137 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index df83fe8118f..86818e2c931 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -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; diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 358eaacd4f7..32ee96dacfe 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -360,7 +360,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; @@ -1141,10 +1143,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); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 67ac6f8ff76..af6952cdf40 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -108,6 +108,7 @@ public: { if (!*args) return false; + char* charID = handler->extractKeyFromLink((char*)args, "Hcreature_entry"); if (!charID) return false; @@ -135,7 +136,7 @@ public: 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; @@ -1036,7 +1037,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,17 +1132,17 @@ 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); @@ -1168,8 +1169,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); diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index 9249cb3fdbc..eb59007b40b 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -277,7 +277,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; diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index cffb2d73b1f..aab18cd57be 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -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 @@ -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); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index b71f0ef8b9a..1ffed905167 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -319,7 +319,8 @@ public: if (wait <= diff) { wait = 1000; - if (!me->getVictim()) return; + if (!me->getVictim()) + return; me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->MoveFleeing(me->getVictim()); } @@ -803,11 +804,15 @@ public: void Despawn() { - if (!debuffGUID) return; + if (!debuffGUID) + return; + Unit* debuff = Unit::GetUnit((*me), debuffGUID); if (debuff) + { debuff->SetVisible(false); debuffGUID = 0; + } } void JustDied(Unit* /*killer*/) { if (!sprouted) Despawn(); } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index 7ac42ff8193..f783fcc1eb5 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -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/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index 17d23429537..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; 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_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index 3cf4f315cad..bbaafa63979 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -374,7 +374,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()) 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/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index e4fa3804b9b..ae1b0ba0c67 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -68,7 +68,6 @@ public: { instance = creature->GetInstanceScript(); go = false; - pos = 0; } uint32 SwarmTimer; @@ -76,7 +75,6 @@ public: uint32 AuraTimer; uint32 InfernoTimer; bool go; - uint32 pos; void Reset() { @@ -119,7 +117,6 @@ public: void WaypointReached(uint32 i) { - pos = i; if (i == 7 && instance) { Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp index b87379d599f..1eaaf418598 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; } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index 4935fb6b906..5dd603a7f92 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -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(); 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/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index f8b1364437b..91d90ffe202 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -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->SetWalk(true); - 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); + } + } }; /*###### diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/durotar.cpp index 710f1e55871..88bc3352ea1 100644 --- a/src/server/scripts/Kalimdor/durotar.cpp +++ b/src/server/scripts/Kalimdor/durotar.cpp @@ -55,7 +55,7 @@ public: uint32 m_uiRebuffTimer; bool work; - void Reset () + void Reset() { uiPlayerGUID = 0; m_uiRebuffTimer = 0; diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp index f05d7691c61..89f1ac3e7a5 100644 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ b/src/server/scripts/Kalimdor/the_barrens.cpp @@ -385,7 +385,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) { @@ -433,8 +434,10 @@ public: if (BigWill) { Creature* creature = Unit::GetCreature((*me), BigWill); - if (creature) { - if (creature->isAlive()) { + 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); diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp index 3ae78d4053b..ef5214581ce 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; } @@ -236,7 +237,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_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp index 699043b3269..1e5567bda82 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp @@ -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/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/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp index 9838f20772c..d232be4577a 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -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_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index 1e5bdff8ee1..5bda32941c2 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -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) { 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 e61347a5027..c2901d16fa1 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -199,7 +199,8 @@ 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) { @@ -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) { 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 aa1b9e59501..1d4961eb8b4 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 @@ -388,7 +388,8 @@ class npc_fizzlebang_toc : public CreatureScript void MovementInform(uint32 uiType, uint32 uiId) { - if (uiType != POINT_MOTION_TYPE) return; + if (uiType != POINT_MOTION_TYPE) + return; switch (uiId) { @@ -411,9 +412,11 @@ class npc_fizzlebang_toc : public CreatureScript void UpdateAI(const uint32 uiDiff) { - if (!instance) return; + if (!instance) + return; - if (instance->GetData(TYPE_EVENT_NPC) != NPC_FIZZLEBANG) return; + if (instance->GetData(TYPE_EVENT_NPC) != NPC_FIZZLEBANG) + return; m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) @@ -537,8 +540,11 @@ class npc_tirion_toc : public CreatureScript void UpdateAI(const uint32 uiDiff) { - if (!instance) return; - if (instance->GetData(TYPE_EVENT_NPC) != NPC_TIRION) return; + if (!instance) + return; + + if (instance->GetData(TYPE_EVENT_NPC) != NPC_TIRION) + return; m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) @@ -833,8 +839,11 @@ class npc_garrosh_toc : public CreatureScript void UpdateAI(const uint32 uiDiff) { - if (!instance) return; - if (instance->GetData(TYPE_EVENT_NPC) != NPC_GARROSH) return; + if (!instance) + return; + + if (instance->GetData(TYPE_EVENT_NPC) != NPC_GARROSH) + return; m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) @@ -911,8 +920,11 @@ class npc_varian_toc : public CreatureScript void UpdateAI(const uint32 uiDiff) { - if (!instance) return; - if (instance->GetData(TYPE_EVENT_NPC) != NPC_VARIAN) return; + if (!instance) + return; + + if (instance->GetData(TYPE_EVENT_NPC) != NPC_VARIAN) + return; m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) 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/Gundrak/instance_gundrak.cpp b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp index aad382e3ad1..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; } 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 20a46c953ab..1bc5563acfa 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -643,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); 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/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/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp index 8c92f474ccf..79c54880430 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; } diff --git a/src/server/scripts/Northrend/grizzly_hills.cpp b/src/server/scripts/Northrend/grizzly_hills.cpp index 7894d87df7c..d1ea6742298 100644 --- a/src/server/scripts/Northrend/grizzly_hills.cpp +++ b/src/server/scripts/Northrend/grizzly_hills.cpp @@ -477,7 +477,7 @@ public: uint32 DespawnTimer; - void Reset () + void Reset() { DespawnTimer = 5000; uiPlayerGUID = 0; diff --git a/src/server/scripts/Northrend/howling_fjord.cpp b/src/server/scripts/Northrend/howling_fjord.cpp index e29b6462835..49bf06f55c4 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 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/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 7468d522e57..d5d694fa395 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -566,7 +566,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,7 +749,8 @@ 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->SetWalk(true); @@ -2137,9 +2140,11 @@ public: 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)) { 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 fc2d663951d..c83fa4ac62c 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -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(); 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 88b1648219b..005ed337b65 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -320,7 +320,8 @@ public: void AttackStart(Unit* who) { - if (!who || IsBanished) return; + if (!who || IsBanished) + return; if (who->isTargetableForAttack() && who != me) DoStartMovement(who); diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index 49323af0952..aa0f5be6e07 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -316,7 +316,8 @@ 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(); diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp index 7d1c07ac91a..7d88a3b0ad4 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp @@ -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 a4cae747bd7..11d47ac29b1 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -313,7 +313,8 @@ public: void UpdateAI(const uint32 diff) { - if (!EventBegun) return; + if (!EventBegun) + return; if (EndEventTimer) { diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp index d4184a0b145..677a47c3a65 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; } 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 19d0cfbbc94..ecca909914c 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 @@ -112,7 +112,8 @@ public: void EnterCombat(Unit* /*who*/) { - if (!victimGUID) return; + if (!victimGUID) + return; } void UpdateAI(const uint32 diff) 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 8ed1f897f3c..00de1802bc9 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp @@ -383,12 +383,11 @@ public: 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) diff --git a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp index bd4f91e8e39..5ea64250689 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; } 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 7aba4db9ad9..082d7df10d6 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) { 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/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/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/instance_arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp index 6a27d295ebc..3b907f1d000 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; } diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index 2d4e870629f..beab023b679 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -492,7 +492,8 @@ public: void MoveInLineOfSight(Unit* who) { - if (!who || (!who->isAlive())) return; + if (!who || (!who->isAlive())) + return; if (me->IsWithinDistInMap(who, 50.0f)) { diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp index 2f6e0823da1..dbdd369dc82 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, diff --git a/src/server/scripts/Outland/boss_doomwalker.cpp b/src/server/scripts/Outland/boss_doomwalker.cpp index c4bd232cc85..664ad215c72 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, diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index ba152252e0a..13c2a280dbe 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -394,7 +394,7 @@ public: struct npc_commander_dawnforgeAI : public ScriptedAI { - npc_commander_dawnforgeAI(Creature* creature) : ScriptedAI(creature) { Reset (); } + npc_commander_dawnforgeAI(Creature* creature) : ScriptedAI(creature) { Reset(); } uint64 PlayerGUID; uint64 ardonisGUID; diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index 94e71e55a67..234b672d08b 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -1727,7 +1727,7 @@ public: { npc_enraged_spiritAI(Creature* creature) : ScriptedAI(creature) {} - void Reset() { } + void Reset() { } void EnterCombat(Unit* /*who*/){} @@ -1739,7 +1739,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; diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 15a931b056b..60ddf8990a7 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -148,9 +148,8 @@ public: 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; } }; @@ -167,9 +166,8 @@ public: 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; } }; @@ -232,9 +230,8 @@ public: 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; } }; @@ -273,7 +270,7 @@ public: 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; } @@ -492,6 +489,7 @@ 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: @@ -500,11 +498,9 @@ public: 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; } @@ -577,7 +573,7 @@ public: 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, 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, go->GetGUID()); -- cgit v1.2.3 From 847b4366f338390fc907b8d8c455696cce33e8be Mon Sep 17 00:00:00 2001 From: leak Date: Mon, 19 Mar 2012 16:48:08 +0100 Subject: Core/DBLayer: Convert PExecute() queries to prepared statements --- src/server/game/Battlegrounds/ArenaTeamMgr.cpp | 2 +- src/server/game/Globals/ObjectMgr.cpp | 14 +++++------ src/server/game/Server/WorldSession.cpp | 10 ++++---- src/server/game/World/World.cpp | 2 +- src/server/scripts/Commands/cs_npc.cpp | 27 ++++++++++++++++++---- .../Database/Implementation/WorldDatabase.cpp | 2 ++ .../shared/Database/Implementation/WorldDatabase.h | 2 ++ 7 files changed, 41 insertions(+), 18 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp index 719206ac625..37aebab5225 100644 --- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp +++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp @@ -92,7 +92,7 @@ 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, " diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index f2b867b91ff..e5dd2f1ee25 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -495,7 +495,7 @@ void ObjectMgr::LoadCreatureTemplateAddons() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 + // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT entry, path_id, mount, bytes1, bytes2, emote, auras FROM creature_template_addon"); if (!result) @@ -872,7 +872,7 @@ void ObjectMgr::LoadCreatureAddons() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 + // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT guid, path_id, mount, bytes1, bytes2, emote, auras FROM creature_addon"); if (!result) @@ -909,7 +909,7 @@ void ObjectMgr::LoadCreatureAddons() creatureAddon.bytes1 = fields[3].GetUInt32(); creatureAddon.bytes2 = fields[4].GetUInt32(); creatureAddon.emote = fields[5].GetUInt32(); - + Tokens tokens(fields[6].GetString(), ' '); uint8 i = 0; creatureAddon.auras.resize(tokens.size()); @@ -6140,10 +6140,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); - CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid >= '%u'", _hiItemGuid); - CharacterDatabase.PExecute("DELETE FROM auctionhouse WHERE itemguid >= '%u'", _hiItemGuid); - CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE item_guid >= '%u'", _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 result = WorldDatabase.Query("SELECT MAX(guid) FROM gameobject"); if (result) diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index e4f8c2a39ac..af38a5f4cce 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -105,7 +105,7 @@ isRecruiter(isARecruiter), timeLastWhoCommand(0) m_Address = sock->GetRemoteAddress(); sock->AddReference(); ResetTimeOutTime(); - LoginDatabase.PExecute("UPDATE account SET online = 1 WHERE id = %u;", GetAccountId()); + LoginDatabase.PExecute("UPDATE account SET online = 1 WHERE id = %u;", GetAccountId()); // One-time query } InitializeQueryCallbackParameters(); @@ -134,7 +134,7 @@ WorldSession::~WorldSession() while (_recvQueue.next(packet)) delete packet; - LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId()); + LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId()); // One-time query } void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const @@ -825,13 +825,13 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) 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) && mi->HasMovementFlag(MOVEMENTFLAG_MASK_MOVING), + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT) && mi->HasMovementFlag(MOVEMENTFLAG_MASK_MOVING), MOVEMENTFLAG_MASK_MOVING); //! Cannot hover without SPELL_AURA_HOVER diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 3efa976e1d3..4c02d1058b2 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1750,7 +1750,7 @@ void World::SetInitialWorldSettings() 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(); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index af6952cdf40..90615a3bd88 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -131,7 +131,19 @@ 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; } @@ -678,9 +690,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->setInt16(0, int16(emote)); + stmt->setInt32(1, target->GetTransport()->GetEntry()); + stmt->setInt32(2, target->GetGUIDTransport()); + + WorldDatabase.Execute(stmt); + } target->SetUInt32Value(UNIT_NPC_EMOTESTATE, emote); diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp index d7d8491008b..d9338bec401 100755 --- a/src/server/shared/Database/Implementation/WorldDatabase.cpp +++ b/src/server/shared/Database/Implementation/WorldDatabase.cpp @@ -60,4 +60,6 @@ void WorldDatabaseConnection::DoPrepareStatements() 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_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); } diff --git a/src/server/shared/Database/Implementation/WorldDatabase.h b/src/server/shared/Database/Implementation/WorldDatabase.h index e708177503f..1d7cd1151e5 100755 --- a/src/server/shared/Database/Implementation/WorldDatabase.h +++ b/src/server/shared/Database/Implementation/WorldDatabase.h @@ -80,6 +80,8 @@ enum WorldDatabaseStatements WORLD_UPD_WAYPOINT_SCRIPT_Z, WORLD_UPD_WAYPOINT_SCRIPT_O, WORLD_DEL_CREATURE, + WORLD_INS_CREATURE_TRANSPORT, + WORLD_UPD_CREATURE_TRANSPORT_EMOTE, MAX_WORLDDATABASE_STATEMENTS, }; -- cgit v1.2.3 From 12e55a04bb14f4a56576dcc0ead35e996d7dcc7d Mon Sep 17 00:00:00 2001 From: leak Date: Sat, 24 Mar 2012 01:25:08 +0100 Subject: Core/DBLayer: Convert PQuery() queries to prepared statements --- src/server/game/Accounts/AccountMgr.cpp | 72 +++++++--- src/server/game/Accounts/AccountMgr.h | 2 +- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 4 +- src/server/game/Chat/Chat.cpp | 5 +- src/server/game/Chat/Chat.h | 4 +- src/server/game/Chat/Commands/Level2.cpp | 149 +++++++++++--------- src/server/game/Chat/Commands/Level3.cpp | 137 ++++++++++-------- src/server/game/Entities/Pet/Pet.cpp | 80 +++++++---- src/server/game/Entities/Player/Player.cpp | 138 ++++++++++++------ src/server/game/Entities/Transport/Transport.cpp | 4 +- src/server/game/Globals/ObjectMgr.cpp | 47 +++++-- src/server/game/Groups/GroupMgr.cpp | 2 +- src/server/game/Handlers/CharacterHandler.cpp | 48 +++++-- src/server/game/Handlers/MailHandler.cpp | 18 ++- src/server/game/Handlers/MiscHandler.cpp | 7 +- src/server/game/Handlers/PetitionsHandler.cpp | 86 +++++++++--- src/server/game/Handlers/SpellHandler.cpp | 9 +- src/server/game/Maps/Map.cpp | 6 +- .../game/Movement/Waypoints/WaypointManager.cpp | 7 +- src/server/game/Pools/PoolMgr.cpp | 7 +- src/server/game/Server/WorldSocket.cpp | 47 ++++--- src/server/game/Tools/PlayerDump.cpp | 17 ++- src/server/game/World/World.cpp | 7 +- src/server/scripts/Commands/cs_account.cpp | 28 ++-- src/server/scripts/Commands/cs_gm.cpp | 6 +- src/server/scripts/Commands/cs_gobject.cpp | 16 ++- src/server/scripts/Commands/cs_reload.cpp | 154 +++++++++++---------- src/server/scripts/Commands/cs_tele.cpp | 5 +- src/server/scripts/Commands/cs_wp.cpp | 101 ++++++++++---- .../Database/Implementation/CharacterDatabase.cpp | 64 ++++++++- .../Database/Implementation/CharacterDatabase.h | 62 +++++++++ .../Database/Implementation/LoginDatabase.cpp | 27 +++- .../shared/Database/Implementation/LoginDatabase.h | 24 ++++ .../Database/Implementation/WorldDatabase.cpp | 24 +++- .../shared/Database/Implementation/WorldDatabase.h | 25 +++- src/server/worldserver/CommandLine/CliRunnable.cpp | 29 +++- src/server/worldserver/RemoteAccess/RASocket.cpp | 24 ++-- 37 files changed, 1036 insertions(+), 456 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index a6ae300e25d..4886b20a0f2 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,7 +88,7 @@ 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); @@ -99,9 +108,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 +125,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 +161,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].GetUInt32() : 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].GetUInt32() : 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,14 +212,21 @@ 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); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_SUM_CHARS); + stmt->setUInt32(0, accountId); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + return (result) ? (*result)[0].GetUInt32() : 0; } diff --git a/src/server/game/Accounts/AccountMgr.h b/src/server/game/Accounts/AccountMgr.h index 467972cdf65..c69f3c0a6f3 100755 --- a/src/server/game/Accounts/AccountMgr.h +++ b/src/server/game/Accounts/AccountMgr.h @@ -44,7 +44,7 @@ namespace AccountMgr uint32 GetId(std::string username); uint32 GetSecurity(uint32 accountId); - uint32 GetSecurity(uint64 accountId, int32 realmId); + 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); diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index a2e958d680f..38a5a49f7a5 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; diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index a6596de25d6..21abae2d91a 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -444,7 +444,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 diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index 2311f4b8e5e..0a39eb43ddb 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -350,8 +350,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/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index c973ebe272b..816049ebfbc 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -266,18 +266,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) @@ -286,17 +286,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 @@ -305,41 +305,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].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(); } - 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].GetUInt32(); + email = fields[2].GetString(); + muteTime = fields[5].GetUInt64(); if (email.empty()) email = "-"; @@ -354,8 +355,13 @@ bool ChatHandler::HandlePInfoCommand(const char* args) EndianConvertReverse(ip); #endif - if (QueryResult result2 = WorldDatabase.PQuery("SELECT c.country FROM ip2nationCountries c, ip2nation i WHERE " - "i.ip < %u AND c.code = i.country ORDER BY i.ip DESC LIMIT 0,1", ip)) + 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(" ("); @@ -376,21 +382,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 = LoginDatabase.GetPreparedStatement(CHAR_SEL_PINFO_BANS); + stmt->setUInt32(0, GUID_LOPART(target_guid)); + result2 = LoginDatabase.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 = result->Fetch(); + banTime = fields[1].GetBool() ? 0 : fields[0].GetUInt64(); + bannedby = fields[2].GetString(); + banreason = fields[3].GetString(); } if (muteTime > 0) @@ -741,9 +749,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); } @@ -760,9 +768,9 @@ 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); } @@ -776,14 +784,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); } -bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit) +bool ChatHandler::LookupPlayerSearchCommand(PreparedQueryResult result, int32 limit) { if (!result) { @@ -807,8 +815,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); @@ -817,14 +828,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 0b7bbf9e7ba..561c5059bad 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -225,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); @@ -413,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(); - 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) { @@ -466,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(); 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) { @@ -514,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(); 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) { @@ -549,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(); - 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) { @@ -3220,7 +3226,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) { @@ -3302,20 +3308,22 @@ bool ChatHandler::HandleBanListAccountCommand(const char *args) 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) @@ -3327,7 +3335,7 @@ bool ChatHandler::HandleBanListAccountCommand(const char *args) return HandleBanListHelper(result); } -bool ChatHandler::HandleBanListHelper(QueryResult result) +bool ChatHandler::HandleBanListHelper(PreparedQueryResult result) { PSendSysMessage(LANG_BANLIST_MATCHINGACCOUNT); @@ -3410,19 +3418,21 @@ bool ChatHandler::HandleBanListIPCommand(const 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) @@ -4619,8 +4629,11 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args) { 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); @@ -4630,7 +4643,10 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args) 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); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_FROZEN); + stmt->setUInt32(0, pguid); + CharacterDatabase.Execute(stmt); + PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str()); return true; } @@ -4646,8 +4662,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); diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 1a3c1a3fbb3..cad38d5c23f 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 16 - result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, 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->setUInt8(1, uint8(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 " - "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); + 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 16 - result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, 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); + 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 16 - result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, 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) { @@ -310,7 +322,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) { @@ -1037,7 +1052,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) { @@ -1099,7 +1116,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) { @@ -1147,7 +1166,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) { @@ -1630,18 +1651,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(0, except_petnumber); + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) return; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index bd5b1010f45..4cb759cc7f0 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4787,7 +4787,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); @@ -4801,8 +4804,11 @@ 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 @@ -4882,7 +4888,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 { @@ -4892,7 +4902,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 { @@ -4996,15 +5010,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].GetUInt64(), fields[1].GetUInt32(), true, true); + } + while (result->NextRow()); } } @@ -7274,7 +7292,10 @@ void Player::ModifyArenaPoints(int32 value, SQLTransaction* trans /*=NULL*/) uint32 Player::GetGuildIdFromDB(uint64 guid) { - QueryResult result = CharacterDatabase.PQuery("SELECT guildid 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) return 0; @@ -7284,10 +7305,13 @@ uint32 Player::GetGuildIdFromDB(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 @@ -7296,7 +7320,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; @@ -7307,7 +7335,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(); @@ -7316,7 +7347,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(); @@ -7343,7 +7377,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; @@ -16537,7 +16574,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; @@ -17723,27 +17763,31 @@ void Player::_LoadMailInit(PreparedQueryResult resultUnread, PreparedQueryResult 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].GetUInt32(); + m->stationery = fields[12].GetUInt8(); m->mailTemplateId = fields[13].GetInt16(); if (m->mailTemplateId && !sMailTemplateStore.LookupEntry(m->mailTemplateId)) @@ -19351,8 +19395,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; @@ -19362,7 +19408,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)); @@ -20200,11 +20246,19 @@ void Player::SendProficiency(ItemClass itemClass, uint32 itemSubclassMask) 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. @@ -25197,8 +25251,8 @@ void Player::SendMovementSetCanFly(bool apply) void Player::SendMovementSetCanTransitionBetweenSwimAndFly(bool apply) { - WorldPacket data(apply ? - SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY : + 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 diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 24fe75605d2..ebb524d5f64 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -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) { diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 01f41866c5b..b4d8d36afb0 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1943,10 +1943,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 +1964,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 +1987,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 +2010,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 +2027,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(); @@ -4809,7 +4829,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 @@ -7033,8 +7055,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; @@ -8189,7 +8211,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; diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp index ae400852c73..3d901f42501 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) diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 15e05ccfbf7..b7225e89235 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -702,12 +702,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 @@ -1363,7 +1368,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); @@ -1422,15 +1432,18 @@ 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)); @@ -1575,7 +1588,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); @@ -1811,8 +1830,13 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD)) { // Reset guild - if (QueryResult result2 = CharacterDatabase.PQuery("SELECT guildid FROM `guild_member` WHERE guid ='%u'", lowGuid)) - if (Guild* guild = sGuildMgr->GetGuildById((result2->Fetch()[0]).GetUInt32())) + 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)); } diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index a8522bb2582..117824bfb62 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(); } - 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(); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 17f96a0fcda..35872f8c63f 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1303,7 +1303,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()); diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index 38d17d8c3b6..e072004c48c 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; @@ -250,9 +253,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,18 +273,22 @@ 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) @@ -311,9 +323,11 @@ 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) { @@ -382,7 +396,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 +440,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 +464,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) { @@ -518,9 +537,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 +562,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 +600,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 +637,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 +701,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()); diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 9ea0e124112..36986075b4e 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -241,7 +241,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(); @@ -260,7 +265,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()); diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 91ebea9f321..86d95857cce 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2527,7 +2527,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(); diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp index b957674151b..2c3a58f55a3 100755 --- a/src/server/game/Movement/Waypoints/WaypointManager.cpp +++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp @@ -100,7 +100,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/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index 05ce7a0a50d..71204f92826 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 diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 2c6098fb23f..40b4a0bad4f 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -812,13 +812,11 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) 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. + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO_BY_NAME); - // 0 1 2 3 4 5 6 7 8 9 10 - QueryResult result = LoginDatabase.PQuery ("SELECT id, sessionkey, last_ip, locked, v, s, expansion, mutetime, locale, recruiter, os FROM account " - "WHERE username = '%s'", safe_account.c_str()); + stmt->setString(0, account); + + PreparedQueryResult result = LoginDatabase.Query(stmt); // Stop if the account is not found if (!result) @@ -899,29 +897,28 @@ 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].GetInt32(); } // 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 { @@ -976,7 +973,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) @@ -984,7 +985,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); diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp index 900fcf7392a..8d5d16d22b9 100644 --- a/src/server/game/Tools/PlayerDump.cpp +++ b/src/server/game/Tools/PlayerDump.cpp @@ -406,7 +406,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 +423,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 } @@ -524,9 +529,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/World/World.cpp b/src/server/game/World/World.cpp index af0c83a7a1b..13f2f1b44b8 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2334,7 +2334,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) { @@ -2770,7 +2770,10 @@ 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())); } diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 86818e2c931..09c5c6c6007 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,18 +212,15 @@ 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) { @@ -233,7 +233,7 @@ public: else handler->PSendSysMessage(LANG_ACCOUNT_LIST_ERROR, name.c_str()); - } while (resultDB->NextRow()); + } while (result->NextRow()); handler->SendSysMessage(LANG_ACCOUNT_LIST_BAR); return true; @@ -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); diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp index 9b9d1cfd146..d449b3617f7 100644 --- a/src/server/scripts/Commands/cs_gm.cpp +++ b/src/server/scripts/Commands/cs_gm.cpp @@ -156,7 +156,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_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 1520a944f6e..5f192ffceee 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -413,7 +413,11 @@ 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, 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 = %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); @@ -434,87 +438,87 @@ public: 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(); + 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(); 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)->HoverHeight = fields[67].GetFloat(); - const_cast(cInfo)->ModHealth = fields[68].GetFloat(); - const_cast(cInfo)->ModMana = fields[69].GetFloat(); - const_cast(cInfo)->ModArmor = fields[70].GetFloat(); - const_cast(cInfo)->RacialLeader = fields[71].GetBool(); - const_cast(cInfo)->questItems[0] = fields[72].GetUInt32(); - const_cast(cInfo)->questItems[1] = fields[73].GetUInt32(); - const_cast(cInfo)->questItems[2] = fields[74].GetUInt32(); - const_cast(cInfo)->questItems[3] = fields[75].GetUInt32(); - const_cast(cInfo)->questItems[4] = fields[76].GetUInt32(); - const_cast(cInfo)->questItems[5] = fields[77].GetUInt32(); - const_cast(cInfo)->movementId = fields[78].GetUInt32(); - const_cast(cInfo)->RegenHealth = fields[79].GetBool(); - const_cast(cInfo)->equipmentId = fields[80].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)->HoverHeight = fields[67].GetFloat(); + const_cast(cInfo)->ModHealth = fields[68].GetFloat(); + const_cast(cInfo)->ModMana = fields[69].GetFloat(); + const_cast(cInfo)->ModArmor = fields[70].GetFloat(); + const_cast(cInfo)->RacialLeader = fields[71].GetBool(); + const_cast(cInfo)->questItems[0] = fields[72].GetUInt32(); + const_cast(cInfo)->questItems[1] = fields[73].GetUInt32(); + const_cast(cInfo)->questItems[2] = fields[74].GetUInt32(); + const_cast(cInfo)->questItems[3] = fields[75].GetUInt32(); + const_cast(cInfo)->questItems[4] = fields[76].GetUInt32(); + const_cast(cInfo)->questItems[5] = fields[77].GetUInt32(); + const_cast(cInfo)->movementId = fields[78].GetUInt32(); + const_cast(cInfo)->RegenHealth = fields[79].GetBool(); + const_cast(cInfo)->equipmentId = fields[80].GetUInt32(); const_cast(cInfo)->MechanicImmuneMask = fields[81].GetUInt32(); - const_cast(cInfo)->flags_extra = fields[82].GetUInt32(); - const_cast(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[83].GetCString()); + const_cast(cInfo)->flags_extra = fields[82].GetUInt32(); + const_cast(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[83].GetCString()); sObjectMgr->CheckCreatureTemplate(cInfo); } diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index 5054bd83f32..89646c23ea0 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -131,7 +131,10 @@ 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(); diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index eb59007b40b..f29dd8a5069 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) { @@ -290,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) { @@ -307,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); @@ -336,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) { @@ -369,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) { @@ -447,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) { @@ -567,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) { @@ -578,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); @@ -765,7 +796,6 @@ public: } std::string show = show_str; - uint32 Maxpoint; //handler->PSendSysMessage("wpshow - show: %s", show); @@ -780,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) { @@ -812,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) { @@ -824,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) { @@ -921,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); @@ -968,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); @@ -1018,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); @@ -1051,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/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 29026b9bef7..9c0c91e8152 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -28,12 +28,13 @@ void CharacterDatabaseConnection::DoPrepareStatements() 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_CHECK_GUID, "SELECT 1 FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_SUM_CHARS, "SELECT COUNT(guid) FROM characters WHERE account = ?", CONNECTION_ASYNC); 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_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); @@ -44,6 +45,11 @@ void CharacterDatabaseConnection::DoPrepareStatements() 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_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_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); @@ -78,11 +84,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,6 +110,7 @@ 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_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_INS_MAIL_ITEM, "INSERT INTO mail_items(mail_id, item_guid, receiver) VALUES (?, ?, ?)", CONNECTION_ASYNC) @@ -127,10 +135,14 @@ void CharacterDatabaseConnection::DoPrepareStatements() 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); @@ -263,6 +275,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) @@ -389,5 +408,44 @@ 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 characters.guid FROM characters WHERE characters.name = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_DEL_CHAR_AURA_FROZEN, "DELETE FROM character_aura WHERE character_aura.spell = 9454 AND character_aura.guid = ?", CONNECTION_SYNCH); + 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, "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); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 2f2aa2301d1..3752051716f 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -48,6 +48,7 @@ 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, @@ -64,6 +65,11 @@ 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_CHAR_POSITION_XYZ, + CHAR_SEL_CHAR_POSITION, CHAR_DEL_QUEST_STATUS_DAILY, CHAR_DEL_QUEST_STATUS_WEEKLY, CHAR_DEL_QUEST_STATUS_SEASONAL, @@ -91,6 +97,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,6 +119,7 @@ enum CharacterDatabaseStatements CHAR_SEL_AUCTION_ITEMS, CHAR_INS_AUCTION, CHAR_DEL_AUCTION, + CHAR_SEL_AUCTION_BY_TIME, CHAR_SEL_AUCTIONS, CHAR_INS_MAIL, CHAR_DEL_MAIL, @@ -136,14 +144,18 @@ enum CharacterDatabaseStatements 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, @@ -259,6 +271,13 @@ 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, @@ -350,6 +369,49 @@ 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, + CHAR_SEL_CHAR_PET_BY_SLOT, + MAX_CHARACTERDATABASE_STATEMENTS, }; diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp index 8ef8d3b48cf..ca7d4f95cfb 100755 --- a/src/server/shared/Database/Implementation/LoginDatabase.cpp +++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp @@ -27,7 +27,11 @@ void LoginDatabaseConnection::DoPrepareStatements() 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_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) @@ -36,8 +40,12 @@ 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) @@ -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, a.last_login, 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); + } diff --git a/src/server/shared/Database/Implementation/LoginDatabase.h b/src/server/shared/Database/Implementation/LoginDatabase.h index afb188020c7..2994c6bb07c 100755 --- a/src/server/shared/Database/Implementation/LoginDatabase.h +++ b/src/server/shared/Database/Implementation/LoginDatabase.h @@ -48,6 +48,8 @@ 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_SEL_SESSIONKEY, LOGIN_UPD_VS, @@ -56,10 +58,16 @@ 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, @@ -82,6 +90,22 @@ 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, MAX_LOGINDATABASE_STATEMENTS, }; diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp index d9338bec401..92393acbc35 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,7 +73,15 @@ 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); } diff --git a/src/server/shared/Database/Implementation/WorldDatabase.h b/src/server/shared/Database/Implementation/WorldDatabase.h index 1d7cd1151e5..9b019306891 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,9 +93,18 @@ 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, MAX_WORLDDATABASE_STATEMENTS, }; diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index 8e04a9c2f34..0721515ea73 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); + + result = CharacterDatabase.Query(stmt); + } - if (resultChar) + 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; diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp index e5637d282c6..d7b366a2e2a 100755 --- a/src/server/worldserver/RemoteAccess/RASocket.cpp +++ b/src/server/worldserver/RemoteAccess/RASocket.cpp @@ -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) { @@ -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; -- cgit v1.2.3 From 192d7d735d18814e6a17f3493da34c5f188e9445 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 24 Mar 2012 23:05:00 +0000 Subject: Core/DBLayer: Few more type corrections Closes #5871 --- src/server/game/Accounts/AccountMgr.cpp | 4 ++-- src/server/game/Server/WorldSocket.cpp | 2 +- src/server/scripts/Commands/cs_account.cpp | 4 ++-- src/server/worldserver/RemoteAccess/RASocket.cpp | 4 ++-- src/server/worldserver/RemoteAccess/RASocket.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index cd3baca7923..eb684ae5b46 100755 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -174,7 +174,7 @@ uint32 GetSecurity(uint32 accountId) stmt->setUInt32(0, accountId); PreparedQueryResult result = LoginDatabase.Query(stmt); - return (result) ? (*result)[0].GetUInt32() : uint32(SEC_PLAYER); + return (result) ? (*result)[0].GetUInt8() : uint32(SEC_PLAYER); } uint32 GetSecurity(uint32 accountId, int32 realmId) @@ -184,7 +184,7 @@ uint32 GetSecurity(uint32 accountId, int32 realmId) stmt->setInt32(1, realmId); PreparedQueryResult result = LoginDatabase.Query(stmt); - return (result) ? (*result)[0].GetUInt32() : uint32(SEC_PLAYER); + return (result) ? (*result)[0].GetUInt8() : uint32(SEC_PLAYER); } bool GetName(uint32 accountId, std::string& name) diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 40b4a0bad4f..cf9ec7dadc4 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -909,7 +909,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) else { fields = result->Fetch(); - security = fields[0].GetInt32(); + security = fields[0].GetUInt8(); } // Re-check account ban (same check as in realmd) diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 09c5c6c6007..b52102479b5 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -227,8 +227,8 @@ public: 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()); diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp index d7b366a2e2a..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() @@ -192,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; 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 /// @} -- cgit v1.2.3 From 56fac5e1afc0596c32dc349d5bc0218fd8a0b13d Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 25 Mar 2012 09:25:28 -0500 Subject: Memory: Get rid of some memory leaks, converted FormationMgr back to singleton --- src/server/game/Entities/Creature/Creature.cpp | 8 ++++---- .../game/Entities/Creature/CreatureGroups.cpp | 21 ++++++++++----------- src/server/game/Entities/Creature/CreatureGroups.h | 21 +++++++++++++-------- src/server/game/Tickets/TicketMgr.cpp | 12 ++++++++---- src/server/game/Tickets/TicketMgr.h | 1 + src/server/game/World/World.cpp | 2 +- src/server/scripts/Commands/cs_npc.cpp | 2 +- 7 files changed, 38 insertions(+), 29 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 1706a56a5ee..9c0b3e50db6 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -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) diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index c95d77db358..bcedfa40864 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,7 +98,7 @@ 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(); @@ -139,8 +140,6 @@ void LoadCreatureFormations() 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; 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/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index c4a08766ddc..e4b8ea2e034 100755 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -198,6 +198,12 @@ void GmTicket::TeleportTo(Player* player) const // 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() @@ -217,10 +223,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; diff --git a/src/server/game/Tickets/TicketMgr.h b/src/server/game/Tickets/TicketMgr.h index cb0a1bab22b..5695880542c 100755 --- a/src/server/game/Tickets/TicketMgr.h +++ b/src/server/game/Tickets/TicketMgr.h @@ -166,6 +166,7 @@ class TicketMgr private: TicketMgr(); + ~TicketMgr(); public: void LoadTickets(); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index cef79a1c32a..95d6b8a93a9 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1589,7 +1589,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(); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 90615a3bd88..249506fb0f1 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -1249,7 +1249,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); -- cgit v1.2.3 From a92820b51c791595676805396a599fa345d58db2 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 27 Mar 2012 00:43:56 +0100 Subject: Core/DBLayer: Correct few more wrong read types (No. 1) DB/World: Some consistency in the ints "length" field (not really a length) From A to D world tables verified; missing all the others int(11) -> int32 unsigned int(10) -> uint32 mediumint(8) -> int32 unsigned mediumint(8) -> uint32 smallint(6) -> int16 unsigned smallint(5) -> uint16 tinyint(4) -> int8 unsigned tinyint(3) -> uint8 --- sql/updates/world/2012_03_27_00_world_misc.sql | 49 ++++++++++++++++++++++ src/server/game/AI/EventAI/CreatureEventAIMgr.cpp | 32 +++++++------- src/server/game/Achievements/AchievementMgr.cpp | 2 +- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 8 ++-- src/server/game/Conditions/ConditionMgr.cpp | 4 +- .../game/Entities/Creature/CreatureGroups.cpp | 2 +- src/server/game/Entities/Transport/Transport.cpp | 8 ++-- src/server/game/Globals/ObjectMgr.cpp | 24 +++++------ src/server/game/Loot/LootMgr.cpp | 2 +- src/server/game/Scripting/ScriptSystem.cpp | 8 ++-- src/server/scripts/Commands/cs_npc.cpp | 2 +- 11 files changed, 95 insertions(+), 46 deletions(-) create mode 100644 sql/updates/world/2012_03_27_00_world_misc.sql (limited to 'src/server/scripts/Commands') diff --git a/sql/updates/world/2012_03_27_00_world_misc.sql b/sql/updates/world/2012_03_27_00_world_misc.sql new file mode 100644 index 00000000000..132c91b81d7 --- /dev/null +++ b/sql/updates/world/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/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp index add7b4db174..facfbd7581c 100755 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp @@ -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/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 5a97f6fa18f..7b2e157eac8 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2282,7 +2282,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 diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 77b985b205f..e1b99cbdcb9 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -708,10 +708,10 @@ 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(); + 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 == 0 || data.MinPlayersPerTeam > data.MaxPlayersPerTeam) { diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 7fe6df14679..3fcabea4c74 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -719,8 +719,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(); diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index bcedfa40864..2104f474072 100755 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -101,7 +101,7 @@ void FormationMgr::LoadCreatureFormations() 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) { diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index ebb524d5f64..81a505b7acc 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -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) { diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 91ce5c44537..f66ca460c0a 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -422,7 +422,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.faction_A = uint32(fields[17].GetUInt16()); creatureTemplate.faction_H = uint32(fields[18].GetUInt16()); creatureTemplate.npcflag = fields[19].GetUInt32(); @@ -455,7 +455,7 @@ void ObjectMgr::LoadCreatureTemplates() creatureTemplate.SkinLootId = fields[46].GetUInt32(); for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) - creatureTemplate.resistance[i] = fields[47 + i -1].GetInt32(); + creatureTemplate.resistance[i] = fields[47 + i -1].GetInt16(); for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i) creatureTemplate.spells[i] = fields[53 + i].GetUInt32(); @@ -5975,7 +5975,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(); @@ -6837,13 +6837,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(); @@ -8692,16 +8692,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].GetUInt16(); + stats.BaseHealth[i] = fields[i + 2].GetInt16(); - stats.BaseMana = fields[5].GetUInt16(); - stats.BaseArmor = fields[6].GetUInt16(); + 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/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 3522571775c..7c7cc06201c 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -116,7 +116,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()) { diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp index ecb82a80a8d..66f5a4089dc 100755 --- a/src/server/game/Scripting/ScriptSystem.cpp +++ b/src/server/game/Scripting/ScriptSystem.cpp @@ -109,11 +109,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) { diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 249506fb0f1..a9959c60201 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -694,7 +694,7 @@ public: { PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_TRANSPORT_EMOTE); - stmt->setInt16(0, int16(emote)); + stmt->setInt32(0, int32(emote)); stmt->setInt32(1, target->GetTransport()->GetEntry()); stmt->setInt32(2, target->GetGUIDTransport()); -- cgit v1.2.3 From 7e793575be1748e244382225b23731de8b771e00 Mon Sep 17 00:00:00 2001 From: cookta2012 Date: Thu, 5 Apr 2012 17:43:06 -0500 Subject: Moving a commands around eliminating a unnecessary file, and porting the "demorph" command * moved the "wpgps" command into the cs_debug.cpp because it seems more fitting * organized the "modify speed" commands into a table of their own * moved the "gps" command into the cs_misc.cpp --- sql/updates/world/2012_04_04_00_world_command.sql | 10 ++ src/server/game/Chat/Chat.cpp | 1 - src/server/game/Chat/Commands/Level2.cpp | 16 --- src/server/game/Scripting/ScriptLoader.cpp | 2 - src/server/scripts/Commands/CMakeLists.txt | 1 - src/server/scripts/Commands/cs_debug.cpp | 11 ++ src/server/scripts/Commands/cs_gps.cpp | 144 ---------------------- src/server/scripts/Commands/cs_misc.cpp | 90 +++++++++++++- src/server/scripts/Commands/cs_modify.cpp | 40 ++++-- 9 files changed, 141 insertions(+), 174 deletions(-) create mode 100644 sql/updates/world/2012_04_04_00_world_command.sql delete mode 100644 src/server/scripts/Commands/cs_gps.cpp (limited to 'src/server/scripts/Commands') diff --git a/sql/updates/world/2012_04_04_00_world_command.sql b/sql/updates/world/2012_04_04_00_world_command.sql new file mode 100644 index 00000000000..9adb3cff1d9 --- /dev/null +++ b/sql/updates/world/2012_04_04_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; \ No newline at end of file diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 7a4c17d1c5e..48bb4c27ef8 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -359,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 }, diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index cc638193b5a..52bdcd15163 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -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) { diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 76c3f1c073c..8e95f1a05cd 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 @@ -663,7 +662,6 @@ void AddCommandScripts() AddSC_tele_commandscript(); AddSC_titles_commandscript(); AddSC_wp_commandscript(); - AddSC_gps_commandscript(); } void AddWorldScripts() diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index d14e71aac4a..86fe984e197 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -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_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 679bb450800..c7bcde01e9b 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -95,6 +95,7 @@ public: static ChatCommand commandTable[] = { { "debug", SEC_MODERATOR, true, NULL, "", debugCommandTable }, + { "wpgps", SEC_ADMINISTRATOR, false, &HandleWPGPSCommand, "", NULL }, { NULL, SEC_PLAYER, false, NULL, "", NULL } }; return commandTable; @@ -1319,6 +1320,16 @@ public: 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_gps.cpp b/src/server/scripts/Commands/cs_gps.cpp deleted file mode 100644 index 59e2ec90905..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[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; - } - - 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_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 32ee96dacfe..f62c434e2e5 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,29 +51,26 @@ 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 }, + { "speed", SEC_MODERATOR, false, NULL, "", modifyspeedCommandTable }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { + { "morph", SEC_GAMEMASTER, false, &HandleModifyMorphCommand, "", NULL }, + { "demorph", SEC_GAMEMASTER, false, &HandleDeMorphCommand, "", NULL }, { "modify", SEC_MODERATOR, false, NULL, "", modifyCommandTable }, { NULL, 0, false, NULL, "", NULL } }; @@ -1374,6 +1381,21 @@ public: if (handler->needReportToTarget(target)) (ChatHandler(target)).PSendSysMessage(LANG_YOUR_GENDER_CHANGED, gender_full, handler->GetNameLink().c_str()); + 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; } }; -- cgit v1.2.3 From ae0a6cde2107ed9f01db1f3e6f198c57c7595d02 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 7 Apr 2012 17:27:40 +0200 Subject: Core/DBLayer: More type fixes. --- src/server/game/Chat/Commands/Level3.cpp | 6 +++--- src/server/scripts/Commands/cs_tele.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index d3417705867..54a9edefc03 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -441,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(); @@ -638,7 +638,7 @@ bool ChatHandler::HandleListObjectCommand(const char *args) uint32 obj_count = 0; 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) { @@ -710,7 +710,7 @@ bool ChatHandler::HandleListCreatureCommand(const char *args) uint32 cr_count = 0; 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) { diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index 89646c23ea0..ca7c3af7fde 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -138,8 +138,8 @@ public: 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(); -- cgit v1.2.3 From abed18d695d1e04787826b41793316202b1ab93a Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 9 Apr 2012 17:36:10 +0200 Subject: Core/DBLayer: More type fixes --- src/server/scripts/Commands/cs_reload.cpp | 164 +++++++++++++++--------------- 1 file changed, 81 insertions(+), 83 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 5f192ffceee..1c119fdef4c 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -424,7 +424,7 @@ public: continue; } - CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(entry); + CreatureTemplate* cInfo = const_cast(sObjectMgr->GetCreatureTemplate(entry)); if (!cInfo) { handler->PSendSysMessage(LANG_COMMAND_CREATURESTORAGE_NOTFOUND, entry); @@ -435,90 +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)->HoverHeight = fields[67].GetFloat(); - const_cast(cInfo)->ModHealth = fields[68].GetFloat(); - const_cast(cInfo)->ModMana = fields[69].GetFloat(); - const_cast(cInfo)->ModArmor = fields[70].GetFloat(); - const_cast(cInfo)->RacialLeader = fields[71].GetBool(); - const_cast(cInfo)->questItems[0] = fields[72].GetUInt32(); - const_cast(cInfo)->questItems[1] = fields[73].GetUInt32(); - const_cast(cInfo)->questItems[2] = fields[74].GetUInt32(); - const_cast(cInfo)->questItems[3] = fields[75].GetUInt32(); - const_cast(cInfo)->questItems[4] = fields[76].GetUInt32(); - const_cast(cInfo)->questItems[5] = fields[77].GetUInt32(); - const_cast(cInfo)->movementId = fields[78].GetUInt32(); - const_cast(cInfo)->RegenHealth = fields[79].GetBool(); - const_cast(cInfo)->equipmentId = fields[80].GetUInt32(); - const_cast(cInfo)->MechanicImmuneMask = fields[81].GetUInt32(); - const_cast(cInfo)->flags_extra = fields[82].GetUInt32(); - const_cast(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[83].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); } -- cgit v1.2.3 From c7eeb0b59c6c2b9419c2fb3fc81ae74301404c7c Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 15 Apr 2012 09:30:34 -0500 Subject: Scripts/Commands: Make the .modify reputation command only modify the specified reputation (ignore spillovers) Patch by @ogeraisi --- src/server/scripts/Commands/cs_modify.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 32ee96dacfe..70f44dd05d0 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1234,7 +1234,7 @@ public: return false; } - target->GetReputationMgr().SetReputation(factionEntry, amount); + target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount); handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[handler->GetSessionDbcLocale()], factionId, handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry)); return true; -- cgit v1.2.3 From f7e0aedaf05e3edb1445d304cadf9c22931d9e2f Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 15 Apr 2012 09:45:51 -0500 Subject: Fixed broken compile --- src/server/scripts/Commands/cs_modify.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 70f44dd05d0..bb3a4d65b76 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1234,7 +1234,7 @@ public: return false; } - target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount); + target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false); handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[handler->GetSessionDbcLocale()], factionId, handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry)); return true; -- cgit v1.2.3 From d6d45633c8ca34176d066755ba8be182b1ed7ac7 Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 9 May 2012 10:07:18 -0400 Subject: Core/Commands: Add level 3 command for setting npc data. used for testing scripts. --- sql/updates/world/2012_05_09_01_world_commands.sql | 8 +++++ src/server/game/Miscellaneous/Language.h | 3 +- src/server/scripts/Commands/cs_npc.cpp | 34 ++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_05_09_01_world_commands.sql (limited to 'src/server/scripts/Commands') diff --git a/sql/updates/world/2012_05_09_01_world_commands.sql b/sql/updates/world/2012_05_09_01_world_commands.sql new file mode 100644 index 00000000000..dcd4c9130eb --- /dev/null +++ b/sql/updates/world/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/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 4b07d19bd7a..aec72835d86 100755 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -522,8 +522,9 @@ enum TrinityStrings LANG_YOURS_EXPLORE_SET_ALL = 553, LANG_YOURS_EXPLORE_SET_NOTHING = 554, + LANG_NPC_SETDATA = 555, + //! Old ones now free: - // LANG_HOVER_ENABLED = 555, // LANG_HOVER_DISABLED = 556, LANG_YOURS_LEVEL_UP = 557, diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index a9959c60201..6089d256387 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -73,6 +73,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 }, @@ -524,6 +525,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); + return true; + } + //npc follow handling static bool HandleNpcFollowCommand(ChatHandler* handler, const char* /*args*/) { -- cgit v1.2.3 From 0f3db42ffc7e2d5a3c4985802dcafe0c5f075738 Mon Sep 17 00:00:00 2001 From: Kandera Date: Wed, 9 May 2012 12:14:31 -0400 Subject: Core/Commands: fix build error with non-pch builds --- src/server/scripts/Commands/cs_npc.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 6089d256387..2c5136ed428 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 { -- cgit v1.2.3 From 70739ec9deb967cd64bc96791278018c0e7b97ea Mon Sep 17 00:00:00 2001 From: Discover- Date: Thu, 10 May 2012 13:50:22 +0200 Subject: Scripts/Commands: Fix compile under Linux (d6d45633c8ca34176d066755ba8be182b1ed7ac7). Credits go to @PuniCZ --- src/server/scripts/Commands/cs_npc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 2c5136ed428..832f7958fc8 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -555,7 +555,7 @@ public: 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); + handler->PSendSysMessage(LANG_NPC_SETDATA, creature->GetGUID(), creature->GetEntry(), creature->GetName(), data_1, data_2, AIorScript.c_str()); return true; } -- cgit v1.2.3 From ab77e597b179c864c6c2f992dfd1486245df0090 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 26 May 2012 23:00:54 +0200 Subject: Add function for SetObjectScale Author: NoFantasy Source: Mangos --- src/server/game/Entities/Corpse/Corpse.cpp | 2 +- src/server/game/Entities/Creature/Creature.cpp | 2 +- src/server/game/Entities/DynamicObject/DynamicObject.cpp | 2 +- src/server/game/Entities/GameObject/GameObject.cpp | 2 +- src/server/game/Entities/Item/Container/Bag.cpp | 2 +- src/server/game/Entities/Item/Item.cpp | 4 ++-- src/server/game/Entities/Object/Object.h | 2 ++ src/server/game/Entities/Pet/Pet.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Entities/Transport/Transport.cpp | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/scripts/Commands/cs_modify.cpp | 2 +- src/server/scripts/Commands/cs_wp.cpp | 6 +++--- src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp | 2 +- src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp | 2 +- src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp | 2 +- .../Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp | 2 +- .../CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp | 2 +- .../TrialOfTheCrusader/trial_of_the_crusader.cpp | 4 ++-- src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp | 8 ++++---- .../SerpentShrine/boss_fathomlord_karathress.cpp | 2 +- src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp | 2 +- src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp | 6 +++--- src/server/scripts/Outland/blades_edge_mountains.cpp | 2 +- 24 files changed, 34 insertions(+), 32 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp index 5b7c40e5494..4613a3554db 100755 --- a/src/server/game/Entities/Corpse/Corpse.cpp +++ b/src/server/game/Entities/Corpse/Corpse.cpp @@ -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/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 6506a113ae1..e8ec686daf5 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -333,7 +333,7 @@ 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); + SetObjectScale(cinfo->scale); SetFloatValue(UNIT_FIELD_HOVERHEIGHT, cinfo->HoverHeight); diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp index abeae0656ee..76d4cb6624b 100755 --- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp +++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp @@ -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 diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 10136c5fbd7..2f6c15ff829 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -206,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); 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 f2b893896dc..af867dad76a 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -258,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); @@ -400,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) diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 3693f683b24..64b780bb6c3 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -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); } diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index f3a736daceb..75deb8b4216 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -870,7 +870,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 diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 41c95ac3d04..d5e2d8ba956 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3153,7 +3153,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) diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 9578605ac6f..4f5d5ade7ec 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -214,7 +214,7 @@ 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); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 5a29e6b325d..05114c8bc07 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2425,7 +2425,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 diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index b6feccc10c6..3e04cb48af4 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -718,7 +718,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; } diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index f29dd8a5069..99ec263b8f9 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -949,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); } } @@ -1003,7 +1003,7 @@ public: if (target) { creature->SetDisplayId(target->GetDisplayId()); - creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5f); + creature->SetObjectScale(0.5f); } return true; @@ -1052,7 +1052,7 @@ public: if (target) { creature->SetDisplayId(target->GetDisplayId()); - creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5f); + creature->SetObjectScale(0.5f); } return true; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index 783ac6baad1..2bba875ad1f 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -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; } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index 9a9f37d165f..a715dbfce9d 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -332,7 +332,7 @@ class boss_akilzon : public CreatureScript CloudGUID = Cloud->GetGUID(); 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); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index ce6b3b37ef8..3da74d16dc3 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -197,7 +197,7 @@ 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(); 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 328d1ab1cd4..cf3c4274e48 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp @@ -354,7 +354,7 @@ public: //! 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); 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 f329b940e1f..1fe7a7da569 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -615,7 +615,7 @@ class mob_frost_sphere : public CreatureScript 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; } } 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 1d4961eb8b4..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 @@ -439,7 +439,7 @@ 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); } @@ -456,7 +456,7 @@ 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(); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 4d6bfc578ff..0a4fdec7222 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -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(); @@ -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(); } @@ -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); 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 206ba3d9455..3937b213e7e 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -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); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index 77c07f5fe4d..25207073708 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -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()); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index c0203150789..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(); @@ -153,7 +153,7 @@ class boss_high_astromancer_solarian : public CreatureScript 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(); } diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index cf0955ed89c..4ec1d04b6ad 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -774,7 +774,7 @@ class npc_simon_bunny : public CreatureScript colorSequence.clear(); playableSequence.clear(); playerSequence.clear(); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, large ? 2.0f : 1.0f); + me->SetObjectScale(large ? 2.0f : 1.0f); std::list ClusterList; Trinity::AllWorldObjectsInRange objects(me, searchDistance); -- cgit v1.2.3 From 0e8889415d0c28b23666ee3329deed2b94ce3b3e Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Thu, 14 Jun 2012 17:33:46 +0200 Subject: Core/Chat: Convert instance commands in commandscript --- src/server/game/Chat/Chat.cpp | 10 -- src/server/game/Chat/Chat.h | 5 - src/server/game/Chat/Commands/Level3.cpp | 126 ------------------ src/server/game/Scripting/ScriptLoader.cpp | 2 + src/server/scripts/Commands/CMakeLists.txt | 2 +- src/server/scripts/Commands/cs_instance.cpp | 193 ++++++++++++++++++++++++++++ 6 files changed, 196 insertions(+), 142 deletions(-) create mode 100644 src/server/scripts/Commands/cs_instance.cpp (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index cc64a8e22dd..72011a339f8 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -156,15 +156,6 @@ ChatCommand* ChatHandler::getCommandTable() { NULL, 0, false, NULL, "", NULL } }; - static ChatCommand instanceCommandTable[] = - { - { "listbinds", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleInstanceListBindsCommand>, "", NULL }, - { "unbind", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleInstanceUnbindCommand>, "", NULL }, - { "stats", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleInstanceStatsCommand>, "", NULL }, - { "savedata", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleInstanceSaveDataCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - static ChatCommand listCommandTable[] = { { "creature", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleListCreatureCommand>, "", NULL }, @@ -339,7 +330,6 @@ ChatCommand* ChatHandler::getCommandTable() { "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable }, { "cast", SEC_ADMINISTRATOR, false, NULL, "", castCommandTable }, { "reset", SEC_ADMINISTRATOR, true, NULL, "", resetCommandTable }, - { "instance", SEC_ADMINISTRATOR, true, NULL, "", instanceCommandTable }, { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable }, { "channel", SEC_ADMINISTRATOR, true, NULL, "", channelCommandTable }, diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index e88914a2daf..0a5cd9391f6 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -180,11 +180,6 @@ class ChatHandler bool HandleGuildRankCommand(const char* args); bool HandleGuildDeleteCommand(const char* args); - bool HandleInstanceListBindsCommand(const char* args); - bool HandleInstanceUnbindCommand(const char* args); - bool HandleInstanceStatsCommand(const char* args); - bool HandleInstanceSaveDataCommand(const char * args); - bool HandleListAurasCommand(const char * args); bool HandleListCreatureCommand(const char* args); bool HandleListItemCommand(const char* args); diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 4b2f1c5e7bb..4decc7a523f 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -4096,132 +4096,6 @@ bool ChatHandler::HandleCastSelfCommand(const char *args) return true; } -std::string GetTimeString(uint64 time) -{ - uint64 days = time / DAY, hours = (time % DAY) / HOUR, minute = (time % HOUR) / MINUTE; - std::ostringstream ss; - if (days) ss << days << "d "; - if (hours) ss << hours << "h "; - ss << minute << 'm'; - return ss.str(); -} - -bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/) -{ - Player* player = getSelectedPlayer(); - if (!player) player = m_session->GetPlayer(); - uint32 counter = 0; - for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) - { - Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i)); - for (Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr) - { - InstanceSave* save = itr->second.save; - std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); - PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); - counter++; - } - } - PSendSysMessage("player binds: %d", counter); - counter = 0; - Group* group = player->GetGroup(); - if (group) - { - for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) - { - Group::BoundInstancesMap &binds = group->GetBoundInstances(Difficulty(i)); - for (Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr) - { - InstanceSave* save = itr->second.save; - std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); - PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); - counter++; - } - } - } - PSendSysMessage("group binds: %d", counter); - - return true; -} - -bool ChatHandler::HandleInstanceUnbindCommand(const char *args) -{ - if (!*args) - return false; - - Player* player = getSelectedPlayer(); - if (!player) - player = m_session->GetPlayer(); - - char* map = strtok((char*)args, " "); - char* pDiff = strtok(NULL, " "); - int8 diff = -1; - if (pDiff) - diff = atoi(pDiff); - uint16 counter = 0; - uint16 MapId = 0; - - if (strcmp(map, "all")) - { - MapId = uint16(atoi(map)); - if (!MapId) - return false; - } - - for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) - { - Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i)); - for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();) - { - InstanceSave* save = itr->second.save; - if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficulty())) - { - std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); - PSendSysMessage("unbinding map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); - player->UnbindInstance(itr, Difficulty(i)); - counter++; - } - else - ++itr; - } - } - PSendSysMessage("instances unbound: %d", counter); - return true; -} - -bool ChatHandler::HandleInstanceStatsCommand(const char* /*args*/) -{ - PSendSysMessage("instances loaded: %d", sMapMgr->GetNumInstances()); - PSendSysMessage("players in instances: %d", sMapMgr->GetNumPlayersInInstances()); - PSendSysMessage("instance saves: %d", sInstanceSaveMgr->GetNumInstanceSaves()); - PSendSysMessage("players bound: %d", sInstanceSaveMgr->GetNumBoundPlayersTotal()); - PSendSysMessage("groups bound: %d", sInstanceSaveMgr->GetNumBoundGroupsTotal()); - return true; -} - -bool ChatHandler::HandleInstanceSaveDataCommand(const char * /*args*/) -{ - Player* player = m_session->GetPlayer(); - - Map* map = player->GetMap(); - if (!map->IsDungeon()) - { - PSendSysMessage("Map is not a dungeon."); - SetSentErrorMessage(true); - return false; - } - - if (!((InstanceMap*)map)->GetInstanceScript()) - { - PSendSysMessage("Map has no instance data."); - SetSentErrorMessage(true); - return false; - } - - ((InstanceMap*)map)->GetInstanceScript()->SaveToDB(); - return true; -} - /// Define the 'Message of the day' for the realm bool ChatHandler::HandleServerSetMotdCommand(const char *args) { diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index f64d0953e86..a1a23ca7074 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -52,6 +52,7 @@ void AddSC_gm_commandscript(); void AddSC_go_commandscript(); void AddSC_gobject_commandscript(); void AddSC_honor_commandscript(); +void AddSC_instance_commandscript(); void AddSC_learn_commandscript(); void AddSC_misc_commandscript(); void AddSC_modify_commandscript(); @@ -654,6 +655,7 @@ void AddCommandScripts() AddSC_go_commandscript(); AddSC_gobject_commandscript(); AddSC_honor_commandscript(); + AddSC_instance_commandscript(); AddSC_learn_commandscript(); AddSC_misc_commandscript(); AddSC_modify_commandscript(); diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index 86fe984e197..867d54a3cc6 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -18,6 +18,7 @@ set(scripts_STAT_SRCS Commands/cs_go.cpp Commands/cs_gobject.cpp Commands/cs_honor.cpp + Commands/cs_instance.cpp Commands/cs_learn.cpp Commands/cs_misc.cpp Commands/cs_modify.cpp @@ -34,7 +35,6 @@ set(scripts_STAT_SRCS # Commands/cs_guild.cpp # Commands/cs_cast.cpp # Commands/cs_reset.cpp -# Commands/cs_instance.cpp # Commands/cs_server.cpp # Commands/cs_channel.cpp # Commands/cs_pet.cpp diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp new file mode 100644 index 00000000000..127a3848ebc --- /dev/null +++ b/src/server/scripts/Commands/cs_instance.cpp @@ -0,0 +1,193 @@ +/* + * 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: instance_commandscript +%Complete: 100 +Comment: All instance related commands +Category: commandscripts +EndScriptData */ + +#include "ScriptMgr.h" +#include "Chat.h" +#include "Group.h" +#include "InstanceSaveMgr.h" +#include "InstanceScript.h" +#include "MapManager.h" + +class instance_commandscript : public CommandScript +{ +public: + instance_commandscript() : CommandScript("instance_commandscript") { } + + ChatCommand* GetCommands() const + { + static ChatCommand instanceCommandTable[] = + { + { "listbinds", SEC_ADMINISTRATOR, false, &HandleInstanceListBindsCommand, "", NULL }, + { "unbind", SEC_ADMINISTRATOR, false, &HandleInstanceUnbindCommand, "", NULL }, + { "stats", SEC_ADMINISTRATOR, true, &HandleInstanceStatsCommand, "", NULL }, + { "savedata", SEC_ADMINISTRATOR, false, &HandleInstanceSaveDataCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand commandTable[] = + { + { "instance", SEC_ADMINISTRATOR, true, NULL, "", instanceCommandTable }, + { NULL, 0, false, NULL, "", NULL } + }; + + return commandTable; + } + + static std::string GetTimeString(uint64 time) + { + uint64 days = time / DAY, hours = (time % DAY) / HOUR, minute = (time % HOUR) / MINUTE; + std::ostringstream ss; + if (days) + ss << days << "d "; + if (hours) + ss << hours << "h "; + ss << minute << 'm'; + return ss.str(); + } + + static bool HandleInstanceListBindsCommand(ChatHandler* handler, char const* args) + { + Player* player = handler->getSelectedPlayer(); + if (!player) + player = handler->GetSession()->GetPlayer(); + + uint32 counter = 0; + for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) + { + Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i)); + for (Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr) + { + InstanceSave* save = itr->second.save; + std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); + handler->PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); + counter++; + } + } + handler->PSendSysMessage("player binds: %d", counter); + + counter = 0; + if (Group* group = player->GetGroup()) + { + for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) + { + Group::BoundInstancesMap &binds = group->GetBoundInstances(Difficulty(i)); + for (Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr) + { + InstanceSave* save = itr->second.save; + std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); + handler->PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); + counter++; + } + } + } + handler->PSendSysMessage("group binds: %d", counter); + + return true; + } + + static bool HandleInstanceUnbindCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + Player* player = handler->getSelectedPlayer(); + if (!player) + player = handler->GetSession()->GetPlayer(); + + char* map = strtok((char*)args, " "); + char* pDiff = strtok(NULL, " "); + int8 diff = -1; + if (pDiff) + diff = atoi(pDiff); + uint16 counter = 0; + uint16 MapId = 0; + + if (strcmp(map, "all")) + { + MapId = uint16(atoi(map)); + if (!MapId) + return false; + } + + for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) + { + Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i)); + for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();) + { + InstanceSave* save = itr->second.save; + if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficulty())) + { + std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); + handler->PSendSysMessage("unbinding map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); + player->UnbindInstance(itr, Difficulty(i)); + counter++; + } + else + ++itr; + } + } + handler->PSendSysMessage("instances unbound: %d", counter); + + return true; + } + + static bool HandleInstanceStatsCommand(ChatHandler* handler, char const* /*args*/) + { + handler->PSendSysMessage("instances loaded: %d", sMapMgr->GetNumInstances()); + handler->PSendSysMessage("players in instances: %d", sMapMgr->GetNumPlayersInInstances()); + handler->PSendSysMessage("instance saves: %d", sInstanceSaveMgr->GetNumInstanceSaves()); + handler->PSendSysMessage("players bound: %d", sInstanceSaveMgr->GetNumBoundPlayersTotal()); + handler->PSendSysMessage("groups bound: %d", sInstanceSaveMgr->GetNumBoundGroupsTotal()); + + return true; + } + + static bool HandleInstanceSaveDataCommand(ChatHandler* handler, char const* /*args*/) + { + Player* player = handler->GetSession()->GetPlayer(); + Map* map = player->GetMap(); + if (!map->IsDungeon()) + { + handler->PSendSysMessage("Map is not a dungeon."); + handler->SetSentErrorMessage(true); + return false; + } + + if (!((InstanceMap*)map)->GetInstanceScript()) + { + handler->PSendSysMessage("Map has no instance data."); + handler->SetSentErrorMessage(true); + return false; + } + + ((InstanceMap*)map)->GetInstanceScript()->SaveToDB(); + + return true; + } +}; + +void AddSC_instance_commandscript() +{ + new instance_commandscript(); +} -- cgit v1.2.3 From 32d3e33f87318c508a297851adc64f696953ca1d Mon Sep 17 00:00:00 2001 From: Abdollah Hasan Date: Mon, 18 Jun 2012 04:54:50 +0300 Subject: Core/Commands: Update TeleDel command to support id, shift click, or name of teleport location. --- src/server/scripts/Commands/cs_tele.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index ca7c3af7fde..cd143eacb50 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -97,15 +97,16 @@ public: if (!*args) return false; - std::string name = args; - - if (!sObjectMgr->DeleteGameTele(name)) - { - handler->SendSysMessage(LANG_COMMAND_TELE_NOTFOUND); + // id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r + GameTele const* tele = handler->extractGameTeleFromLink((char*)args); + if (!tele) + { + handler->SendSysMessage(LANG_COMMAND_TELE_NOTFOUND); handler->SetSentErrorMessage(true); return false; - } - + } + std::string name = tele->name; + sObjectMgr->DeleteGameTele(name); handler->SendSysMessage(LANG_COMMAND_TP_DELETED); return true; } -- cgit v1.2.3 From b3d99e968f03f1085c8a0a50267ebd4832c29471 Mon Sep 17 00:00:00 2001 From: Abdollah Hasan Date: Mon, 18 Jun 2012 05:16:00 +0300 Subject: Core/Commands: TeleDel command cleanup. --- src/server/scripts/Commands/cs_tele.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index cd143eacb50..8f390d17cd4 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -97,16 +97,16 @@ public: if (!*args) return false; - // id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r + // id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r GameTele const* tele = handler->extractGameTeleFromLink((char*)args); - if (!tele) - { - handler->SendSysMessage(LANG_COMMAND_TELE_NOTFOUND); + if (!tele) + { + handler->SendSysMessage(LANG_COMMAND_TELE_NOTFOUND); handler->SetSentErrorMessage(true); return false; - } + } std::string name = tele->name; - sObjectMgr->DeleteGameTele(name); + sObjectMgr->DeleteGameTele(name); handler->SendSysMessage(LANG_COMMAND_TP_DELETED); return true; } -- cgit v1.2.3 From c19f13e6fcf48650888254a759bfd4a9c17a26c6 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Mon, 18 Jun 2012 15:00:45 +0200 Subject: Core/Commands: Convert cast commands in commandscript --- src/server/game/Chat/Chat.cpp | 12 -- src/server/game/Chat/Chat.h | 7 - src/server/game/Chat/Commands/Level3.cpp | 256 ------------------------ src/server/game/Scripting/ScriptLoader.cpp | 2 + src/server/scripts/Commands/CMakeLists.txt | 2 +- src/server/scripts/Commands/cs_cast.cpp | 310 +++++++++++++++++++++++++++++ 6 files changed, 313 insertions(+), 276 deletions(-) create mode 100644 src/server/scripts/Commands/cs_cast.cpp (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 72011a339f8..7d23b14110b 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -92,17 +92,6 @@ ChatCommand* ChatHandler::getCommandTable() { NULL, 0, false, NULL, "", NULL } }; - static ChatCommand castCommandTable[] = - { - { "back", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastBackCommand>, "", NULL }, - { "dist", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastDistCommand>, "", NULL }, - { "self", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastSelfCommand>, "", NULL }, - { "target", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastTargetCommand>, "", NULL }, - { "dest", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastDestCommand>, "", NULL }, - { "", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - static ChatCommand characterDeletedCommandTable[] = { { "delete", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleCharacterDeletedDeleteCommand>, "", NULL }, @@ -328,7 +317,6 @@ ChatCommand* ChatHandler::getCommandTable() { "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 }, { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable }, diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index 0a5cd9391f6..1612de741a6 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -147,13 +147,6 @@ class ChatHandler bool HandleBanListCharacterCommand(const char* args); bool HandleBanListIPCommand(const char* args); - bool HandleCastCommand(const char *args); - bool HandleCastBackCommand(const char *args); - bool HandleCastDistCommand(const char *args); - bool HandleCastSelfCommand(const char *args); - bool HandleCastTargetCommand(const char *args); - bool HandleCastDestCommand(const char *args); - bool HandleCharacterCustomizeCommand(const char* args); bool HandleCharacterChangeFactionCommand(const char* args); bool HandleCharacterChangeRaceCommand(const char * args); diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 4decc7a523f..3898232fa40 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -3814,227 +3814,6 @@ bool ChatHandler::HandleServerPLimitCommand(const char *args) return true; } -bool ChatHandler::HandleCastCommand(const char *args) -{ - if (!*args) - return false; - - Unit* target = getSelectedUnit(); - - if (!target) - { - SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - SetSentErrorMessage(true); - return false; - } - - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint32 spell = extractSpellIdFromLink((char*)args); - if (!spell) - return false; - - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell); - if (!spellInfo) - { - PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); - SetSentErrorMessage(true); - return false; - } - - if (!SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer())) - { - PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell); - SetSentErrorMessage(true); - return false; - } - - char* trig_str = strtok(NULL, " "); - if (trig_str) - { - int l = strlen(trig_str); - if (strncmp(trig_str, "triggered", l) != 0) - return false; - } - - bool triggered = (trig_str != NULL); - - m_session->GetPlayer()->CastSpell(target, spell, triggered); - - return true; -} - -bool ChatHandler::HandleCastBackCommand(const char *args) -{ - Creature* caster = getSelectedCreature(); - - if (!caster) - { - SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - SetSentErrorMessage(true); - return false; - } - - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint32 spell = extractSpellIdFromLink((char*)args); - if (!spell || !sSpellMgr->GetSpellInfo(spell)) - { - PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); - SetSentErrorMessage(true); - return false; - } - - char* trig_str = strtok(NULL, " "); - if (trig_str) - { - int l = strlen(trig_str); - if (strncmp(trig_str, "triggered", l) != 0) - return false; - } - - bool triggered = (trig_str != NULL); - - caster->CastSpell(m_session->GetPlayer(), spell, triggered); - - return true; -} - -bool ChatHandler::HandleCastDistCommand(const char *args) -{ - if (!*args) - return false; - - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint32 spell = extractSpellIdFromLink((char*)args); - if (!spell) - return false; - - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell); - if (!spellInfo) - { - PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); - SetSentErrorMessage(true); - return false; - } - - if (!SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer())) - { - PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell); - SetSentErrorMessage(true); - return false; - } - - char *distStr = strtok(NULL, " "); - - float dist = 0; - - if (distStr) - sscanf(distStr, "%f", &dist); - - char* trig_str = strtok(NULL, " "); - if (trig_str) - { - int l = strlen(trig_str); - if (strncmp(trig_str, "triggered", l) != 0) - return false; - } - - bool triggered = (trig_str != NULL); - - float x, y, z; - m_session->GetPlayer()->GetClosePoint(x, y, z, dist); - - m_session->GetPlayer()->CastSpell(x, y, z, spell, triggered); - return true; -} - -bool ChatHandler::HandleCastTargetCommand(const char *args) -{ - Creature* caster = getSelectedCreature(); - - if (!caster) - { - SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - SetSentErrorMessage(true); - return false; - } - - if (!caster->getVictim()) - { - SendSysMessage(LANG_SELECTED_TARGET_NOT_HAVE_VICTIM); - SetSentErrorMessage(true); - return false; - } - - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint32 spell = extractSpellIdFromLink((char*)args); - if (!spell || !sSpellMgr->GetSpellInfo(spell)) - { - PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); - SetSentErrorMessage(true); - return false; - } - - char* trig_str = strtok(NULL, " "); - if (trig_str) - { - int l = strlen(trig_str); - if (strncmp(trig_str, "triggered", l) != 0) - return false; - } - - bool triggered = (trig_str != NULL); - - caster->CastSpell(caster->getVictim(), spell, triggered); - - return true; -} - -bool ChatHandler::HandleCastDestCommand(const char *args) -{ - Unit* caster = getSelectedUnit(); - if (!caster) - { - SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - SetSentErrorMessage(true); - return false; - } - - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint32 spell = extractSpellIdFromLink((char*)args); - if (!spell || !sSpellMgr->GetSpellInfo(spell)) - { - PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); - SetSentErrorMessage(true); - return false; - } - - char* px = strtok(NULL, " "); - char* py = strtok(NULL, " "); - char* pz = strtok(NULL, " "); - - if (!px || !py || !pz) - return false; - - float x = (float)atof(px); - float y = (float)atof(py); - float z = (float)atof(pz); - - char* trig_str = strtok(NULL, " "); - if (trig_str) - { - int l = strlen(trig_str); - if (strncmp(trig_str, "triggered", l) != 0) - return false; - } - - bool triggered = (trig_str != NULL); - - caster->CastSpell(x, y, z, spell, triggered); - - 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) @@ -4061,41 +3840,6 @@ bool ChatHandler::HandleComeToMeCommand(const char *args) return true; } -bool ChatHandler::HandleCastSelfCommand(const char *args) -{ - if (!*args) - return false; - - Unit* target = getSelectedUnit(); - - if (!target) - { - SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - SetSentErrorMessage(true); - return false; - } - - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint32 spell = extractSpellIdFromLink((char*)args); - if (!spell) - return false; - - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell); - if (!spellInfo) - return false; - - if (!SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer())) - { - PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell); - SetSentErrorMessage(true); - return false; - } - - target->CastSpell(target, spell, false); - - return true; -} - /// Define the 'Message of the day' for the realm bool ChatHandler::HandleServerSetMotdCommand(const char *args) { diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index a1a23ca7074..8bc4ce24665 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -46,6 +46,7 @@ void AddSC_SmartSCripts(); //Commands void AddSC_account_commandscript(); void AddSC_achievement_commandscript(); +void AddSC_cast_commandscript(); void AddSC_debug_commandscript(); void AddSC_event_commandscript(); void AddSC_gm_commandscript(); @@ -649,6 +650,7 @@ void AddCommandScripts() { AddSC_account_commandscript(); AddSC_achievement_commandscript(); + AddSC_cast_commandscript(); AddSC_debug_commandscript(); AddSC_event_commandscript(); AddSC_gm_commandscript(); diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index 867d54a3cc6..77d42ac5fd1 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -12,6 +12,7 @@ set(scripts_STAT_SRCS ${scripts_STAT_SRCS} Commands/cs_account.cpp Commands/cs_achievement.cpp + Commands/cs_cast.cpp Commands/cs_debug.cpp Commands/cs_event.cpp Commands/cs_gm.cpp @@ -33,7 +34,6 @@ set(scripts_STAT_SRCS # Commands/cs_lookup.cpp # Commands/cs_pdump.cpp # Commands/cs_guild.cpp -# Commands/cs_cast.cpp # Commands/cs_reset.cpp # Commands/cs_server.cpp # Commands/cs_channel.cpp diff --git a/src/server/scripts/Commands/cs_cast.cpp b/src/server/scripts/Commands/cs_cast.cpp new file mode 100644 index 00000000000..33983411427 --- /dev/null +++ b/src/server/scripts/Commands/cs_cast.cpp @@ -0,0 +1,310 @@ +/* + * 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: cast_commandscript +%Complete: 100 +Comment: All cast related commands +Category: commandscripts +EndScriptData */ + +#include "ScriptMgr.h" +#include "Chat.h" + +class cast_commandscript : public CommandScript +{ +public: + cast_commandscript() : CommandScript("cast_commandscript") { } + + ChatCommand* GetCommands() const + { + static ChatCommand castCommandTable[] = + { + { "back", SEC_ADMINISTRATOR, false, &HandleCastBackCommand, "", NULL }, + { "dist", SEC_ADMINISTRATOR, false, &HandleCastDistCommand, "", NULL }, + { "self", SEC_ADMINISTRATOR, false, &HandleCastSelfCommand, "", NULL }, + { "target", SEC_ADMINISTRATOR, false, &HandleCastTargetCommad, "", NULL }, + { "dest", SEC_ADMINISTRATOR, false, &HandleCastDestCommand, "", NULL }, + { "", SEC_ADMINISTRATOR, false, &HandleCastCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + static ChatCommand commandTable[] = + { + { "cast", SEC_ADMINISTRATOR, false, NULL, "", castCommandTable }, + { NULL, 0, false, NULL, "", NULL } + }; + return commandTable; + } + + static bool HandleCastCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + 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 (!spellId) + return false; + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); + if (!spellInfo) + { + handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); + handler->SetSentErrorMessage(true); + return false; + } + + if (!SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer())) + { + handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId); + handler->SetSentErrorMessage(true); + return false; + } + + char* triggeredStr = strtok(NULL, " "); + if (triggeredStr) + { + int l = strlen(triggeredStr); + if (strncmp(triggeredStr, "triggered", l) != 0) + return false; + } + + bool triggered = (triggeredStr != NULL); + + handler->GetSession()->GetPlayer()->CastSpell(target, spellId, triggered); + + return true; + } + + static bool HandleCastBackCommand(ChatHandler* handler, char const* args) + { + Creature* caster = handler->getSelectedCreature(); + if (!caster) + { + 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 + // 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)) + { + handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); + handler->SetSentErrorMessage(true); + return false; + } + + char* triggeredStr = strtok(NULL, " "); + if (triggeredStr) + { + int l = strlen(triggeredStr); + if (strncmp(triggeredStr, "triggered", l) != 0) + return false; + } + + bool triggered = (triggeredStr != NULL); + + caster->CastSpell(handler->GetSession()->GetPlayer(), spellId, triggered); + + return true; + } + + static bool HandleCastDistCommand(ChatHandler* handler, char const* args) + { + if (!*args) + 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 (!spellId) + return false; + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); + if (!spellInfo) + { + handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); + handler->SetSentErrorMessage(true); + return false; + } + + if (!SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer())) + { + handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId); + handler->SetSentErrorMessage(true); + return false; + } + + char* distStr = strtok(NULL, " "); + + float dist = 0; + + if (distStr) + sscanf(distStr, "%f", &dist); + + char* triggeredStr = strtok(NULL, " "); + if (triggeredStr) + { + int l = strlen(triggeredStr); + if (strncmp(triggeredStr, "triggered", l) != 0) + return false; + } + + bool triggered = (triggeredStr != NULL); + + float x, y, z; + handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, dist); + + handler->GetSession()->GetPlayer()->CastSpell(x, y, z, spellId, triggered); + + return true; + } + + static bool HandleCastSelfCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + 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 (!spellId) + return false; + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); + if (!spellInfo) + return false; + + if (!SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer())) + { + handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId); + handler->SetSentErrorMessage(true); + return false; + } + + target->CastSpell(target, spellId, false); + + return true; + } + + static bool HandleCastTargetCommad(ChatHandler* handler, char const* args) + { + Creature* caster = handler->getSelectedCreature(); + if (!caster) + { + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + if (!caster->getVictim()) + { + handler->SendSysMessage(LANG_SELECTED_TARGET_NOT_HAVE_VICTIM); + 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 (!spellId || !sSpellMgr->GetSpellInfo(spellId)) + { + handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); + handler->SetSentErrorMessage(true); + return false; + } + + char* triggeredStr = strtok(NULL, " "); + if (triggeredStr) + { + int l = strlen(triggeredStr); + if (strncmp(triggeredStr, "triggered", l) != 0) + return false; + } + + bool triggered = (triggeredStr != NULL); + + caster->CastSpell(caster->getVictim(), spellId, triggered); + + return true; + } + + static bool HandleCastDestCommand(ChatHandler* handler, char const* args) + { + Unit* caster = handler->getSelectedUnit(); + if (!caster) + { + 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 (!spellId || !sSpellMgr->GetSpellInfo(spellId)) + { + handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND); + handler->SetSentErrorMessage(true); + return false; + } + + char* posX = strtok(NULL, " "); + char* posY = strtok(NULL, " "); + char* posZ = strtok(NULL, " "); + + if (!posX || !posY || !posZ) + return false; + + float x = float(atof(posX)); + float y = float(atof(posY)); + float z = float(atof(posZ)); + + char* triggeredStr = strtok(NULL, " "); + if (triggeredStr) + { + int l = strlen(triggeredStr); + if (strncmp(triggeredStr, "triggered", l) != 0) + return false; + } + + bool triggered = (triggeredStr != NULL); + + caster->CastSpell(x, y, z, spellId, triggered); + + return true; + } +}; + +void AddSC_cast_commandscript() +{ + new cast_commandscript(); +} -- cgit v1.2.3 From a312cd4ba1f47d3dceb774091ec143c90a298cda Mon Sep 17 00:00:00 2001 From: Xees Date: Wed, 20 Jun 2012 23:28:16 +0100 Subject: Scripts/Commands: Convert character and server commands to commandscript Closes #6856 Signed-off-by: Nay --- src/server/game/Chat/Chat.cpp | 79 --- src/server/game/Chat/Chat.h | 59 +- src/server/game/Chat/Commands/Level0.cpp | 30 - src/server/game/Chat/Commands/Level2.cpp | 231 ------- src/server/game/Chat/Commands/Level3.cpp | 266 -------- src/server/game/Scripting/ScriptLoader.cpp | 4 + src/server/scripts/Commands/CMakeLists.txt | 3 +- src/server/scripts/Commands/cs_character.cpp | 680 +++++++++++++++++++++ src/server/scripts/Commands/cs_server.cpp | 430 +++++++++++++ src/server/scripts/Kalimdor/ashenvale.cpp | 6 +- src/server/worldserver/CommandLine/CliRunnable.cpp | 452 -------------- 11 files changed, 1126 insertions(+), 1114 deletions(-) create mode 100644 src/server/scripts/Commands/cs_character.cpp create mode 100644 src/server/scripts/Commands/cs_server.cpp (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 7d23b14110b..f96199f9bd3 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -92,29 +92,6 @@ ChatCommand* ChatHandler::getCommandTable() { NULL, 0, false, NULL, "", NULL } }; - static ChatCommand characterDeletedCommandTable[] = - { - { "delete", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleCharacterDeletedDeleteCommand>, "", NULL }, - { "list", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleCharacterDeletedListCommand>, "", NULL }, - { "restore", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleCharacterDeletedRestoreCommand>, "", NULL }, - { "old", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleCharacterDeletedOldCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - - static ChatCommand characterCommandTable[] = - { - { "customize", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterCustomizeCommand>, "", NULL }, - { "changefaction", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterChangeFactionCommand>, "", NULL }, - { "changerace", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterChangeRaceCommand>, "", NULL }, - { "deleted", SEC_GAMEMASTER, true, NULL, "", characterDeletedCommandTable}, - { "erase", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleCharacterEraseCommand>, "", NULL }, - { "level", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleCharacterLevelCommand>, "", NULL }, - { "rename", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterRenameCommand>, "", NULL }, - { "reputation", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterReputationCommand>, "", NULL }, - { "titles", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterTitlesCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - static ChatCommand channelSetCommandTable[] = { { "ownership", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleChannelSetOwnership>, "", NULL }, @@ -218,60 +195,6 @@ ChatCommand* ChatHandler::getCommandTable() { NULL, 0, false, NULL, "", NULL } }; - static ChatCommand serverIdleRestartCommandTable[] = - { - { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL }, - { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerIdleRestartCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - - static ChatCommand serverIdleShutdownCommandTable[] = - { - { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL }, - { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerIdleShutDownCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - - static ChatCommand serverRestartCommandTable[] = - { - { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL }, - { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerRestartCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - - static ChatCommand serverShutdownCommandTable[] = - { - { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL }, - { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - - static ChatCommand serverSetCommandTable[] = - { - { "difftime", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerSetDiffTimeCommand>, "", NULL }, - { "loglevel", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerSetLogLevelCommand>, "", NULL }, - { "logfilelevel", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerSetLogFileLevelCommand>, "", NULL }, - { "motd", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerSetMotdCommand>, "", NULL }, - { "closed", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerSetClosedCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - - static ChatCommand serverCommandTable[] = - { - { "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, "", 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 }, - { "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable }, - { "shutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable }, - { "set", SEC_ADMINISTRATOR, true, NULL, "", serverSetCommandTable }, - { "togglequerylog", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerToggleQueryLogging>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - static ChatCommand unbanCommandTable[] = { { "account", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleUnBanAccountCommand>, "", NULL }, @@ -311,14 +234,12 @@ ChatCommand* ChatHandler::getCommandTable() static ChatCommand commandTable[] = { - { "character", SEC_GAMEMASTER, true, NULL, "", characterCommandTable}, { "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable }, { "lookup", SEC_ADMINISTRATOR, true, NULL, "", lookupCommandTable }, { "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable }, { "guild", SEC_ADMINISTRATOR, true, NULL, "", guildCommandTable }, { "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable }, { "reset", SEC_ADMINISTRATOR, true, NULL, "", resetCommandTable }, - { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable }, { "channel", SEC_ADMINISTRATOR, true, NULL, "", channelCommandTable }, diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index 1612de741a6..c43b0fa9aca 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -119,10 +119,13 @@ class ChatHandler GameObject* GetNearbyGameObject(); GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid, uint32 entry); - bool HasSentErrorMessage() const { return sentErrorMessage;} - void SetSentErrorMessage(bool val){ sentErrorMessage = val;}; - static bool LoadCommandTable() { return load_command_table;} - static void SetLoadCommandTable(bool val){ load_command_table = val;}; + bool HasSentErrorMessage() const { return sentErrorMessage; } + 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); protected: explicit ChatHandler() : m_session(NULL) {} // for CLI subclass @@ -147,19 +150,6 @@ class ChatHandler bool HandleBanListCharacterCommand(const char* args); bool HandleBanListIPCommand(const char* args); - bool HandleCharacterCustomizeCommand(const char* args); - bool HandleCharacterChangeFactionCommand(const char* args); - bool HandleCharacterChangeRaceCommand(const char * args); - bool HandleCharacterDeletedDeleteCommand(const char* args); - bool HandleCharacterDeletedListCommand(const char* args); - bool HandleCharacterDeletedRestoreCommand(const char* args); - bool HandleCharacterDeletedOldCommand(const char* args); - bool HandleCharacterEraseCommand(const char* args); - bool HandleCharacterLevelCommand(const char* args); - bool HandleCharacterRenameCommand(const char* args); - bool HandleCharacterReputationCommand(const char* args); - bool HandleCharacterTitlesCommand(const char* args); - bool HandleChannelSetOwnership(const char *args); bool HandlePossessCommand(const char* args); @@ -212,24 +202,6 @@ class ChatHandler bool HandleSendMessageCommand(const char * args); bool HandleSendMoneyCommand(const char* args); - bool HandleServerCorpsesCommand(const char* args); - bool HandleServerExitCommand(const char* args); - bool HandleServerIdleRestartCommand(const char* args); - bool HandleServerIdleShutDownCommand(const char* args); - bool HandleServerInfoCommand(const char* args); - bool HandleServerMotdCommand(const char* args); - bool HandleServerPLimitCommand(const char* args); - bool HandleServerRestartCommand(const char* args); - bool HandleServerSetLogLevelCommand(const char* args); - bool HandleServerSetMotdCommand(const char* args); - bool HandleServerShutDownCommand(const char* args); - bool HandleServerShutDownCancelCommand(const char* args); - bool HandleServerSetClosedCommand(const char* args); - bool HandleServerToggleQueryLogging(const char* args); - - bool HandleServerSetLogFileLevelCommand(const char* args); - bool HandleServerSetDiffTimeCommand(const char* args); - bool HandleUnBanAccountCommand(const char* args); bool HandleUnBanAccountByCharCommand(const char* args); bool HandleUnBanCharacterCommand(const char* args); @@ -342,25 +314,8 @@ class ChatHandler bool HandleBanHelper(BanMode mode, char const* args); bool HandleBanInfoHelper(uint32 accountid, char const* accountname); bool HandleUnBanHelper(BanMode mode, char const* args); - void HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 oldLevel, uint32 newLevel); void HandleLearnSkillRecipesHelper(Player* player, uint32 skill_id); - // Stores informations about a deleted character - struct DeletedInfo - { - uint32 lowguid; ///< the low GUID from the character - std::string name; ///< the character name - uint32 accountId; ///< the account id - std::string accountName; ///< the account name - time_t deleteDate; ///< the date at which the character has been deleted - }; - - typedef std::list DeletedInfoList; - bool GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::string searchString = ""); - std::string GenerateDeletedCharacterGUIDsWhereStr(DeletedInfoList::const_iterator& itr, DeletedInfoList::const_iterator const& itr_end); - void HandleCharacterDeletedListHelper(DeletedInfoList const& foundList); - void HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo); - private: bool _HandleGMTicketResponseAppendCommand(const char* args, bool newLine); diff --git a/src/server/game/Chat/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp index b2ac090c313..b05ba9b4194 100755 --- a/src/server/game/Chat/Commands/Level0.cpp +++ b/src/server/game/Chat/Commands/Level0.cpp @@ -80,29 +80,6 @@ bool ChatHandler::HandleStartCommand(const char* /*args*/) return true; } -bool ChatHandler::HandleServerInfoCommand(const char* /*args*/) -{ - uint32 playersNum = sWorld->GetPlayerCount(); - uint32 maxPlayersNum = sWorld->GetMaxPlayerCount(); - uint32 activeClientsNum = sWorld->GetActiveSessionCount(); - uint32 queuedClientsNum = sWorld->GetQueuedSessionCount(); - uint32 maxActiveClientsNum = sWorld->GetMaxActiveSessionCount(); - uint32 maxQueuedClientsNum = sWorld->GetMaxQueuedSessionCount(); - std::string uptime = secsToTimeString(sWorld->GetUptime()); - uint32 updateTime = sWorld->GetUpdateTime(); - - SendSysMessage(_FULLVERSION); - PSendSysMessage(LANG_CONNECTED_PLAYERS, playersNum, maxPlayersNum); - PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum); - PSendSysMessage(LANG_UPTIME, uptime.c_str()); - PSendSysMessage(LANG_UPDATE_DIFF, updateTime); - //! Can't use sWorld->ShutdownMsg here in case of console command - if (sWorld->IsShuttingDown()) - PSendSysMessage(LANG_SHUTDOWN_TIMELEFT, secsToTimeString(sWorld->GetShutDownTimeLeft()).c_str()); - - return true; -} - bool ChatHandler::HandleDismountCommand(const char* /*args*/) { Player* player = m_session->GetPlayer(); @@ -150,10 +127,3 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/) return true; } -/// Display the 'Message of the day' for the realm -bool ChatHandler::HandleServerMotdCommand(const char* /*args*/) -{ - PSendSysMessage(LANG_MOTD_CURRENT, sWorld->GetMotd()); - return true; -} - diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index 52bdcd15163..42a379753d5 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -456,190 +456,6 @@ bool ChatHandler::HandlePInfoCommand(const char* args) return true; } -//rename characters -bool ChatHandler::HandleCharacterRenameCommand(const char* args) -{ - Player* target; - uint64 targetGuid; - std::string targetName; - if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - return false; - - if (target) - { - // check online security - if (HasLowerSecurity(target, 0)) - return false; - - PSendSysMessage(LANG_RENAME_PLAYER, GetNameLink(target).c_str()); - target->SetAtLoginFlag(AT_LOGIN_RENAME); - } - else - { - // check offline security - if (HasLowerSecurity(NULL, targetGuid)) - return false; - - std::string oldNameLink = playerLink(targetName); - - PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); - - stmt->setUInt16(0, uint16(AT_LOGIN_RENAME)); - stmt->setUInt32(1, GUID_LOPART(targetGuid)); - - CharacterDatabase.Execute(stmt); - } - - return true; -} - -// customize characters -bool ChatHandler::HandleCharacterCustomizeCommand(const char* args) -{ - Player* target; - uint64 targetGuid; - std::string targetName; - if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - return false; - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); - - stmt->setUInt16(0, uint16(AT_LOGIN_CUSTOMIZE)); - - if (target) - { - PSendSysMessage(LANG_CUSTOMIZE_PLAYER, GetNameLink(target).c_str()); - target->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE); - - stmt->setUInt32(1, target->GetGUIDLow()); - } - else - { - std::string oldNameLink = playerLink(targetName); - - stmt->setUInt32(1, GUID_LOPART(targetGuid)); - - PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); - } - - CharacterDatabase.Execute(stmt); - - return true; -} - -bool ChatHandler::HandleCharacterChangeFactionCommand(const char* args) -{ - Player* target; - uint64 targetGuid; - std::string targetName; - - if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - return false; - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); - - stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_FACTION)); - - if (target) - { - PSendSysMessage(LANG_CUSTOMIZE_PLAYER, GetNameLink(target).c_str()); - target->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION); - - stmt->setUInt32(1, target->GetGUIDLow()); - } - else - { - std::string oldNameLink = playerLink(targetName); - - PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); - - stmt->setUInt32(1, GUID_LOPART(targetGuid)); - } - - CharacterDatabase.Execute(stmt); - - return true; -} - -bool ChatHandler::HandleCharacterChangeRaceCommand(const char * args) -{ - Player* target; - uint64 targetGuid; - std::string targetName; - if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - return false; - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); - - stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_RACE)); - - if (target) - { - // TODO : add text into database - PSendSysMessage(LANG_CUSTOMIZE_PLAYER, GetNameLink(target).c_str()); - target->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE); - - stmt->setUInt32(1, target->GetGUIDLow()); - } - else - { - std::string oldNameLink = playerLink(targetName); - - // TODO : add text into database - PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); - - stmt->setUInt32(1, GUID_LOPART(targetGuid)); - } - - CharacterDatabase.Execute(stmt); - - return true; -} - -bool ChatHandler::HandleCharacterReputationCommand(const char* args) -{ - Player* target; - if (!extractPlayerTarget((char*)args, &target)) - return false; - - LocaleConstant loc = GetSessionDbcLocale(); - - FactionStateList const& targetFSL = target->GetReputationMgr().GetStateList(); - for (FactionStateList::const_iterator itr = targetFSL.begin(); itr != targetFSL.end(); ++itr) - { - const FactionState& faction = itr->second; - FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID); - char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#"; - ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry); - std::string rankName = GetTrinityString(ReputationRankStrIndex[rank]); - std::ostringstream ss; - if (m_session) - ss << faction.ID << " - |cffffffff|Hfaction:" << faction.ID << "|h[" << factionName << ' ' << localeNames[loc] << "]|h|r"; - else - ss << faction.ID << " - " << factionName << ' ' << localeNames[loc]; - - ss << ' ' << rankName << " (" << target->GetReputationMgr().GetReputation(factionEntry) << ')'; - - if (faction.Flags & FACTION_FLAG_VISIBLE) - ss << GetTrinityString(LANG_FACTION_VISIBLE); - if (faction.Flags & FACTION_FLAG_AT_WAR) - ss << GetTrinityString(LANG_FACTION_ATWAR); - if (faction.Flags & FACTION_FLAG_PEACE_FORCED) - ss << GetTrinityString(LANG_FACTION_PEACE_FORCED); - if (faction.Flags & FACTION_FLAG_HIDDEN) - ss << GetTrinityString(LANG_FACTION_HIDDEN); - if (faction.Flags & FACTION_FLAG_INVISIBLE_FORCED) - ss << GetTrinityString(LANG_FACTION_INVISIBLE_FORCED); - if (faction.Flags & FACTION_FLAG_INACTIVE) - ss << GetTrinityString(LANG_FACTION_INACTIVE); - - SendSysMessage(ss.str().c_str()); - } - return true; -} - bool ChatHandler::HandleLookupEventCommand(const char* args) { if (!*args) @@ -846,13 +662,6 @@ bool ChatHandler::LookupPlayerSearchCommand(PreparedQueryResult result, int32 li return true; } -/// Triggering corpses expire check in world -bool ChatHandler::HandleServerCorpsesCommand(const char* /*args*/) -{ - sObjectAccessor->RemoveOldCorpses(); - return true; -} - bool ChatHandler::HandleRepairitemsCommand(const char* args) { Player* target; @@ -1128,43 +937,3 @@ bool ChatHandler::HandleLookupTitleCommand(const char* args) SendSysMessage(LANG_COMMAND_NOTITLEFOUND); return true; } - -bool ChatHandler::HandleCharacterTitlesCommand(const char* args) -{ - if (!*args) - return false; - - Player* target; - if (!extractPlayerTarget((char*)args, &target)) - return false; - - LocaleConstant loc = GetSessionDbcLocale(); - char const* targetName = target->GetName(); - char const* knownStr = GetTrinityString(LANG_KNOWN); - - // Search in CharTitles.dbc - for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++) - { - CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id); - if (titleInfo && target->HasTitle(titleInfo)) - { - std::string name = titleInfo->name[loc]; - if (name.empty()) - continue; - - char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index - ? GetTrinityString(LANG_ACTIVE) - : ""; - - char titleNameStr[80]; - snprintf(titleNameStr, 80, name.c_str(), targetName); - - // send title in "id (idx:idx) - [namedlink locale]" format - if (m_session) - PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr); - else - PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr); - } - } - return true; -} diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 3898232fa40..33855a96617 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -2198,47 +2198,6 @@ void ChatHandler::HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 } } -bool ChatHandler::HandleCharacterLevelCommand(const char *args) -{ - char* nameStr; - char* levelStr; - extractOptFirstArg((char*)args, &nameStr, &levelStr); - if (!levelStr) - return false; - - // exception opt second arg: .character level $name - if (isalpha(levelStr[0])) - { - nameStr = levelStr; - levelStr = NULL; // current level will used - } - - Player* target; - uint64 target_guid; - std::string target_name; - if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name)) - return false; - - int32 oldlevel = target ? target->getLevel() : Player::GetLevelFromDB(target_guid); - int32 newlevel = levelStr ? atoi(levelStr) : oldlevel; - - if (newlevel < 1) - return false; // invalid level - - if (newlevel > STRONG_MAX_LEVEL) // hardcoded maximum level - newlevel = STRONG_MAX_LEVEL; - - HandleCharacterLevel(target, target_guid, oldlevel, newlevel); - - if (!m_session || m_session->GetPlayer() != target) // including player == NULL - { - std::string nameLink = playerLink(target_name); - PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newlevel); - } - - return true; -} - bool ChatHandler::HandleLevelUpCommand(const char *args) { char* nameStr; @@ -2698,152 +2657,6 @@ bool ChatHandler::HandleResetAllCommand(const char * args) return true; } -bool ChatHandler::HandleServerShutDownCancelCommand(const char* /*args*/) -{ - sWorld->ShutdownCancel(); - return true; -} - -bool ChatHandler::HandleServerShutDownCommand(const char *args) -{ - if (!*args) - return false; - - char* time_str = strtok ((char*) args, " "); - char* exitcode_str = strtok (NULL, ""); - - int32 time = atoi (time_str); - - ///- Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) - return false; - - if (exitcode_str) - { - int32 exitcode = atoi (exitcode_str); - - // Handle atoi() errors - if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) - return false; - - // Exit code should be in range of 0-125, 126-255 is used - // in many shells for their own return codes and code > 255 - // is not supported in many others - if (exitcode < 0 || exitcode > 125) - return false; - - sWorld->ShutdownServ(time, 0, exitcode); - } - else - sWorld->ShutdownServ(time, 0, SHUTDOWN_EXIT_CODE); - return true; -} - -bool ChatHandler::HandleServerRestartCommand(const char *args) -{ - if (!*args) - return false; - - char* time_str = strtok ((char*) args, " "); - char* exitcode_str = strtok (NULL, ""); - - int32 time = atoi (time_str); - - ///- Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) - return false; - - if (exitcode_str) - { - int32 exitcode = atoi (exitcode_str); - - // Handle atoi() errors - if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) - return false; - - // Exit code should be in range of 0-125, 126-255 is used - // in many shells for their own return codes and code > 255 - // is not supported in many others - if (exitcode < 0 || exitcode > 125) - return false; - - sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, exitcode); - } - else - sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE); - return true; -} - -bool ChatHandler::HandleServerIdleRestartCommand(const char *args) -{ - if (!*args) - return false; - - char* time_str = strtok ((char*) args, " "); - char* exitcode_str = strtok (NULL, ""); - - int32 time = atoi (time_str); - - ///- Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) - return false; - - if (exitcode_str) - { - int32 exitcode = atoi (exitcode_str); - - // Handle atoi() errors - if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) - return false; - - // Exit code should be in range of 0-125, 126-255 is used - // in many shells for their own return codes and code > 255 - // is not supported in many others - if (exitcode < 0 || exitcode > 125) - return false; - - sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode); - } - else - sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE); - return true; -} - -bool ChatHandler::HandleServerIdleShutDownCommand(const char *args) -{ - if (!*args) - return false; - - char* time_str = strtok ((char*) args, " "); - char* exitcode_str = strtok (NULL, ""); - - int32 time = atoi (time_str); - - ///- Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) - return false; - - if (exitcode_str) - { - int32 exitcode = atoi (exitcode_str); - - // Handle atoi() errors - if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) - return false; - - // Exit code should be in range of 0-125, 126-255 is used - // in many shells for their own return codes and code > 255 - // is not supported in many others - if (exitcode < 0 || exitcode > 125) - return false; - - sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, exitcode); - } - else - sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE); - return true; -} - bool ChatHandler::HandleBanAccountCommand(const char *args) { return HandleBanHelper(BAN_ACCOUNT, args); @@ -3764,56 +3577,6 @@ bool ChatHandler::HandleMovegensCommand(const char* /*args*/) return true; } -bool ChatHandler::HandleServerPLimitCommand(const char *args) -{ - if (*args) - { - char* param = strtok((char*)args, " "); - if (!param) - return false; - - int l = strlen(param); - - if (strncmp(param, "player", l) == 0) - sWorld->SetPlayerSecurityLimit(SEC_PLAYER); - else if (strncmp(param, "moderator", l) == 0) - sWorld->SetPlayerSecurityLimit(SEC_MODERATOR); - else if (strncmp(param, "gamemaster", l) == 0) - sWorld->SetPlayerSecurityLimit(SEC_GAMEMASTER); - else if (strncmp(param, "administrator", l) == 0) - sWorld->SetPlayerSecurityLimit(SEC_ADMINISTRATOR); - else if (strncmp(param, "reset", l) == 0) - { - sWorld->SetPlayerAmountLimit(ConfigMgr::GetIntDefault("PlayerLimit", 100)); - sWorld->LoadDBAllowedSecurityLevel(); - } - else - { - int val = atoi(param); - if (val < 0) - sWorld->SetPlayerSecurityLimit(AccountTypes(uint32(-val))); - else - sWorld->SetPlayerAmountLimit(uint32(val)); - } - } - - uint32 pLimit = sWorld->GetPlayerAmountLimit(); - AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit(); - char const* secName = ""; - switch (allowedAccountType) - { - case SEC_PLAYER: secName = "Player"; break; - case SEC_MODERATOR: secName = "Moderator"; break; - case SEC_GAMEMASTER: secName = "Gamemaster"; break; - case SEC_ADMINISTRATOR: secName = "Administrator"; break; - default: secName = ""; break; - } - - PSendSysMessage("Player limits: amount %u, min. security level %s.", pLimit, secName); - - 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) @@ -3840,35 +3603,6 @@ bool ChatHandler::HandleComeToMeCommand(const char *args) return true; } -/// Define the 'Message of the day' for the realm -bool ChatHandler::HandleServerSetMotdCommand(const char *args) -{ - sWorld->SetMotd(args); - PSendSysMessage(LANG_MOTD_NEW, args); - return true; -} - -/// Set whether we accept new clients -bool ChatHandler::HandleServerSetClosedCommand(const char *args) -{ - if (strncmp(args, "on", 3) == 0) - { - SendSysMessage(LANG_WORLD_CLOSED); - sWorld->SetClosed(true); - return true; - } - else if (strncmp(args, "off", 4) == 0) - { - SendSysMessage(LANG_WORLD_OPENED); - sWorld->SetClosed(false); - return true; - } - - SendSysMessage(LANG_USE_BOL); - SetSentErrorMessage(true); - return false; -} - //Send items by mail bool ChatHandler::HandleSendItemsCommand(const char *args) { diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 8bc4ce24665..c18c6914096 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -61,8 +61,10 @@ void AddSC_npc_commandscript(); void AddSC_quest_commandscript(); void AddSC_reload_commandscript(); void AddSC_tele_commandscript(); +void AddSC_server_commandscript(); void AddSC_titles_commandscript(); void AddSC_wp_commandscript(); +void AddSC_character_commandscript(); #ifdef SCRIPTS //world @@ -665,8 +667,10 @@ void AddCommandScripts() AddSC_quest_commandscript(); AddSC_reload_commandscript(); AddSC_tele_commandscript(); + AddSC_server_commandscript(); AddSC_titles_commandscript(); AddSC_wp_commandscript(); + AddSC_character_commandscript(); } void AddWorldScripts() diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index 77d42ac5fd1..86e1baeb52d 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -27,9 +27,10 @@ set(scripts_STAT_SRCS Commands/cs_quest.cpp Commands/cs_reload.cpp Commands/cs_tele.cpp + Commands/cs_server.cpp Commands/cs_titles.cpp Commands/cs_wp.cpp -# Commands/cs_character.cpp + Commands/cs_character.cpp # Commands/cs_list.cpp # Commands/cs_lookup.cpp # Commands/cs_pdump.cpp diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp new file mode 100644 index 00000000000..d5e674a1097 --- /dev/null +++ b/src/server/scripts/Commands/cs_character.cpp @@ -0,0 +1,680 @@ +/* + * 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: character_commandscript +%Complete: 100 +Comment: All character related commands +Category: commandscripts +EndScriptData */ + +#include "ScriptMgr.h" +#include "Chat.h" +#include "AccountMgr.h" + +class character_commandscript : public CommandScript +{ +public: + character_commandscript() : CommandScript("character_commandscript") { } + + ChatCommand* GetCommands() const + { + static ChatCommand characterDeletedCommandTable[] = + { + { "delete", SEC_CONSOLE, true, &HandleCharacterDeletedDeleteCommand, "", NULL }, + { "list", SEC_ADMINISTRATOR, true, &HandleCharacterDeletedListCommand, "", NULL }, + { "restore", SEC_ADMINISTRATOR, true, &HandleCharacterDeletedRestoreCommand, "", NULL }, + { "old", SEC_CONSOLE, true, &HandleCharacterDeletedOldCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand characterCommandTable[] = + { + { "customize", SEC_GAMEMASTER, true, &HandleCharacterCustomizeCommand, "", NULL }, + { "changefaction", SEC_GAMEMASTER, true, &HandleCharacterChangeFactionCommand, "", NULL }, + { "changerace", SEC_GAMEMASTER, true, &HandleCharacterChangeRaceCommand, "", NULL }, + { "deleted", SEC_GAMEMASTER, true, NULL, "", characterDeletedCommandTable}, + { "erase", SEC_CONSOLE, true, &HandleCharacterEraseCommand, "", NULL }, + { "level", SEC_ADMINISTRATOR, true, &HandleCharacterLevelCommand, "", NULL }, + { "rename", SEC_GAMEMASTER, true, &HandleCharacterRenameCommand, "", NULL }, + { "reputation", SEC_GAMEMASTER, true, &HandleCharacterReputationCommand, "", NULL }, + { "titles", SEC_GAMEMASTER, true, &HandleCharacterTitlesCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand commandTable[] = + { + { "character", SEC_GAMEMASTER, true, NULL, "", characterCommandTable}, + { NULL, 0, false, NULL, "", NULL } + }; + + return commandTable; + } + + // Stores informations about a deleted character + struct DeletedInfo + { + uint32 lowguid; ///< the low GUID from the character + std::string name; ///< the character name + uint32 accountId; ///< the account id + std::string accountName; ///< the account name + time_t deleteDate; ///< the date at which the character has been deleted + }; + + typedef std::list DeletedInfoList; + + /** + * Collects all GUIDs (and related info) from deleted characters which are still in the database. + * + * @param foundList a reference to an std::list which will be filled with info data + * @param searchString the search string which either contains a player GUID or a part fo the character-name + * @return returns false if there was a problem while selecting the characters (e.g. player name not normalizeable) + */ + static bool GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::string searchString) + { + PreparedQueryResult result; + PreparedStatement* stmt; + if (!searchString.empty()) + { + // search by GUID + if (isNumeric(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; + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_NAME); + + stmt->setString(0, searchString); + + result = CharacterDatabase.Query(stmt); + } + } + else + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO); + + result = CharacterDatabase.Query(stmt); + } + + if (result) + { + do + { + Field* fields = result->Fetch(); + + DeletedInfo info; + + info.lowguid = fields[0].GetUInt32(); + info.name = fields[1].GetString(); + info.accountId = fields[2].GetUInt32(); + + // account name will be empty for not existed account + AccountMgr::GetName(info.accountId, info.accountName); + + info.deleteDate = time_t(fields[3].GetUInt32()); + + foundList.push_back(info); + } while (result->NextRow()); + } + + return true; + } + + /** + * Shows all deleted characters which matches the given search string, expected non empty list + * + * @see HandleCharacterDeletedListCommand + * @see HandleCharacterDeletedRestoreCommand + * @see HandleCharacterDeletedDeleteCommand + * @see DeletedInfoList + * + * @param foundList contains a list with all found deleted characters + */ + static void HandleCharacterDeletedListHelper(DeletedInfoList const& foundList, ChatHandler* handler) + { + if (!handler->GetSession()) + { + handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR); + handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_HEADER); + handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR); + } + + for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr) + { + std::string dateStr = TimeToTimestampStr(itr->deleteDate); + + if (!handler->GetSession()) + handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CONSOLE, + itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), + itr->accountId, dateStr.c_str()); + else + handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CHAT, + itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), + itr->accountId, dateStr.c_str()); + } + + if (!handler->GetSession()) + handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR); + } + + /** + * Restore a previously deleted character + * + * @see HandleCharacterDeletedListHelper + * @see HandleCharacterDeletedRestoreCommand + * @see HandleCharacterDeletedDeleteCommand + * @see DeletedInfoList + * + * @param delInfo the informations about the character which will be restored + */ + static void HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo, ChatHandler* handler) + { + if (delInfo.accountName.empty()) // account not exist + { + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); + return; + } + + // check character count + uint32 charcount = AccountMgr::GetCharactersCount(delInfo.accountId); + if (charcount >= 10) + { + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); + return; + } + + if (sObjectMgr->GetPlayerGUIDByName(delInfo.name)) + { + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); + return; + } + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_RESTORE_DELETE_INFO); + + stmt->setString(0, delInfo.name); + stmt->setUInt32(1, delInfo.accountId); + 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()); + } + + static bool HandleCharacterTitlesCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + Player* target; + if (!handler->extractPlayerTarget((char*)args, &target)) + return false; + + LocaleConstant loc = handler->GetSessionDbcLocale(); + char const* targetName = target->GetName(); + char const* knownStr = handler->GetTrinityString(LANG_KNOWN); + + // Search in CharTitles.dbc + for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++) + { + CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id); + + if (titleInfo && target->HasTitle(titleInfo)) + { + std::string name = titleInfo->name[loc]; + if (name.empty()) + continue; + + char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index + ? handler->GetTrinityString(LANG_ACTIVE) + : ""; + + char titleNameStr[80]; + snprintf(titleNameStr, 80, name.c_str(), targetName); + + // send title in "id (idx:idx) - [namedlink locale]" format + if (handler->GetSession()) + handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr); + else + handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr); + } + } + return true; + } + + //rename characters + static bool HandleCharacterRenameCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + return false; + + if (target) + { + // check online security + if (handler->HasLowerSecurity(target, 0)) + return false; + + handler->PSendSysMessage(LANG_RENAME_PLAYER, handler->GetNameLink(target).c_str()); + target->SetAtLoginFlag(AT_LOGIN_RENAME); + } + else + { + // check offline security + if (handler->HasLowerSecurity(NULL, targetGuid)) + return false; + + std::string oldNameLink = handler->playerLink(targetName); + handler->PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); + stmt->setUInt16(0, uint16(AT_LOGIN_RENAME)); + stmt->setUInt32(1, GUID_LOPART(targetGuid)); + CharacterDatabase.Execute(stmt); + } + return true; + } + + static bool HandleCharacterLevelCommand(ChatHandler* handler, char const* args) + { + char* nameStr; + char* levelStr; + handler->extractOptFirstArg((char*)args, &nameStr, &levelStr); + if (!levelStr) + return false; + + // exception opt second arg: .character level $name + if (isalpha(levelStr[0])) + { + nameStr = levelStr; + levelStr = NULL; // current level will used + } + + Player* target; + uint64 target_guid; + std::string target_name; + if (!handler->extractPlayerTarget(nameStr, &target, &target_guid, &target_name)) + return false; + + int32 oldlevel = target ? target->getLevel() : Player::GetLevelFromDB(target_guid); + int32 newlevel = levelStr ? atoi(levelStr) : oldlevel; + + if (newlevel < 1) + return false; // invalid level + + if (newlevel > STRONG_MAX_LEVEL) // hardcoded maximum level + newlevel = STRONG_MAX_LEVEL; + + handler->HandleCharacterLevel(target, target_guid, oldlevel, newlevel); + if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target) // including player == NULL + { + std::string nameLink = handler->playerLink(target_name); + handler->PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newlevel); + } + + return true; + } + + // customize characters + static bool HandleCharacterCustomizeCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + return false; + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); + stmt->setUInt16(0, uint16(AT_LOGIN_CUSTOMIZE)); + if (target) + { + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str()); + target->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE); + stmt->setUInt32(1, target->GetGUIDLow()); + } + else + { + std::string oldNameLink = handler->playerLink(targetName); + stmt->setUInt32(1, GUID_LOPART(targetGuid)); + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); + } + CharacterDatabase.Execute(stmt); + + return true; + } + + static bool HandleCharacterChangeFactionCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + std::string targetName; + + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + return false; + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); + stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_FACTION)); + if (target) + { + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str()); + target->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION); + stmt->setUInt32(1, target->GetGUIDLow()); + } + else + { + std::string oldNameLink = handler->playerLink(targetName); + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); + stmt->setUInt32(1, GUID_LOPART(targetGuid)); + } + CharacterDatabase.Execute(stmt); + + return true; + } + + static bool HandleCharacterChangeRaceCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + return false; + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); + stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_RACE)); + if (target) + { + // TODO : add text into database + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str()); + target->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE); + stmt->setUInt32(1, target->GetGUIDLow()); + } + else + { + std::string oldNameLink = handler->playerLink(targetName); + // TODO : add text into database + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); + stmt->setUInt32(1, GUID_LOPART(targetGuid)); + } + CharacterDatabase.Execute(stmt); + + return true; + } + + static bool HandleCharacterReputationCommand(ChatHandler* handler, char const* args) + { + Player* target; + if (!handler->extractPlayerTarget((char*)args, &target)) + return false; + + LocaleConstant loc = handler->GetSessionDbcLocale(); + + FactionStateList const& targetFSL = target->GetReputationMgr().GetStateList(); + for (FactionStateList::const_iterator itr = targetFSL.begin(); itr != targetFSL.end(); ++itr) + { + const FactionState& faction = itr->second; + FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID); + char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#"; + ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry); + std::string rankName = handler->GetTrinityString(ReputationRankStrIndex[rank]); + std::ostringstream ss; + if (handler->GetSession()) + ss << faction.ID << " - |cffffffff|Hfaction:" << faction.ID << "|h[" << factionName << ' ' << localeNames[loc] << "]|h|r"; + else + ss << faction.ID << " - " << factionName << ' ' << localeNames[loc]; + + ss << ' ' << rankName << " (" << target->GetReputationMgr().GetReputation(factionEntry) << ')'; + + if (faction.Flags & FACTION_FLAG_VISIBLE) + ss << handler->GetTrinityString(LANG_FACTION_VISIBLE); + if (faction.Flags & FACTION_FLAG_AT_WAR) + ss << handler->GetTrinityString(LANG_FACTION_ATWAR); + if (faction.Flags & FACTION_FLAG_PEACE_FORCED) + ss << handler->GetTrinityString(LANG_FACTION_PEACE_FORCED); + if (faction.Flags & FACTION_FLAG_HIDDEN) + ss << handler->GetTrinityString(LANG_FACTION_HIDDEN); + if (faction.Flags & FACTION_FLAG_INVISIBLE_FORCED) + ss << handler->GetTrinityString(LANG_FACTION_INVISIBLE_FORCED); + if (faction.Flags & FACTION_FLAG_INACTIVE) + ss << handler->GetTrinityString(LANG_FACTION_INACTIVE); + + handler->SendSysMessage(ss.str().c_str()); + } + return true; + } + + /** + * Handles the '.character deleted list' command, which shows all deleted characters which matches the given search string + * + * @see HandleCharacterDeletedListHelper + * @see HandleCharacterDeletedRestoreCommand + * @see HandleCharacterDeletedDeleteCommand + * @see DeletedInfoList + * + * @param args the search string which either contains a player GUID or a part fo the character-name + */ + static bool HandleCharacterDeletedListCommand(ChatHandler* handler, char const* args) + { + DeletedInfoList foundList; + if (!GetDeletedCharacterInfoList(foundList, args)) + return false; + + // if no characters have been found, output a warning + if (foundList.empty()) + { + handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY); + return false; + } + + HandleCharacterDeletedListHelper(foundList, handler); + return true; + } + + /** + * Handles the '.character deleted restore' command, which restores all deleted characters which matches the given search string + * + * The command automatically calls '.character deleted list' command with the search string to show all restored characters. + * + * @see HandleCharacterDeletedRestoreHelper + * @see HandleCharacterDeletedListCommand + * @see HandleCharacterDeletedDeleteCommand + * + * @param args the search string which either contains a player GUID or a part of the character-name + */ + static bool HandleCharacterDeletedRestoreCommand(ChatHandler* handler, char const* args) + { + // It is required to submit at least one argument + if (!*args) + return false; + + std::string searchString; + std::string newCharName; + uint32 newAccount = 0; + + // GCC by some strange reason fail build code without temporary variable + std::istringstream params(args); + params >> searchString >> newCharName >> newAccount; + + DeletedInfoList foundList; + if (!GetDeletedCharacterInfoList(foundList, searchString)) + return false; + + if (foundList.empty()) + { + handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY); + return false; + } + + handler->SendSysMessage(LANG_CHARACTER_DELETED_RESTORE); + HandleCharacterDeletedListHelper(foundList, handler); + + if (newCharName.empty()) + { + // Drop not existed account cases + for (DeletedInfoList::iterator itr = foundList.begin(); itr != foundList.end(); ++itr) + HandleCharacterDeletedRestoreHelper(*itr, handler); + } + else if (foundList.size() == 1 && normalizePlayerName(newCharName)) + { + DeletedInfo delInfo = foundList.front(); + + // update name + delInfo.name = newCharName; + + // if new account provided update deleted info + if (newAccount && newAccount != delInfo.accountId) + { + delInfo.accountId = newAccount; + AccountMgr::GetName(newAccount, delInfo.accountName); + } + + HandleCharacterDeletedRestoreHelper(delInfo, handler); + } + else + handler->SendSysMessage(LANG_CHARACTER_DELETED_ERR_RENAME); + + return true; + } + + /** + * Handles the '.character deleted delete' command, which completely deletes all deleted characters which matches the given search string + * + * @see Player::GetDeletedCharacterGUIDs + * @see Player::DeleteFromDB + * @see HandleCharacterDeletedListCommand + * @see HandleCharacterDeletedRestoreCommand + * + * @param args the search string which either contains a player GUID or a part fo the character-name + */ + static bool HandleCharacterDeletedDeleteCommand(ChatHandler* handler, char const* args) + { + // It is required to submit at least one argument + if (!*args) + return false; + + DeletedInfoList foundList; + if (!GetDeletedCharacterInfoList(foundList, args)) + return false; + + if (foundList.empty()) + { + handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY); + return false; + } + + handler->SendSysMessage(LANG_CHARACTER_DELETED_DELETE); + HandleCharacterDeletedListHelper(foundList, handler); + + // Call the appropriate function to delete them (current account for deleted characters is 0) + for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr) + Player::DeleteFromDB(itr->lowguid, 0, false, true); + + return true; + } + + /** + * Handles the '.character deleted old' command, which completely deletes all deleted characters deleted with some days ago + * + * @see Player::DeleteOldCharacters + * @see Player::DeleteFromDB + * @see HandleCharacterDeletedDeleteCommand + * @see HandleCharacterDeletedListCommand + * @see HandleCharacterDeletedRestoreCommand + * + * @param args the search string which either contains a player GUID or a part fo the character-name + */ + static bool HandleCharacterDeletedOldCommand(ChatHandler* handler, char const* args) + { + int32 keepDays = sWorld->getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS); + + char* px = strtok((char*)args, " "); + if (px) + { + if (!isNumeric(px)) + return false; + + keepDays = atoi(px); + if (keepDays < 0) + return false; + } + // config option value 0 -> disabled and can't be used + else if (keepDays <= 0) + return false; + + Player::DeleteOldCharacters((uint32)keepDays); + return true; + } + + static bool HandleCharacterEraseCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char *character_name_str = strtok((char*)args, " "); + if (!character_name_str) + return false; + + std::string character_name = character_name_str; + if (!normalizePlayerName(character_name)) + return false; + + uint64 character_guid; + uint32 account_id; + + Player* player = sObjectAccessor->FindPlayerByName(character_name.c_str()); + if (player) + { + character_guid = player->GetGUID(); + account_id = player->GetSession()->GetAccountId(); + player->GetSession()->KickPlayer(); + } + else + { + character_guid = sObjectMgr->GetPlayerGUIDByName(character_name); + if (!character_guid) + { + handler->PSendSysMessage(LANG_NO_PLAYER, character_name.c_str()); + handler->SetSentErrorMessage(true); + return false; + } + account_id = sObjectMgr->GetPlayerAccountIdByGUID(character_guid); + } + + std::string account_name; + AccountMgr::GetName (account_id, account_name); + + Player::DeleteFromDB(character_guid, account_id, true, true); + handler->PSendSysMessage(LANG_CHARACTER_DELETED, character_name.c_str(), GUID_LOPART(character_guid), account_name.c_str(), account_id); + return true; + } +}; + +void AddSC_character_commandscript() +{ + new character_commandscript(); +} \ No newline at end of file diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp new file mode 100644 index 00000000000..12528f384a4 --- /dev/null +++ b/src/server/scripts/Commands/cs_server.cpp @@ -0,0 +1,430 @@ +/* + * 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: server_commandscript +%Complete: 100 +Comment: All server related commands +Category: commandscripts +EndScriptData */ + +#include "ScriptMgr.h" +#include "Chat.h" +#include "SystemConfig.h" +#include "Config.h" + +class server_commandscript : public CommandScript +{ +public: + server_commandscript() : CommandScript("server_commandscript") { } + + ChatCommand* GetCommands() const + { + static ChatCommand serverIdleRestartCommandTable[] = + { + { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleRestartCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand serverIdleShutdownCommandTable[] = + { + { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleShutDownCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand serverRestartCommandTable[] = + { + { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , SEC_ADMINISTRATOR, true, &HandleServerRestartCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand serverShutdownCommandTable[] = + { + { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , SEC_ADMINISTRATOR, true, &HandleServerShutDownCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand serverSetCommandTable[] = + { + { "difftime", SEC_CONSOLE, true, &HandleServerSetDiffTimeCommand, "", NULL }, + { "loglevel", SEC_CONSOLE, true, &HandleServerSetLogLevelCommand, "", NULL }, + { "logfilelevel", SEC_CONSOLE, true, &HandleServerSetLogFileLevelCommand, "", NULL }, + { "motd", SEC_ADMINISTRATOR, true, &HandleServerSetMotdCommand, "", NULL }, + { "closed", SEC_ADMINISTRATOR, true, &HandleServerSetClosedCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand serverCommandTable[] = + { + { "corpses", SEC_GAMEMASTER, true, &HandleServerCorpsesCommand, "", NULL }, + { "exit", SEC_CONSOLE, true, &HandleServerExitCommand, "", NULL }, + { "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable }, + { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverIdleShutdownCommandTable }, + { "info", SEC_PLAYER, true, &HandleServerInfoCommand, "", NULL }, + { "motd", SEC_PLAYER, true, &HandleServerMotdCommand, "", NULL }, + { "plimit", SEC_ADMINISTRATOR, true, &HandleServerPLimitCommand, "", NULL }, + { "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable }, + { "shutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable }, + { "set", SEC_ADMINISTRATOR, true, NULL, "", serverSetCommandTable }, + { "togglequerylog", SEC_CONSOLE, true, &HandleServerToggleQueryLogging, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand commandTable[] = + { + { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable }, + { NULL, 0, false, NULL, "", NULL } + }; + return commandTable; + } + + // Triggering corpses expire check in world + static bool HandleServerCorpsesCommand(ChatHandler* handler, char const* args) + { + sObjectAccessor->RemoveOldCorpses(); + return true; + } + + static bool HandleServerInfoCommand(ChatHandler* handler, char const* args) + { + uint32 playersNum = sWorld->GetPlayerCount(); + uint32 maxPlayersNum = sWorld->GetMaxPlayerCount(); + uint32 activeClientsNum = sWorld->GetActiveSessionCount(); + uint32 queuedClientsNum = sWorld->GetQueuedSessionCount(); + uint32 maxActiveClientsNum = sWorld->GetMaxActiveSessionCount(); + uint32 maxQueuedClientsNum = sWorld->GetMaxQueuedSessionCount(); + std::string uptime = secsToTimeString(sWorld->GetUptime()); + uint32 updateTime = sWorld->GetUpdateTime(); + + handler->SendSysMessage(_FULLVERSION); + handler->PSendSysMessage(LANG_CONNECTED_PLAYERS, playersNum, maxPlayersNum); + handler->PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum); + handler->PSendSysMessage(LANG_UPTIME, uptime.c_str()); + handler->PSendSysMessage(LANG_UPDATE_DIFF, updateTime); + // Can't use sWorld->ShutdownMsg here in case of console command + if (sWorld->IsShuttingDown()) + handler->PSendSysMessage(LANG_SHUTDOWN_TIMELEFT, secsToTimeString(sWorld->GetShutDownTimeLeft()).c_str()); + + return true; + } + // Display the 'Message of the day' for the realm + static bool HandleServerMotdCommand(ChatHandler* handler, char const* args) + { + handler->PSendSysMessage(LANG_MOTD_CURRENT, sWorld->GetMotd()); + return true; + } + + static bool HandleServerPLimitCommand(ChatHandler* handler, char const* args) + { + if (*args) + { + char* param = strtok((char*)args, " "); + if (!param) + return false; + + int l = strlen(param); + + if (strncmp(param, "player", l) == 0) + sWorld->SetPlayerSecurityLimit(SEC_PLAYER); + else if (strncmp(param, "moderator", l) == 0) + sWorld->SetPlayerSecurityLimit(SEC_MODERATOR); + else if (strncmp(param, "gamemaster", l) == 0) + sWorld->SetPlayerSecurityLimit(SEC_GAMEMASTER); + else if (strncmp(param, "administrator", l) == 0) + sWorld->SetPlayerSecurityLimit(SEC_ADMINISTRATOR); + else if (strncmp(param, "reset", l) == 0) + { + sWorld->SetPlayerAmountLimit(ConfigMgr::GetIntDefault("PlayerLimit", 100)); + sWorld->LoadDBAllowedSecurityLevel(); + } + else + { + int val = atoi(param); + if (val < 0) + sWorld->SetPlayerSecurityLimit(AccountTypes(uint32(-val))); + else + sWorld->SetPlayerAmountLimit(uint32(val)); + } + } + + uint32 pLimit = sWorld->GetPlayerAmountLimit(); + AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit(); + char const* secName = ""; + switch (allowedAccountType) + { + case SEC_PLAYER: secName = "Player"; break; + case SEC_MODERATOR: secName = "Moderator"; break; + case SEC_GAMEMASTER: secName = "Gamemaster"; break; + case SEC_ADMINISTRATOR: secName = "Administrator"; break; + default: secName = ""; break; + } + handler->PSendSysMessage("Player limits: amount %u, min. security level %s.", pLimit, secName); + + return true; + } + + static bool HandleServerShutDownCancelCommand(ChatHandler* handler, char const* args) + { + sWorld->ShutdownCancel(); + return true; + } + + static bool HandleServerShutDownCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char* time_str = strtok ((char*) args, " "); + char* exitcode_str = strtok (NULL, ""); + + int32 time = atoi (time_str); + + // Prevent interpret wrong arg value as 0 secs shutdown time + if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) + return false; + + if (exitcode_str) + { + int32 exitcode = atoi(exitcode_str); + + // Handle atoi() errors + if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) + return false; + + // Exit code should be in range of 0-125, 126-255 is used + // in many shells for their own return codes and code > 255 + // is not supported in many others + if (exitcode < 0 || exitcode > 125) + return false; + + sWorld->ShutdownServ(time, 0, exitcode); + } + else + sWorld->ShutdownServ(time, 0, SHUTDOWN_EXIT_CODE); + return true; + } + + static bool HandleServerRestartCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char* time_str = strtok ((char*) args, " "); + char* exitcode_str = strtok (NULL, ""); + + int32 time = atoi (time_str); + + // Prevent interpret wrong arg value as 0 secs shutdown time + if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) + return false; + + if (exitcode_str) + { + int32 exitcode = atoi (exitcode_str); + + // Handle atoi() errors + if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) + return false; + + // Exit code should be in range of 0-125, 126-255 is used + // in many shells for their own return codes and code > 255 + // is not supported in many others + if (exitcode < 0 || exitcode > 125) + return false; + + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, exitcode); + } + else + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE); + return true; + } + + static bool HandleServerIdleRestartCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char* time_str = strtok ((char*) args, " "); + char* exitcode_str = strtok (NULL, ""); + + int32 time = atoi (time_str); + + // Prevent interpret wrong arg value as 0 secs shutdown time + if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) + return false; + + if (exitcode_str) + { + int32 exitcode = atoi (exitcode_str); + + // Handle atoi() errors + if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) + return false; + + // Exit code should be in range of 0-125, 126-255 is used + // in many shells for their own return codes and code > 255 + // is not supported in many others + if (exitcode < 0 || exitcode > 125) + return false; + + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode); + } + else + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE); + return true; + } + + static bool HandleServerIdleShutDownCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char* time_str = strtok ((char*) args, " "); + char* exitcode_str = strtok (NULL, ""); + + int32 time = atoi (time_str); + + // Prevent interpret wrong arg value as 0 secs shutdown time + if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) + return false; + + if (exitcode_str) + { + int32 exitcode = atoi (exitcode_str); + + // Handle atoi() errors + if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) + return false; + + // Exit code should be in range of 0-125, 126-255 is used + // in many shells for their own return codes and code > 255 + // is not supported in many others + if (exitcode < 0 || exitcode > 125) + return false; + + sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, exitcode); + } + else + sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE); + return true; + } + + // Exit the realm + static bool HandleServerExitCommand(ChatHandler* handler, char const* args) + { + handler->SendSysMessage(LANG_COMMAND_EXIT); + World::StopNow(SHUTDOWN_EXIT_CODE); + return true; + } + + // Define the 'Message of the day' for the realm + static bool HandleServerSetMotdCommand(ChatHandler* handler, char const* args) + { + sWorld->SetMotd(args); + handler->PSendSysMessage(LANG_MOTD_NEW, args); + return true; + } + + // Set whether we accept new clients + static bool HandleServerSetClosedCommand(ChatHandler* handler, char const* args) + { + if (strncmp(args, "on", 3) == 0) + { + handler->SendSysMessage(LANG_WORLD_CLOSED); + sWorld->SetClosed(true); + return true; + } + else if (strncmp(args, "off", 4) == 0) + { + handler->SendSysMessage(LANG_WORLD_OPENED); + sWorld->SetClosed(false); + return true; + } + + handler->SendSysMessage(LANG_USE_BOL); + handler->SetSentErrorMessage(true); + return false; + } + + // Set the level of logging + static bool HandleServerSetLogFileLevelCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char *NewLevel = strtok((char*)args, " "); + if (!NewLevel) + return false; + + sLog->SetLogFileLevel(NewLevel); + return true; + } + + // Set the level of logging + static bool HandleServerSetLogLevelCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char *NewLevel = strtok((char*)args, " "); + if (!NewLevel) + return false; + + sLog->SetLogLevel(NewLevel); + return true; + } + + // set diff time record interval + static bool HandleServerSetDiffTimeCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char *NewTimeStr = strtok((char*)args, " "); + if (!NewTimeStr) + return false; + + int32 NewTime =atoi(NewTimeStr); + if (NewTime < 0) + return false; + + sWorld->SetRecordDiffInterval(NewTime); + printf( "Record diff every %u ms\n", NewTime); + return true; + } + + // toggle sql driver query logging + static bool HandleServerToggleQueryLogging(ChatHandler* handler,const char* args ) + { + sLog->SetSQLDriverQueryLogging(!sLog->GetSQLDriverQueryLogging()); + if (sLog->GetSQLDriverQueryLogging()) + handler->PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_ENABLED); + else + handler->PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_DISABLED); + + return true; + } +}; + +void AddSC_server_commandscript() +{ + new server_commandscript(); +} \ No newline at end of file diff --git a/src/server/scripts/Kalimdor/ashenvale.cpp b/src/server/scripts/Kalimdor/ashenvale.cpp index e28665c038e..9e8cdaa8b92 100644 --- a/src/server/scripts/Kalimdor/ashenvale.cpp +++ b/src/server/scripts/Kalimdor/ashenvale.cpp @@ -169,15 +169,15 @@ class npc_torek : public CreatureScript # npc_ruul_snowhoof ####*/ -enum RuulSnowhoof -{ +enum RuulSnowhoof +{ NPC_THISTLEFUR_URSA = 3921, NPC_THISTLEFUR_TOTEMIC = 3922, NPC_THISTLEFUR_PATHFINDER = 3926, QUEST_FREEDOM_TO_RUUL = 6482, - GO_CAGE = 178147 + GO_CAGE = 178147 }; Position const RuulSnowhoofSummonsCoord[6] = diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index e85a3e1870d..699e7cad97c 100755 --- a/src/server/worldserver/CommandLine/CliRunnable.cpp +++ b/src/server/worldserver/CommandLine/CliRunnable.cpp @@ -116,458 +116,6 @@ void commandFinished(void*, bool /*success*/) fflush(stdout); } -/** - * Collects all GUIDs (and related info) from deleted characters which are still in the database. - * - * @param foundList a reference to an std::list which will be filled with info data - * @param searchString the search string which either contains a player GUID or a part fo the character-name - * @return returns false if there was a problem while selecting the characters (e.g. player name not normalizeable) - */ -bool ChatHandler::GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::string searchString) -{ - PreparedQueryResult result; - PreparedStatement* stmt; - if (!searchString.empty()) - { - // search by GUID - if (isNumeric(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; - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_NAME); - - stmt->setString(0, searchString); - - result = CharacterDatabase.Query(stmt); - } - } - else - { - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO); - - result = CharacterDatabase.Query(stmt); - } - - if (result) - { - do - { - Field* fields = result->Fetch(); - - DeletedInfo info; - - info.lowguid = fields[0].GetUInt32(); - info.name = fields[1].GetString(); - info.accountId = fields[2].GetUInt32(); - - // account name will be empty for not existed account - AccountMgr::GetName(info.accountId, info.accountName); - - info.deleteDate = time_t(fields[3].GetUInt32()); - - foundList.push_back(info); - } while (result->NextRow()); - } - - return true; -} - -/** - * Generate WHERE guids list by deleted info in way preventing return too long where list for existed query string length limit. - * - * @param itr a reference to an deleted info list iterator, it updated in function for possible next function call if list to long - * @param itr_end a reference to an deleted info list iterator end() - * @return returns generated where list string in form: 'guid IN (gui1, guid2, ...)' - */ -std::string ChatHandler::GenerateDeletedCharacterGUIDsWhereStr(DeletedInfoList::const_iterator& itr, DeletedInfoList::const_iterator const& itr_end) -{ - std::ostringstream wherestr; - wherestr << "guid IN ('"; - for (; itr != itr_end; ++itr) - { - wherestr << itr->lowguid; - - if (wherestr.str().size() > MAX_QUERY_LEN - 50) // near to max query - { - ++itr; - break; - } - - DeletedInfoList::const_iterator itr2 = itr; - if (++itr2 != itr_end) - wherestr << "', '"; - } - wherestr << "')"; - return wherestr.str(); -} - -/** - * Shows all deleted characters which matches the given search string, expected non empty list - * - * @see ChatHandler::HandleCharacterDeletedListCommand - * @see ChatHandler::HandleCharacterDeletedRestoreCommand - * @see ChatHandler::HandleCharacterDeletedDeleteCommand - * @see ChatHandler::DeletedInfoList - * - * @param foundList contains a list with all found deleted characters - */ -void ChatHandler::HandleCharacterDeletedListHelper(DeletedInfoList const& foundList) -{ - if (!m_session) - { - SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR); - SendSysMessage(LANG_CHARACTER_DELETED_LIST_HEADER); - SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR); - } - - for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr) - { - std::string dateStr = TimeToTimestampStr(itr->deleteDate); - - if (!m_session) - PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CONSOLE, - itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), - itr->accountId, dateStr.c_str()); - else - PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CHAT, - itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), - itr->accountId, dateStr.c_str()); - } - - if (!m_session) - SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR); -} - -/** - * Handles the '.character deleted list' command, which shows all deleted characters which matches the given search string - * - * @see ChatHandler::HandleCharacterDeletedListHelper - * @see ChatHandler::HandleCharacterDeletedRestoreCommand - * @see ChatHandler::HandleCharacterDeletedDeleteCommand - * @see ChatHandler::DeletedInfoList - * - * @param args the search string which either contains a player GUID or a part fo the character-name - */ -bool ChatHandler::HandleCharacterDeletedListCommand(const char* args) -{ - DeletedInfoList foundList; - if (!GetDeletedCharacterInfoList(foundList, args)) - return false; - - // if no characters have been found, output a warning - if (foundList.empty()) - { - SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY); - return false; - } - - HandleCharacterDeletedListHelper(foundList); - return true; -} - -/** - * Restore a previously deleted character - * - * @see ChatHandler::HandleCharacterDeletedListHelper - * @see ChatHandler::HandleCharacterDeletedRestoreCommand - * @see ChatHandler::HandleCharacterDeletedDeleteCommand - * @see ChatHandler::DeletedInfoList - * - * @param delInfo the informations about the character which will be restored - */ -void ChatHandler::HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo) -{ - if (delInfo.accountName.empty()) // account not exist - { - PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); - return; - } - - // check character count - uint32 charcount = AccountMgr::GetCharactersCount(delInfo.accountId); - if (charcount >= 10) - { - PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); - return; - } - - if (sObjectMgr->GetPlayerGUIDByName(delInfo.name)) - { - PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); - return; - } - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_RESTORE_DELETE_INFO); - - stmt->setString(0, delInfo.name); - stmt->setUInt32(1, delInfo.accountId); - 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()); -} - -/** - * Handles the '.character deleted restore' command, which restores all deleted characters which matches the given search string - * - * The command automatically calls '.character deleted list' command with the search string to show all restored characters. - * - * @see ChatHandler::HandleCharacterDeletedRestoreHelper - * @see ChatHandler::HandleCharacterDeletedListCommand - * @see ChatHandler::HandleCharacterDeletedDeleteCommand - * - * @param args the search string which either contains a player GUID or a part of the character-name - */ -bool ChatHandler::HandleCharacterDeletedRestoreCommand(const char* args) -{ - // It is required to submit at least one argument - if (!*args) - return false; - - std::string searchString; - std::string newCharName; - uint32 newAccount = 0; - - // GCC by some strange reason fail build code without temporary variable - std::istringstream params(args); - params >> searchString >> newCharName >> newAccount; - - DeletedInfoList foundList; - if (!GetDeletedCharacterInfoList(foundList, searchString)) - return false; - - if (foundList.empty()) - { - SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY); - return false; - } - - SendSysMessage(LANG_CHARACTER_DELETED_RESTORE); - HandleCharacterDeletedListHelper(foundList); - - if (newCharName.empty()) - { - // Drop not existed account cases - for (DeletedInfoList::iterator itr = foundList.begin(); itr != foundList.end(); ++itr) - HandleCharacterDeletedRestoreHelper(*itr); - } - else if (foundList.size() == 1 && normalizePlayerName(newCharName)) - { - DeletedInfo delInfo = foundList.front(); - - // update name - delInfo.name = newCharName; - - // if new account provided update deleted info - if (newAccount && newAccount != delInfo.accountId) - { - delInfo.accountId = newAccount; - AccountMgr::GetName(newAccount, delInfo.accountName); - } - - HandleCharacterDeletedRestoreHelper(delInfo); - } - else - SendSysMessage(LANG_CHARACTER_DELETED_ERR_RENAME); - - return true; -} - -/** - * Handles the '.character deleted delete' command, which completely deletes all deleted characters which matches the given search string - * - * @see Player::GetDeletedCharacterGUIDs - * @see Player::DeleteFromDB - * @see ChatHandler::HandleCharacterDeletedListCommand - * @see ChatHandler::HandleCharacterDeletedRestoreCommand - * - * @param args the search string which either contains a player GUID or a part fo the character-name - */ -bool ChatHandler::HandleCharacterDeletedDeleteCommand(const char* args) -{ - // It is required to submit at least one argument - if (!*args) - return false; - - DeletedInfoList foundList; - if (!GetDeletedCharacterInfoList(foundList, args)) - return false; - - if (foundList.empty()) - { - SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY); - return false; - } - - SendSysMessage(LANG_CHARACTER_DELETED_DELETE); - HandleCharacterDeletedListHelper(foundList); - - // Call the appropriate function to delete them (current account for deleted characters is 0) - for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr) - Player::DeleteFromDB(itr->lowguid, 0, false, true); - - return true; -} - -/** - * Handles the '.character deleted old' command, which completely deletes all deleted characters deleted with some days ago - * - * @see Player::DeleteOldCharacters - * @see Player::DeleteFromDB - * @see ChatHandler::HandleCharacterDeletedDeleteCommand - * @see ChatHandler::HandleCharacterDeletedListCommand - * @see ChatHandler::HandleCharacterDeletedRestoreCommand - * - * @param args the search string which either contains a player GUID or a part fo the character-name - */ -bool ChatHandler::HandleCharacterDeletedOldCommand(const char* args) -{ - int32 keepDays = sWorld->getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS); - - char* px = strtok((char*)args, " "); - if (px) - { - if (!isNumeric(px)) - return false; - - keepDays = atoi(px); - if (keepDays < 0) - return false; - } - // config option value 0 -> disabled and can't be used - else if (keepDays <= 0) - return false; - - Player::DeleteOldCharacters((uint32)keepDays); - return true; -} - -bool ChatHandler::HandleCharacterEraseCommand(const char* args){ - if (!*args) - return false; - - char *character_name_str = strtok((char*)args, " "); - if (!character_name_str) - return false; - - std::string character_name = character_name_str; - if (!normalizePlayerName(character_name)) - return false; - - uint64 character_guid; - uint32 account_id; - - Player* player = sObjectAccessor->FindPlayerByName(character_name.c_str()); - if (player) - { - character_guid = player->GetGUID(); - account_id = player->GetSession()->GetAccountId(); - player->GetSession()->KickPlayer(); - } - else - { - character_guid = sObjectMgr->GetPlayerGUIDByName(character_name); - if (!character_guid) - { - PSendSysMessage(LANG_NO_PLAYER, character_name.c_str()); - SetSentErrorMessage(true); - return false; - } - - account_id = sObjectMgr->GetPlayerAccountIdByGUID(character_guid); - } - - std::string account_name; - AccountMgr::GetName (account_id, account_name); - - Player::DeleteFromDB(character_guid, account_id, true, true); - PSendSysMessage(LANG_CHARACTER_DELETED, character_name.c_str(), GUID_LOPART(character_guid), account_name.c_str(), account_id); - return true; -} - -/// Exit the realm -bool ChatHandler::HandleServerExitCommand(const char* /*args*/) -{ - SendSysMessage(LANG_COMMAND_EXIT); - World::StopNow(SHUTDOWN_EXIT_CODE); - return true; -} - -/// Set the level of logging -bool ChatHandler::HandleServerSetLogFileLevelCommand(const char *args) -{ - if (!*args) - return false; - - char *NewLevel = strtok((char*)args, " "); - if (!NewLevel) - return false; - - sLog->SetLogFileLevel(NewLevel); - return true; -} - -/// Set the level of logging -bool ChatHandler::HandleServerSetLogLevelCommand(const char *args) -{ - if (!*args) - return false; - - char *NewLevel = strtok((char*)args, " "); - if (!NewLevel) - return false; - - sLog->SetLogLevel(NewLevel); - return true; -} - -/// set diff time record interval -bool ChatHandler::HandleServerSetDiffTimeCommand(const char *args) -{ - if (!*args) - return false; - - char *NewTimeStr = strtok((char*)args, " "); - if (!NewTimeStr) - return false; - - int32 NewTime =atoi(NewTimeStr); - if (NewTime < 0) - return false; - - sWorld->SetRecordDiffInterval(NewTime); - printf( "Record diff every %u ms\n", NewTime); - return true; -} - -/// toggle sql driver query logging -bool ChatHandler::HandleServerToggleQueryLogging(const char* /* args */) -{ - sLog->SetSQLDriverQueryLogging(!sLog->GetSQLDriverQueryLogging()); - if (sLog->GetSQLDriverQueryLogging()) - PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_ENABLED); - else - PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_DISABLED); - - return true; -} - -/// @} - #ifdef linux // Non-blocking keypress detector, when return pressed, return 1, else always return 0 int kb_hit_return() -- cgit v1.2.3 From 7e6273315cea7877063dc0e901dab7fdfbb44e60 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 21 Jun 2012 00:27:13 +0100 Subject: Scripts/Commands: Fix non pch build (add missing includes) --- src/server/scripts/Commands/cs_character.cpp | 1 + src/server/scripts/Commands/cs_server.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index d5e674a1097..1784d73cbab 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -25,6 +25,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "Chat.h" #include "AccountMgr.h" +#include "ObjectMgr.h" class character_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index 12528f384a4..2e5b929d460 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -26,6 +26,7 @@ EndScriptData */ #include "Chat.h" #include "SystemConfig.h" #include "Config.h" +#include "ObjectAccessor.h" class server_commandscript : public CommandScript { -- cgit v1.2.3 From 874dff2050da98b2ca164319430e76148020ff23 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 21 Jun 2012 01:38:55 +0100 Subject: Scripts/Commands: No one likes tabs :( --- src/server/game/Scripting/ScriptLoader.cpp | 2 +- src/server/scripts/Commands/cs_modify.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index c18c6914096..94da23110b8 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -667,7 +667,7 @@ void AddCommandScripts() AddSC_quest_commandscript(); AddSC_reload_commandscript(); AddSC_tele_commandscript(); - AddSC_server_commandscript(); + AddSC_server_commandscript(); AddSC_titles_commandscript(); AddSC_wp_commandscript(); AddSC_character_commandscript(); diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 3e04cb48af4..60c5e1cf162 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1390,7 +1390,7 @@ public: if (!target) target = handler->GetSession()->GetPlayer(); - // check online security + // check online security else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), 0)) return false; -- cgit v1.2.3 From d3bf4626d05883ed856785e19f70f29340157ad2 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Wed, 20 Jun 2012 14:57:03 +0200 Subject: Core/Commands: Convert list commands in commandscript --- src/server/game/Chat/Chat.cpp | 10 - src/server/game/Chat/Chat.h | 5 - src/server/game/Chat/Commands/Level3.cpp | 407 ------------------------- src/server/scripts/Commands/CMakeLists.txt | 5 +- src/server/scripts/Commands/cs_list.cpp | 467 +++++++++++++++++++++++++++++ 5 files changed, 469 insertions(+), 425 deletions(-) create mode 100644 src/server/scripts/Commands/cs_list.cpp (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index f96199f9bd3..bbfab474e22 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -122,15 +122,6 @@ ChatCommand* ChatHandler::getCommandTable() { NULL, 0, false, NULL, "", NULL } }; - static ChatCommand listCommandTable[] = - { - { "creature", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleListCreatureCommand>, "", NULL }, - { "item", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleListItemCommand>, "", NULL }, - { "object", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleListObjectCommand>, "", NULL }, - { "auras", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleListAurasCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - static ChatCommand lookupPlayerCommandTable[] = { { "ip", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleLookupPlayerIpCommand>, "", NULL }, @@ -234,7 +225,6 @@ ChatCommand* ChatHandler::getCommandTable() static ChatCommand commandTable[] = { - { "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable }, { "lookup", SEC_ADMINISTRATOR, true, NULL, "", lookupCommandTable }, { "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable }, { "guild", SEC_ADMINISTRATOR, true, NULL, "", guildCommandTable }, diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index c43b0fa9aca..9fc9b394947 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -163,11 +163,6 @@ class ChatHandler bool HandleGuildRankCommand(const char* args); bool HandleGuildDeleteCommand(const char* args); - bool HandleListAurasCommand(const char * args); - bool HandleListCreatureCommand(const char* args); - bool HandleListItemCommand(const char* args); - bool HandleListObjectCommand(const char* args); - bool HandleLookupAreaCommand(const char* args); bool HandleLookupCreatureCommand(const char* args); bool HandleLookupEventCommand(const char* args); diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 33855a96617..eed4c11e1a9 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -385,365 +385,6 @@ bool ChatHandler::HandleAddItemSetCommand(const char *args) return true; } -bool ChatHandler::HandleListItemCommand(const char *args) -{ - if (!*args) - return false; - - char* cId = extractKeyFromLink((char*)args, "Hitem"); - if (!cId) - return false; - - uint32 item_id = atol(cId); - if (!item_id) - { - PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, item_id); - SetSentErrorMessage(true); - return false; - } - - ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(item_id); - if (!itemProto) - { - PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, item_id); - SetSentErrorMessage(true); - return false; - } - - char* c_count = strtok(NULL, " "); - int _count = c_count ? atol(c_count) : 10; - - if (_count < 0) - return false; - uint32 count = uint32(_count); - - PreparedQueryResult result; - - // inventory case - uint32 inv_count = 0; - - 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].GetUInt64(); - - 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) - { - do - { - Field* fields = result->Fetch(); - uint32 item_guid = fields[0].GetUInt32(); - uint32 item_bag = fields[1].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(); - - char const* item_pos = 0; - if (Player::IsEquipmentPos(item_bag, item_slot)) - item_pos = "[equipped]"; - else if (Player::IsInventoryPos(item_bag, item_slot)) - item_pos = "[in inventory]"; - else if (Player::IsBankPos(item_bag, item_slot)) - item_pos = "[in bank]"; - else - item_pos = ""; - - PSendSysMessage(LANG_ITEMLIST_SLOT, item_guid, owner_name.c_str(), owner_guid, owner_acc, item_pos); - } - while (result->NextRow()); - - uint32 res_count = uint32(result->GetRowCount()); - - if (count > res_count) - count -= res_count; - else if (count) - count = 0; - } - - // mail case - uint32 mail_count = 0; - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_COUNT_ITEM); - stmt->setUInt32(0, item_id); - result = CharacterDatabase.Query(stmt); - - if (result) - mail_count = (*result)[0].GetUInt64(); - - if (count > 0) - { - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_ITEMS_BY_ENTRY); - stmt->setUInt32(0, item_id); - stmt->setUInt32(1, count); - result = CharacterDatabase.Query(stmt); - } - else - result = PreparedQueryResult(NULL); - - if (result) - { - do - { - Field* fields = result->Fetch(); - uint32 item_guid = fields[0].GetUInt32(); - uint32 item_s = fields[1].GetUInt32(); - uint32 item_r = fields[2].GetUInt32(); - uint32 item_s_acc = fields[3].GetUInt32(); - std::string item_s_name = fields[4].GetString(); - uint32 item_r_acc = fields[5].GetUInt32(); - std::string item_r_name = fields[6].GetString(); - - char const* item_pos = "[in mail]"; - - PSendSysMessage(LANG_ITEMLIST_MAIL, item_guid, item_s_name.c_str(), item_s, item_s_acc, item_r_name.c_str(), item_r, item_r_acc, item_pos); - } - while (result->NextRow()); - - uint32 res_count = uint32(result->GetRowCount()); - - if (count > res_count) - count -= res_count; - else if (count) - count = 0; - } - - // auction case - uint32 auc_count = 0; - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONHOUSE_COUNT_ITEM); - stmt->setUInt32(0, item_id); - result = CharacterDatabase.Query(stmt); - - if (result) - auc_count = (*result)[0].GetUInt64(); - - if (count > 0) - { - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY); - stmt->setUInt32(0, item_id); - stmt->setUInt32(1, count); - result = CharacterDatabase.Query(stmt); - } - else - result = PreparedQueryResult(NULL); - - if (result) - { - do - { - Field* fields = result->Fetch(); - uint32 item_guid = fields[0].GetUInt32(); - uint32 owner = fields[1].GetUInt32(); - uint32 owner_acc = fields[2].GetUInt32(); - std::string owner_name = fields[3].GetString(); - - char const* item_pos = "[in auction]"; - - PSendSysMessage(LANG_ITEMLIST_AUCTION, item_guid, owner_name.c_str(), owner, owner_acc, item_pos); - } - while (result->NextRow()); - } - - // guild bank case - uint32 guild_count = 0; - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_COUNT_ITEM); - stmt->setUInt32(0, item_id); - result = CharacterDatabase.Query(stmt); - - if (result) - guild_count = (*result)[0].GetUInt64(); - - 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) - { - do - { - Field* fields = result->Fetch(); - uint32 item_guid = fields[0].GetUInt32(); - uint32 guild_guid = fields[1].GetUInt32(); - std::string guild_name = fields[2].GetString(); - - char const* item_pos = "[in guild bank]"; - - PSendSysMessage(LANG_ITEMLIST_GUILD, item_guid, guild_name.c_str(), guild_guid, item_pos); - } - while (result->NextRow()); - - uint32 res_count = uint32(result->GetRowCount()); - - if (count > res_count) - count -= res_count; - else if (count) - count = 0; - } - - if (inv_count + mail_count + auc_count + guild_count == 0) - { - SendSysMessage(LANG_COMMAND_NOITEMFOUND); - SetSentErrorMessage(true); - return false; - } - - PSendSysMessage(LANG_COMMAND_LISTITEMMESSAGE, item_id, inv_count + mail_count + auc_count + guild_count, inv_count, mail_count, auc_count, guild_count); - return true; -} - -bool ChatHandler::HandleListObjectCommand(const char *args) -{ - if (!*args) - return false; - - // number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r - char* cId = extractKeyFromLink((char*)args, "Hgameobject_entry"); - if (!cId) - return false; - - uint32 go_id = atol(cId); - if (!go_id) - { - PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, go_id); - SetSentErrorMessage(true); - return false; - } - - GameObjectTemplate const* gInfo = sObjectMgr->GetGameObjectTemplate(go_id); - if (!gInfo) - { - PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, go_id); - SetSentErrorMessage(true); - return false; - } - - char* c_count = strtok(NULL, " "); - int count = c_count ? atol(c_count) : 10; - - if (count < 0) - return false; - - QueryResult result; - - uint32 obj_count = 0; - result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='%u'", go_id); - if (result) - obj_count = (*result)[0].GetUInt64(); - - if (m_session) - { - Player* player = m_session->GetPlayer(); - result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE id = '%u' ORDER BY order_ ASC LIMIT %u", - player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), go_id, uint32(count)); - } - else - result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id FROM gameobject WHERE id = '%u' LIMIT %u", - go_id, uint32(count)); - - if (result) - { - do - { - Field* fields = result->Fetch(); - uint32 guid = fields[0].GetUInt32(); - float x = fields[1].GetFloat(); - float y = fields[2].GetFloat(); - float z = fields[3].GetFloat(); - int mapid = fields[4].GetUInt16(); - uint32 entry = fields[5].GetUInt32(); - - if (m_session) - PSendSysMessage(LANG_GO_LIST_CHAT, guid, entry, guid, gInfo->name.c_str(), x, y, z, mapid); - else - PSendSysMessage(LANG_GO_LIST_CONSOLE, guid, gInfo->name.c_str(), x, y, z, mapid); - } while (result->NextRow()); - } - - PSendSysMessage(LANG_COMMAND_LISTOBJMESSAGE, go_id, obj_count); - return true; -} - -bool ChatHandler::HandleListCreatureCommand(const char *args) -{ - if (!*args) - return false; - - // number or [name] Shift-click form |color|Hcreature_entry:creature_id|h[name]|h|r - char* cId = extractKeyFromLink((char*)args, "Hcreature_entry"); - if (!cId) - return false; - - uint32 cr_id = atol(cId); - if (!cr_id) - { - PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, cr_id); - SetSentErrorMessage(true); - return false; - } - - CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(cr_id); - if (!cInfo) - { - PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, cr_id); - SetSentErrorMessage(true); - return false; - } - - char* c_count = strtok(NULL, " "); - int count = c_count ? atol(c_count) : 10; - - if (count < 0) - return false; - - QueryResult result; - - uint32 cr_count = 0; - result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='%u'", cr_id); - if (result) - cr_count = (*result)[0].GetUInt64(); - - if (m_session) - { - Player* player = m_session->GetPlayer(); - result = WorldDatabase.PQuery("SELECT guid, 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 creature WHERE id = '%u' ORDER BY order_ ASC LIMIT %u", - player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), cr_id, uint32(count)); - } - else - result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map FROM creature WHERE id = '%u' LIMIT %u", - cr_id, uint32(count)); - - if (result) - { - do - { - Field* fields = result->Fetch(); - uint32 guid = fields[0].GetUInt32(); - float x = fields[1].GetFloat(); - float y = fields[2].GetFloat(); - float z = fields[3].GetFloat(); - int mapid = fields[4].GetUInt16(); - - if (m_session) - PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, guid, cInfo->Name.c_str(), x, y, z, mapid); - else - PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, cInfo->Name.c_str(), x, y, z, mapid); - } while (result->NextRow()); - } - - PSendSysMessage(LANG_COMMAND_LISTCREATUREMESSAGE, cr_id, cr_count); - return true; -} - bool ChatHandler::HandleLookupItemCommand(const char *args) { if (!*args) @@ -2349,54 +1990,6 @@ bool ChatHandler::HandleChangeWeather(const char *args) return true; } -bool ChatHandler::HandleListAurasCommand (const char * /*args*/) -{ - Unit* unit = getSelectedUnit(); - if (!unit) - { - SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - SetSentErrorMessage(true); - return false; - } - - char const* talentStr = GetTrinityString(LANG_TALENT); - char const* passiveStr = GetTrinityString(LANG_PASSIVE); - - Unit::AuraApplicationMap const& uAuras = unit->GetAppliedAuras(); - PSendSysMessage(LANG_COMMAND_TARGET_LISTAURAS, uAuras.size()); - for (Unit::AuraApplicationMap::const_iterator itr = uAuras.begin(); itr != uAuras.end(); ++itr) - { - bool talent = GetTalentSpellCost(itr->second->GetBase()->GetId()) > 0; - - AuraApplication const* aurApp = itr->second; - Aura const* aura = aurApp->GetBase(); - char const* name = aura->GetSpellInfo()->SpellName[GetSessionDbcLocale()]; - - std::ostringstream ss_name; - ss_name << "|cffffffff|Hspell:" << aura->GetId() << "|h[" << name << "]|h|r"; - - PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, aura->GetId(), (m_session ? ss_name.str().c_str() : name), - aurApp->GetEffectMask(), aura->GetCharges(), aura->GetStackAmount(), aurApp->GetSlot(), - aura->GetDuration(), aura->GetMaxDuration(), (aura->IsPassive() ? passiveStr : ""), - (talent ? talentStr : ""), IS_PLAYER_GUID(aura->GetCasterGUID()) ? "player" : "creature", - GUID_LOPART(aura->GetCasterGUID())); - } - for (uint16 i = 0; i < TOTAL_AURAS; ++i) - { - Unit::AuraEffectList const& uAuraList = unit->GetAuraEffectsByType(AuraType(i)); - if (uAuraList.empty()) - continue; - - PSendSysMessage(LANG_COMMAND_TARGET_LISTAURATYPE, uAuraList.size(), i); - for (Unit::AuraEffectList::const_iterator itr = uAuraList.begin(); itr != uAuraList.end(); ++itr) - { - PSendSysMessage(LANG_COMMAND_TARGET_AURASIMPLE, (*itr)->GetId(), (*itr)->GetEffIndex(), - (*itr)->GetAmount()); - } - } - return true; -} - bool ChatHandler::HandleResetAchievementsCommand (const char * args) { Player* target; diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index 86e1baeb52d..962efd1d79c 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_cast.cpp + Commands/cs_character.cpp Commands/cs_debug.cpp Commands/cs_event.cpp Commands/cs_gm.cpp @@ -21,6 +22,7 @@ set(scripts_STAT_SRCS Commands/cs_honor.cpp Commands/cs_instance.cpp Commands/cs_learn.cpp + Commands/cs_list.cpp Commands/cs_misc.cpp Commands/cs_modify.cpp Commands/cs_npc.cpp @@ -30,13 +32,10 @@ set(scripts_STAT_SRCS Commands/cs_server.cpp Commands/cs_titles.cpp Commands/cs_wp.cpp - Commands/cs_character.cpp -# Commands/cs_list.cpp # Commands/cs_lookup.cpp # Commands/cs_pdump.cpp # Commands/cs_guild.cpp # Commands/cs_reset.cpp -# Commands/cs_server.cpp # Commands/cs_channel.cpp # Commands/cs_pet.cpp # Commands/cs_ticket.cpp diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp new file mode 100644 index 00000000000..bec5eacdc21 --- /dev/null +++ b/src/server/scripts/Commands/cs_list.cpp @@ -0,0 +1,467 @@ +/* + * 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: list_commandscript +%Complete: 100 +Comment: All list related commands +Category: commandscripts +EndScriptData */ + +#include "ScriptMgr.h" +#include "Chat.h" +#include "SpellAuraEffects.h" + +class list_commandscript : public CommandScript +{ +public: + list_commandscript() : CommandScript("list_commandscript") { } + + ChatCommand* GetCommands() const + { + static ChatCommand listCommandTable[] = + { + { "creature", SEC_ADMINISTRATOR, true, &HandleListCreatureCommand, "", NULL }, + { "item", SEC_ADMINISTRATOR, true, &HandleListItemCommand, "", NULL }, + { "object", SEC_ADMINISTRATOR, true, &HandleListObjectCommand, "", NULL }, + { "auras", SEC_ADMINISTRATOR, false, &HandleListAurasCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + static ChatCommand commandTable[] = + { + { "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable }, + { NULL, 0, false, NULL, "", NULL } + }; + return commandTable; + } + + static bool HandleListCreatureCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + // number or [name] Shift-click form |color|Hcreature_entry:creature_id|h[name]|h|r + char* id = handler->extractKeyFromLink((char*)args, "Hcreature_entry"); + if (!id) + return false; + + uint32 creatureId = atol(id); + if (!creatureId) + { + handler->PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, creatureId); + handler->SetSentErrorMessage(true); + return false; + } + + CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creatureId); + if (!cInfo) + { + handler->PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, creatureId); + handler->SetSentErrorMessage(true); + return false; + } + + char* countStr = strtok(NULL, " "); + uint32 count = countStr ? atol(countStr) : 10; + + if (count < 0) + return false; + + QueryResult result; + + uint32 creatureCount = 0; + result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='%u'", creatureId); + if (result) + creatureCount = (*result)[0].GetUInt64(); + + if (handler->GetSession()) + { + Player* player = handler->GetSession()->GetPlayer(); + result = WorldDatabase.PQuery("SELECT guid, 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 creature WHERE id = '%u' ORDER BY order_ ASC LIMIT %u", + player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), creatureId, count); + } + else + result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map FROM creature WHERE id = '%u' LIMIT %u", + creatureId, count); + + if (result) + { + do + { + Field* fields = result->Fetch(); + uint32 guid = fields[0].GetUInt32(); + float x = fields[1].GetFloat(); + float y = fields[2].GetFloat(); + float z = fields[3].GetFloat(); + uint16 mapId = fields[4].GetUInt16(); + + if (handler->GetSession()) + handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, guid, cInfo->Name.c_str(), x, y, z, mapId); + else + handler->PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, cInfo->Name.c_str(), x, y, z, mapId); + } + while (result->NextRow()); + } + + handler->PSendSysMessage(LANG_COMMAND_LISTCREATUREMESSAGE, creatureId, creatureCount); + + return true; + } + + static bool HandleListItemCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char* id = handler->extractKeyFromLink((char*)args, "Hitem"); + if (!id) + return false; + + uint32 itemId = atol(id); + if (!itemId) + { + handler->PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId); + handler->SetSentErrorMessage(true); + return false; + } + + ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId); + if (!itemTemplate) + { + handler->PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId); + handler->SetSentErrorMessage(true); + return false; + } + + char* countStr = strtok(NULL, " "); + uint32 count = countStr ? atol(countStr) : 10; + + if (count < 0) + return false; + + PreparedQueryResult result; + + // inventory case + uint32 inventoryCount = 0; + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM); + stmt->setUInt32(0, itemId); + result = CharacterDatabase.Query(stmt); + + if (result) + inventoryCount = (*result)[0].GetUInt64(); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY); + stmt->setUInt32(0, itemId); + stmt->setUInt32(1, count); + result = CharacterDatabase.Query(stmt); + + if (result) + { + do + { + Field* fields = result->Fetch(); + uint32 itemGuid = fields[0].GetUInt32(); + uint32 itemBag = fields[1].GetUInt32(); + uint8 itemSlot = fields[2].GetUInt8(); + uint32 ownerGuid = fields[3].GetUInt32(); + uint32 ownerAccountId = fields[4].GetUInt32(); + std::string ownerName = fields[5].GetString(); + + char const* itemPos = 0; + if (Player::IsEquipmentPos(itemBag, itemSlot)) + itemPos = "[equipped]"; + else if (Player::IsInventoryPos(itemBag, itemSlot)) + itemPos = "[in inventory]"; + else if (Player::IsBankPos(itemBag, itemSlot)) + itemPos = "[in bank]"; + else + itemPos = ""; + + handler->PSendSysMessage(LANG_ITEMLIST_SLOT, itemGuid, ownerName.c_str(), ownerGuid, ownerAccountId, itemPos); + } + while (result->NextRow()); + + uint32 resultCount = uint32(result->GetRowCount()); + + if (count > resultCount) + count -= resultCount; + else if (count) + count = 0; + } + + // mail case + uint32 mailCount; + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_COUNT_ITEM); + stmt->setUInt32(0, itemId); + result = CharacterDatabase.Query(stmt); + + if (result) + mailCount = (*result)[0].GetUInt64(); + + if (count > 0) + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_ITEMS_BY_ENTRY); + stmt->setUInt32(0, itemId); + stmt->setUInt32(1, count); + result = CharacterDatabase.Query(stmt); + } + else + result = PreparedQueryResult(NULL); + + if (result) + { + do + { + Field* fields = result->Fetch(); + uint32 itemGuid = fields[0].GetUInt32(); + uint32 itemSender = fields[1].GetUInt32(); + uint32 itemReceiver = fields[2].GetUInt32(); + uint32 itemSenderAccountId = fields[3].GetUInt32(); + std::string itemSenderName = fields[4].GetString(); + uint32 itemReceiverAccount = fields[5].GetUInt32(); + std::string itemReceiverName = fields[6].GetString(); + + char const* itemPos = "[in mail]"; + + handler->PSendSysMessage(LANG_ITEMLIST_MAIL, itemGuid, itemSenderName.c_str(), itemSender, itemSenderAccountId, itemReceiverName.c_str(), itemReceiver, itemReceiverAccount, itemPos); + } + while (result->NextRow()); + + uint32 resultCount = uint32(result->GetRowCount()); + + if (count > resultCount) + count -= resultCount; + else if (count) + count = 0; + } + + // auction case + uint32 auctionCount = 0; + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONHOUSE_COUNT_ITEM); + stmt->setUInt32(0, itemId); + result = CharacterDatabase.Query(stmt); + + if (result) + auctionCount = (*result)[0].GetUInt64(); + + if (count > 0) + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY); + stmt->setUInt32(0, itemId); + stmt->setUInt32(1, count); + result = CharacterDatabase.Query(stmt); + } + else + result = PreparedQueryResult(NULL); + + if (result) + { + do + { + Field* fields = result->Fetch(); + uint32 itemGuid = fields[0].GetUInt32(); + uint32 owner = fields[1].GetUInt32(); + uint32 ownerAccountId = fields[2].GetUInt32(); + std::string ownerName = fields[3].GetString(); + + char const* itemPos = "[in auction]"; + + handler->PSendSysMessage(LANG_ITEMLIST_AUCTION, itemGuid, ownerName.c_str(), owner, ownerAccountId, itemPos); + } + while (result->NextRow()); + } + + // guild bank case + uint32 guildCount = 0; + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_COUNT_ITEM); + stmt->setUInt32(0, itemId); + result = CharacterDatabase.Query(stmt); + + if (result) + guildCount = (*result)[0].GetUInt64(); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY); + stmt->setUInt32(0, itemId); + stmt->setUInt32(1, count); + result = CharacterDatabase.Query(stmt); + + if (result) + { + do + { + Field* fields = result->Fetch(); + uint32 itemGuid = fields[0].GetUInt32(); + uint32 guildGuid = fields[1].GetUInt32(); + std::string guildName = fields[2].GetString(); + + char const* itemPos = "[in guild bank]"; + + handler->PSendSysMessage(LANG_ITEMLIST_GUILD, itemGuid, guildName.c_str(), guildGuid, itemPos); + } + while (result->NextRow()); + + uint32 resultCount = uint32(result->GetRowCount()); + + if (count > resultCount) + count -= resultCount; + else if (count) + count = 0; + } + + if (inventoryCount + mailCount + auctionCount + guildCount == 0) + { + handler->SendSysMessage(LANG_COMMAND_NOITEMFOUND); + handler->SetSentErrorMessage(true); + return false; + } + + handler->PSendSysMessage(LANG_COMMAND_LISTITEMMESSAGE, itemId, inventoryCount + mailCount + auctionCount + guildCount, inventoryCount, mailCount, auctionCount, guildCount); + + return true; + } + + static bool HandleListObjectCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + // number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r + char* id = handler->extractKeyFromLink((char*)args, "Hgameobject_entry"); + if (!id) + return false; + + uint32 gameObjectId = atol(id); + if (!gameObjectId) + { + handler->PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, gameObjectId); + handler->SetSentErrorMessage(true); + return false; + } + + GameObjectTemplate const* gInfo = sObjectMgr->GetGameObjectTemplate(gameObjectId); + if (!gInfo) + { + handler->PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, gameObjectId); + handler->SetSentErrorMessage(true); + return false; + } + + char* countStr = strtok(NULL, " "); + uint32 count = countStr ? atol(countStr) : 10; + + if (count < 0) + return false; + + QueryResult result; + + uint32 objectCount = 0; + result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='%u'", gameObjectId); + if (result) + objectCount = (*result)[0].GetUInt64(); + + if (handler->GetSession()) + { + Player* player = handler->GetSession()->GetPlayer(); + result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE id = '%u' ORDER BY order_ ASC LIMIT %u", + player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), gameObjectId, count); + } + else + result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id FROM gameobject WHERE id = '%u' LIMIT %u", + gameObjectId, count); + + if (result) + { + do + { + Field* fields = result->Fetch(); + uint32 guid = fields[0].GetUInt32(); + float x = fields[1].GetFloat(); + float y = fields[2].GetFloat(); + float z = fields[3].GetFloat(); + uint16 mapId = fields[4].GetUInt16(); + uint32 entry = fields[5].GetUInt32(); + + if (handler->GetSession()) + handler->PSendSysMessage(LANG_GO_LIST_CHAT, guid, entry, guid, gInfo->name.c_str(), x, y, z, mapId); + else + handler->PSendSysMessage(LANG_GO_LIST_CONSOLE, guid, gInfo->name.c_str(), x, y, z, mapId); + } + while (result->NextRow()); + } + + handler->PSendSysMessage(LANG_COMMAND_LISTOBJMESSAGE, gameObjectId, objectCount); + + return true; + } + + static bool HandleListAurasCommand(ChatHandler* handler, char const* /*args*/) + { + Unit* unit = handler->getSelectedUnit(); + if (!unit) + { + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + char const* talentStr = handler->GetTrinityString(LANG_TALENT); + char const* passiveStr = handler->GetTrinityString(LANG_PASSIVE); + + Unit::AuraApplicationMap const& auras = unit->GetAppliedAuras(); + handler->PSendSysMessage(LANG_COMMAND_TARGET_LISTAURAS, auras.size()); + for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) + { + bool talent = GetTalentSpellCost(itr->second->GetBase()->GetId()) > 0; + + AuraApplication const* aurApp = itr->second; + Aura const* aura = aurApp->GetBase(); + char const* name = aura->GetSpellInfo()->SpellName[handler->GetSessionDbcLocale()]; + + std::ostringstream ss_name; + ss_name << "|cffffffff|Hspell:" << aura->GetId() << "|h[" << name << "]|h|r"; + + handler->PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, aura->GetId(), (handler->GetSession() ? ss_name.str().c_str() : name), + aurApp->GetEffectMask(), aura->GetCharges(), aura->GetStackAmount(), aurApp->GetSlot(), + aura->GetDuration(), aura->GetMaxDuration(), (aura->IsPassive() ? passiveStr : ""), + (talent ? talentStr : ""), IS_PLAYER_GUID(aura->GetCasterGUID()) ? "player" : "creature", + GUID_LOPART(aura->GetCasterGUID())); + } + + for (uint16 i = 0; i < TOTAL_AURAS; ++i) + { + Unit::AuraEffectList const& auraList = unit->GetAuraEffectsByType(AuraType(i)); + if (auraList.empty()) + continue; + + handler->PSendSysMessage(LANG_COMMAND_TARGET_LISTAURATYPE, auraList.size(), i); + + for (Unit::AuraEffectList::const_iterator itr = auraList.begin(); itr != auraList.end(); ++itr) + handler->PSendSysMessage(LANG_COMMAND_TARGET_AURASIMPLE, (*itr)->GetId(), (*itr)->GetEffIndex(), (*itr)->GetAmount()); + } + + return true; + } +}; + +void AddSC_list_commandscript() +{ + new list_commandscript(); +} -- cgit v1.2.3 From 3368e888a182969e2a6a5bf56ee35b8971714628 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Thu, 21 Jun 2012 18:21:34 +0200 Subject: Core/Commands: Fix some codestyle for a312cd4ba1f47d3dceb774091ec143c90a298cda --- src/server/scripts/Commands/cs_character.cpp | 150 ++++++------ src/server/scripts/Commands/cs_server.cpp | 342 ++++++++++++++------------- 2 files changed, 252 insertions(+), 240 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index 1784d73cbab..a40b586f8c8 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -48,7 +48,7 @@ public: { "customize", SEC_GAMEMASTER, true, &HandleCharacterCustomizeCommand, "", NULL }, { "changefaction", SEC_GAMEMASTER, true, &HandleCharacterChangeFactionCommand, "", NULL }, { "changerace", SEC_GAMEMASTER, true, &HandleCharacterChangeRaceCommand, "", NULL }, - { "deleted", SEC_GAMEMASTER, true, NULL, "", characterDeletedCommandTable}, + { "deleted", SEC_GAMEMASTER, true, NULL, "", characterDeletedCommandTable}, { "erase", SEC_CONSOLE, true, &HandleCharacterEraseCommand, "", NULL }, { "level", SEC_ADMINISTRATOR, true, &HandleCharacterLevelCommand, "", NULL }, { "rename", SEC_GAMEMASTER, true, &HandleCharacterRenameCommand, "", NULL }, @@ -59,17 +59,16 @@ public: static ChatCommand commandTable[] = { - { "character", SEC_GAMEMASTER, true, NULL, "", characterCommandTable}, - { NULL, 0, false, NULL, "", NULL } - }; - + { "character", SEC_GAMEMASTER, true, NULL, "", characterCommandTable}, + { NULL, 0, false, NULL, "", NULL } + }; return commandTable; } // Stores informations about a deleted character struct DeletedInfo { - uint32 lowguid; ///< the low GUID from the character + uint32 lowGuid; ///< the low GUID from the character std::string name; ///< the character name uint32 accountId; ///< the account id std::string accountName; ///< the account name @@ -95,9 +94,7 @@ public: if (isNumeric(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 @@ -105,42 +102,38 @@ public: { if (!normalizePlayerName(searchString)) return false; - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_NAME); - - stmt->setString(0, searchString); - + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_NAME); + stmt->setString(0, searchString); result = CharacterDatabase.Query(stmt); } } else { - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO); - + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO); result = CharacterDatabase.Query(stmt); } - + if (result) { do { Field* fields = result->Fetch(); - + DeletedInfo info; - - info.lowguid = fields[0].GetUInt32(); + + info.lowGuid = fields[0].GetUInt32(); info.name = fields[1].GetString(); info.accountId = fields[2].GetUInt32(); - + // account name will be empty for not existed account AccountMgr::GetName(info.accountId, info.accountName); - - info.deleteDate = time_t(fields[3].GetUInt32()); - + info.deleteDate = time_t(fields[3].GetUInt32()); foundList.push_back(info); - } while (result->NextRow()); + } + while (result->NextRow()); } - + return true; } @@ -162,21 +155,21 @@ public: handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_HEADER); handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR); } - + for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr) { std::string dateStr = TimeToTimestampStr(itr->deleteDate); - + if (!handler->GetSession()) handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CONSOLE, - itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), + itr->lowGuid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), itr->accountId, dateStr.c_str()); else handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CHAT, - itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), + itr->lowGuid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), itr->accountId, dateStr.c_str()); } - + if (!handler->GetSession()) handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR); } @@ -195,36 +188,34 @@ public: { if (delInfo.accountName.empty()) // account not exist { - handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name.c_str(), delInfo.lowGuid, delInfo.accountId); return; } - + // check character count uint32 charcount = AccountMgr::GetCharactersCount(delInfo.accountId); if (charcount >= 10) { - handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.lowGuid, delInfo.accountId); return; } - + if (sObjectMgr->GetPlayerGUIDByName(delInfo.name)) { - handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId); + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.lowGuid, delInfo.accountId); return; } - + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_RESTORE_DELETE_INFO); - stmt->setString(0, delInfo.name); stmt->setUInt32(1, delInfo.accountId); - stmt->setUInt32(2, delInfo.lowguid); - + stmt->setUInt32(2, delInfo.lowGuid); CharacterDatabase.Execute(stmt); - + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_DATA); - stmt->setUInt32(0, delInfo.lowguid); + 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()); } static bool HandleCharacterTitlesCommand(ChatHandler* handler, char const* args) @@ -265,6 +256,7 @@ public: handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr); } } + return true; } @@ -294,11 +286,13 @@ public: std::string oldNameLink = handler->playerLink(targetName); handler->PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); stmt->setUInt16(0, uint16(AT_LOGIN_RENAME)); stmt->setUInt32(1, GUID_LOPART(targetGuid)); CharacterDatabase.Execute(stmt); } + return true; } @@ -318,12 +312,12 @@ public: } Player* target; - uint64 target_guid; - std::string target_name; - if (!handler->extractPlayerTarget(nameStr, &target, &target_guid, &target_name)) - return false; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &targetName)) + return false; - int32 oldlevel = target ? target->getLevel() : Player::GetLevelFromDB(target_guid); + int32 oldlevel = target ? target->getLevel() : Player::GetLevelFromDB(targetGuid); int32 newlevel = levelStr ? atoi(levelStr) : oldlevel; if (newlevel < 1) @@ -332,10 +326,10 @@ public: if (newlevel > STRONG_MAX_LEVEL) // hardcoded maximum level newlevel = STRONG_MAX_LEVEL; - handler->HandleCharacterLevel(target, target_guid, oldlevel, newlevel); + handler->HandleCharacterLevel(target, targetGuid, oldlevel, newlevel); if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target) // including player == NULL { - std::string nameLink = handler->playerLink(target_name); + std::string nameLink = handler->playerLink(targetName); handler->PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newlevel); } @@ -438,7 +432,7 @@ public: FactionStateList const& targetFSL = target->GetReputationMgr().GetStateList(); for (FactionStateList::const_iterator itr = targetFSL.begin(); itr != targetFSL.end(); ++itr) { - const FactionState& faction = itr->second; + FactionState const& faction = itr->second; FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID); char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#"; ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry); @@ -463,9 +457,10 @@ public: ss << handler->GetTrinityString(LANG_FACTION_INVISIBLE_FORCED); if (faction.Flags & FACTION_FLAG_INACTIVE) ss << handler->GetTrinityString(LANG_FACTION_INACTIVE); - + handler->SendSysMessage(ss.str().c_str()); } + return true; } @@ -493,6 +488,7 @@ public: } HandleCharacterDeletedListHelper(foundList, handler); + return true; } @@ -593,7 +589,7 @@ public: // Call the appropriate function to delete them (current account for deleted characters is 0) for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr) - Player::DeleteFromDB(itr->lowguid, 0, false, true); + Player::DeleteFromDB(itr->lowGuid, 0, false, true); return true; } @@ -609,17 +605,17 @@ public: * * @param args the search string which either contains a player GUID or a part fo the character-name */ - static bool HandleCharacterDeletedOldCommand(ChatHandler* handler, char const* args) + static bool HandleCharacterDeletedOldCommand(ChatHandler* /*handler*/, char const* args) { int32 keepDays = sWorld->getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS); - char* px = strtok((char*)args, " "); - if (px) + char* daysStr = strtok((char*)args, " "); + if (daysStr) { - if (!isNumeric(px)) + if (!isNumeric(daysStr)) return false; - keepDays = atoi(px); + keepDays = atoi(daysStr); if (keepDays < 0) return false; } @@ -627,7 +623,8 @@ public: else if (keepDays <= 0) return false; - Player::DeleteOldCharacters((uint32)keepDays); + Player::DeleteOldCharacters(uint32(keepDays)); + return true; } @@ -636,41 +633,42 @@ public: if (!*args) return false; - char *character_name_str = strtok((char*)args, " "); - if (!character_name_str) + char* characterName_str = strtok((char*)args, " "); + if (!characterName_str) return false; - std::string character_name = character_name_str; - if (!normalizePlayerName(character_name)) + std::string characterName = characterName_str; + if (!normalizePlayerName(characterName)) return false; - uint64 character_guid; - uint32 account_id; + uint64 characterGuid; + uint32 accountId; - Player* player = sObjectAccessor->FindPlayerByName(character_name.c_str()); + Player* player = sObjectAccessor->FindPlayerByName(characterName.c_str()); if (player) { - character_guid = player->GetGUID(); - account_id = player->GetSession()->GetAccountId(); + characterGuid = player->GetGUID(); + accountId = player->GetSession()->GetAccountId(); player->GetSession()->KickPlayer(); } else { - character_guid = sObjectMgr->GetPlayerGUIDByName(character_name); - if (!character_guid) + characterGuid = sObjectMgr->GetPlayerGUIDByName(characterName); + if (!characterGuid) { - handler->PSendSysMessage(LANG_NO_PLAYER, character_name.c_str()); + handler->PSendSysMessage(LANG_NO_PLAYER, characterName.c_str()); handler->SetSentErrorMessage(true); return false; } - account_id = sObjectMgr->GetPlayerAccountIdByGUID(character_guid); + accountId = sObjectMgr->GetPlayerAccountIdByGUID(characterGuid); } - std::string account_name; - AccountMgr::GetName (account_id, account_name); + std::string accountName; + AccountMgr::GetName(accountId, accountName); + + Player::DeleteFromDB(characterGuid, accountId, true, true); + handler->PSendSysMessage(LANG_CHARACTER_DELETED, characterName.c_str(), GUID_LOPART(characterGuid), accountName.c_str(), accountId); - Player::DeleteFromDB(character_guid, account_id, true, true); - handler->PSendSysMessage(LANG_CHARACTER_DELETED, character_name.c_str(), GUID_LOPART(character_guid), account_name.c_str(), account_id); return true; } }; @@ -678,4 +676,4 @@ public: void AddSC_character_commandscript() { new character_commandscript(); -} \ No newline at end of file +} diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index 2e5b929d460..8f10af5fe2a 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -37,83 +37,83 @@ public: { static ChatCommand serverIdleRestartCommandTable[] = { - { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, - { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleRestartCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleRestartCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverIdleShutdownCommandTable[] = { - { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, - { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleShutDownCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleShutDownCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverRestartCommandTable[] = { - { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, - { "" , SEC_ADMINISTRATOR, true, &HandleServerRestartCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , SEC_ADMINISTRATOR, true, &HandleServerRestartCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverShutdownCommandTable[] = - { - { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, - { "" , SEC_ADMINISTRATOR, true, &HandleServerShutDownCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { + { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , SEC_ADMINISTRATOR, true, &HandleServerShutDownCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverSetCommandTable[] = { - { "difftime", SEC_CONSOLE, true, &HandleServerSetDiffTimeCommand, "", NULL }, - { "loglevel", SEC_CONSOLE, true, &HandleServerSetLogLevelCommand, "", NULL }, - { "logfilelevel", SEC_CONSOLE, true, &HandleServerSetLogFileLevelCommand, "", NULL }, - { "motd", SEC_ADMINISTRATOR, true, &HandleServerSetMotdCommand, "", NULL }, - { "closed", SEC_ADMINISTRATOR, true, &HandleServerSetClosedCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "difftime", SEC_CONSOLE, true, &HandleServerSetDiffTimeCommand, "", NULL }, + { "loglevel", SEC_CONSOLE, true, &HandleServerSetLogLevelCommand, "", NULL }, + { "logfilelevel", SEC_CONSOLE, true, &HandleServerSetLogFileLevelCommand, "", NULL }, + { "motd", SEC_ADMINISTRATOR, true, &HandleServerSetMotdCommand, "", NULL }, + { "closed", SEC_ADMINISTRATOR, true, &HandleServerSetClosedCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverCommandTable[] = { - { "corpses", SEC_GAMEMASTER, true, &HandleServerCorpsesCommand, "", NULL }, - { "exit", SEC_CONSOLE, true, &HandleServerExitCommand, "", NULL }, - { "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable }, - { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverIdleShutdownCommandTable }, - { "info", SEC_PLAYER, true, &HandleServerInfoCommand, "", NULL }, - { "motd", SEC_PLAYER, true, &HandleServerMotdCommand, "", NULL }, - { "plimit", SEC_ADMINISTRATOR, true, &HandleServerPLimitCommand, "", NULL }, - { "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable }, - { "shutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable }, - { "set", SEC_ADMINISTRATOR, true, NULL, "", serverSetCommandTable }, - { "togglequerylog", SEC_CONSOLE, true, &HandleServerToggleQueryLogging, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "corpses", SEC_GAMEMASTER, true, &HandleServerCorpsesCommand, "", NULL }, + { "exit", SEC_CONSOLE, true, &HandleServerExitCommand, "", NULL }, + { "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable }, + { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverIdleShutdownCommandTable }, + { "info", SEC_PLAYER, true, &HandleServerInfoCommand, "", NULL }, + { "motd", SEC_PLAYER, true, &HandleServerMotdCommand, "", NULL }, + { "plimit", SEC_ADMINISTRATOR, true, &HandleServerPLimitCommand, "", NULL }, + { "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable }, + { "shutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable }, + { "set", SEC_ADMINISTRATOR, true, NULL, "", serverSetCommandTable }, + { "togglequerylog", SEC_CONSOLE, true, &HandleServerToggleQueryLogging, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } // Triggering corpses expire check in world - static bool HandleServerCorpsesCommand(ChatHandler* handler, char const* args) + static bool HandleServerCorpsesCommand(ChatHandler* /*handler*/, char const* /*args*/) { sObjectAccessor->RemoveOldCorpses(); return true; } - static bool HandleServerInfoCommand(ChatHandler* handler, char const* args) + static bool HandleServerInfoCommand(ChatHandler* handler, char const* /*args*/) { - uint32 playersNum = sWorld->GetPlayerCount(); - uint32 maxPlayersNum = sWorld->GetMaxPlayerCount(); - uint32 activeClientsNum = sWorld->GetActiveSessionCount(); - uint32 queuedClientsNum = sWorld->GetQueuedSessionCount(); - uint32 maxActiveClientsNum = sWorld->GetMaxActiveSessionCount(); - uint32 maxQueuedClientsNum = sWorld->GetMaxQueuedSessionCount(); - std::string uptime = secsToTimeString(sWorld->GetUptime()); - uint32 updateTime = sWorld->GetUpdateTime(); + uint32 playersNum = sWorld->GetPlayerCount(); + uint32 maxPlayersNum = sWorld->GetMaxPlayerCount(); + uint32 activeClientsNum = sWorld->GetActiveSessionCount(); + uint32 queuedClientsNum = sWorld->GetQueuedSessionCount(); + uint32 maxActiveClientsNum = sWorld->GetMaxActiveSessionCount(); + uint32 maxQueuedClientsNum = sWorld->GetMaxQueuedSessionCount(); + std::string uptime = secsToTimeString(sWorld->GetUptime()); + uint32 updateTime = sWorld->GetUpdateTime(); handler->SendSysMessage(_FULLVERSION); handler->PSendSysMessage(LANG_CONNECTED_PLAYERS, playersNum, maxPlayersNum); @@ -127,7 +127,7 @@ public: return true; } // Display the 'Message of the day' for the realm - static bool HandleServerMotdCommand(ChatHandler* handler, char const* args) + static bool HandleServerMotdCommand(ChatHandler* handler, char const* /*args*/) { handler->PSendSysMessage(LANG_MOTD_CURRENT, sWorld->GetMotd()); return true; @@ -137,199 +137,212 @@ public: { if (*args) { - char* param = strtok((char*)args, " "); - if (!param) + char* paramStr = strtok((char*)args, " "); + if (!paramStr) return false; - int l = strlen(param); + int32 limit = strlen(paramStr); - if (strncmp(param, "player", l) == 0) + if (strncmp(paramStr, "player", limit) == 0) sWorld->SetPlayerSecurityLimit(SEC_PLAYER); - else if (strncmp(param, "moderator", l) == 0) + else if (strncmp(paramStr, "moderator", limit) == 0) sWorld->SetPlayerSecurityLimit(SEC_MODERATOR); - else if (strncmp(param, "gamemaster", l) == 0) + else if (strncmp(paramStr, "gamemaster", limit) == 0) sWorld->SetPlayerSecurityLimit(SEC_GAMEMASTER); - else if (strncmp(param, "administrator", l) == 0) + else if (strncmp(paramStr, "administrator", limit) == 0) sWorld->SetPlayerSecurityLimit(SEC_ADMINISTRATOR); - else if (strncmp(param, "reset", l) == 0) + else if (strncmp(paramStr, "reset", limit) == 0) { sWorld->SetPlayerAmountLimit(ConfigMgr::GetIntDefault("PlayerLimit", 100)); sWorld->LoadDBAllowedSecurityLevel(); } else { - int val = atoi(param); - if (val < 0) - sWorld->SetPlayerSecurityLimit(AccountTypes(uint32(-val))); + int32 value = atoi(paramStr); + if (value < 0) + sWorld->SetPlayerSecurityLimit(AccountTypes(-value)); else - sWorld->SetPlayerAmountLimit(uint32(val)); - } + sWorld->SetPlayerAmountLimit(uint32(value)); + } } - uint32 pLimit = sWorld->GetPlayerAmountLimit(); + uint32 playerAmountLimit = sWorld->GetPlayerAmountLimit(); AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit(); char const* secName = ""; switch (allowedAccountType) { - case SEC_PLAYER: secName = "Player"; break; - case SEC_MODERATOR: secName = "Moderator"; break; - case SEC_GAMEMASTER: secName = "Gamemaster"; break; - case SEC_ADMINISTRATOR: secName = "Administrator"; break; - default: secName = ""; break; + case SEC_PLAYER: + secName = "Player"; + break; + case SEC_MODERATOR: + secName = "Moderator"; + break; + case SEC_GAMEMASTER: + secName = "Gamemaster"; + break; + case SEC_ADMINISTRATOR: + secName = "Administrator"; + break; + default: + secName = ""; + break; } - handler->PSendSysMessage("Player limits: amount %u, min. security level %s.", pLimit, secName); + handler->PSendSysMessage("Player limits: amount %u, min. security level %s.", playerAmountLimit, secName); return true; } - static bool HandleServerShutDownCancelCommand(ChatHandler* handler, char const* args) + static bool HandleServerShutDownCancelCommand(ChatHandler* /*handler*/, char const* /*args*/) { sWorld->ShutdownCancel(); + return true; } - static bool HandleServerShutDownCommand(ChatHandler* handler, char const* args) + static bool HandleServerShutDownCommand(ChatHandler* /*handler*/, char const* args) { if (!*args) - return false; + return false; - char* time_str = strtok ((char*) args, " "); - char* exitcode_str = strtok (NULL, ""); + char* timeStr = strtok((char*) args, " "); + char* exitCodeStr = strtok(NULL, ""); - int32 time = atoi (time_str); + int32 time = atoi(timeStr); // Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) - return false; + if ((time == 0 && (timeStr[0] != '0' || timeStr[1] != '\0')) || time < 0) + return false; - if (exitcode_str) + if (exitCodeStr) { - int32 exitcode = atoi(exitcode_str); + int32 exitCode = atoi(exitCodeStr); - // Handle atoi() errors - if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) - return false; + // Handle atoi() errors + if (exitCode == 0 && (exitCodeStr[0] != '0' || exitCodeStr[1] != '\0')) + return false; - // Exit code should be in range of 0-125, 126-255 is used - // in many shells for their own return codes and code > 255 - // is not supported in many others - if (exitcode < 0 || exitcode > 125) - return false; + // Exit code should be in range of 0-125, 126-255 is used + // in many shells for their own return codes and code > 255 + // is not supported in many others + 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); + sWorld->ShutdownServ(time, 0, SHUTDOWN_EXIT_CODE); + return true; } - static bool HandleServerRestartCommand(ChatHandler* handler, char const* args) + static bool HandleServerRestartCommand(ChatHandler* /*handler*/, char const* args) { if (!*args) return false; - char* time_str = strtok ((char*) args, " "); - char* exitcode_str = strtok (NULL, ""); + char* timeStr = strtok((char*) args, " "); + char* exitCodeStr = strtok(NULL, ""); - int32 time = atoi (time_str); + int32 time = atoi(timeStr); // Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) + if ((time == 0 && (timeStr[0] != '0' || timeStr[1] != '\0')) || time < 0) return false; - if (exitcode_str) + if (exitCodeStr) { - int32 exitcode = atoi (exitcode_str); + int32 exitCode = atoi(exitCodeStr); - // Handle atoi() errors - if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) - return false; + // Handle atoi() errors + if (exitCode == 0 && (exitCodeStr[0] != '0' || exitCodeStr[1] != '\0')) + return false; - // Exit code should be in range of 0-125, 126-255 is used - // in many shells for their own return codes and code > 255 - // is not supported in many others - if (exitcode < 0 || exitcode > 125) - return false; + // Exit code should be in range of 0-125, 126-255 is used + // in many shells for their own return codes and code > 255 + // is not supported in many others + 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); + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE); + return true; } - static bool HandleServerIdleRestartCommand(ChatHandler* handler, char const* args) + static bool HandleServerIdleRestartCommand(ChatHandler* /*handler*/, char const* args) { if (!*args) return false; - char* time_str = strtok ((char*) args, " "); - char* exitcode_str = strtok (NULL, ""); + char* timeStr = strtok((char*) args, " "); + char* exitCodeStr = strtok(NULL, ""); - int32 time = atoi (time_str); + int32 time = atoi(timeStr); // Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) + if ((time == 0 && (timeStr[0] != '0' || timeStr[1] != '\0')) || time < 0) return false; - if (exitcode_str) + if (exitCodeStr) { - int32 exitcode = atoi (exitcode_str); + int32 exitCode = atoi(exitCodeStr); - // Handle atoi() errors - if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) - return false; + // Handle atoi() errors + if (exitCode == 0 && (exitCodeStr[0] != '0' || exitCodeStr[1] != '\0')) + return false; - // Exit code should be in range of 0-125, 126-255 is used - // in many shells for their own return codes and code > 255 - // is not supported in many others - if (exitcode < 0 || exitcode > 125) - return false; + // Exit code should be in range of 0-125, 126-255 is used + // in many shells for their own return codes and code > 255 + // is not supported in many others + 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); - return true; + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART | SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE); + return true; } - static bool HandleServerIdleShutDownCommand(ChatHandler* handler, char const* args) + static bool HandleServerIdleShutDownCommand(ChatHandler* /*handler*/, char const* args) { if (!*args) return false; - char* time_str = strtok ((char*) args, " "); - char* exitcode_str = strtok (NULL, ""); + char* timeStr = strtok((char*) args, " "); + char* exitCodeStr = strtok(NULL, ""); - int32 time = atoi (time_str); + int32 time = atoi(timeStr); // Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) + if ((time == 0 && (timeStr[0] != '0' || timeStr[1] != '\0')) || time < 0) return false; - if (exitcode_str) + if (exitCodeStr) { - int32 exitcode = atoi (exitcode_str); + int32 exitCode = atoi(exitCodeStr); - // Handle atoi() errors - if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0')) - return false; + // Handle atoi() errors + if (exitCode == 0 && (exitCodeStr[0] != '0' || exitCodeStr[1] != '\0')) + return false; - // Exit code should be in range of 0-125, 126-255 is used - // in many shells for their own return codes and code > 255 - // is not supported in many others - if (exitcode < 0 || exitcode > 125) - return false; + // Exit code should be in range of 0-125, 126-255 is used + // in many shells for their own return codes and code > 255 + // is not supported in many others + 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); + sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE); return true; } // Exit the realm - static bool HandleServerExitCommand(ChatHandler* handler, char const* args) + static bool HandleServerExitCommand(ChatHandler* handler, char const* /*args*/) { handler->SendSysMessage(LANG_COMMAND_EXIT); World::StopNow(SHUTDOWN_EXIT_CODE); @@ -349,15 +362,15 @@ public: { if (strncmp(args, "on", 3) == 0) { - handler->SendSysMessage(LANG_WORLD_CLOSED); - sWorld->SetClosed(true); - return true; + handler->SendSysMessage(LANG_WORLD_CLOSED); + sWorld->SetClosed(true); + return true; } else if (strncmp(args, "off", 4) == 0) { - handler->SendSysMessage(LANG_WORLD_OPENED); - sWorld->SetClosed(false); - return true; + handler->SendSysMessage(LANG_WORLD_OPENED); + sWorld->SetClosed(false); + return true; } handler->SendSysMessage(LANG_USE_BOL); @@ -366,61 +379,62 @@ public: } // Set the level of logging - static bool HandleServerSetLogFileLevelCommand(ChatHandler* handler, char const* args) + static bool HandleServerSetLogFileLevelCommand(ChatHandler* /*handler*/, char const* args) { if (!*args) return false; - char *NewLevel = strtok((char*)args, " "); - if (!NewLevel) + char* newLevel = strtok((char*)args, " "); + if (!newLevel) return false; - sLog->SetLogFileLevel(NewLevel); - return true; + sLog->SetLogFileLevel(newLevel); + return true; } // Set the level of logging - static bool HandleServerSetLogLevelCommand(ChatHandler* handler, char const* args) + static bool HandleServerSetLogLevelCommand(ChatHandler* /*handler*/, char const* args) { if (!*args) return false; - char *NewLevel = strtok((char*)args, " "); - if (!NewLevel) + char* newLevel = strtok((char*)args, " "); + if (!newLevel) return false; - sLog->SetLogLevel(NewLevel); - return true; + sLog->SetLogLevel(newLevel); + return true; } // set diff time record interval - static bool HandleServerSetDiffTimeCommand(ChatHandler* handler, char const* args) + static bool HandleServerSetDiffTimeCommand(ChatHandler* /*handler*/, char const* args) { if (!*args) return false; - char *NewTimeStr = strtok((char*)args, " "); - if (!NewTimeStr) + char* newTimeStr = strtok((char*)args, " "); + if (!newTimeStr) return false; - int32 NewTime =atoi(NewTimeStr); - if (NewTime < 0) + int32 newTime = atoi(newTimeStr); + if (newTime < 0) return false; - sWorld->SetRecordDiffInterval(NewTime); - printf( "Record diff every %u ms\n", NewTime); - return true; + sWorld->SetRecordDiffInterval(newTime); + printf("Record diff every %u ms\n", newTime); + + return true; } // toggle sql driver query logging - static bool HandleServerToggleQueryLogging(ChatHandler* handler,const char* args ) + static bool HandleServerToggleQueryLogging(ChatHandler* handler, char const* /*args*/) { sLog->SetSQLDriverQueryLogging(!sLog->GetSQLDriverQueryLogging()); + if (sLog->GetSQLDriverQueryLogging()) handler->PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_ENABLED); else handler->PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_DISABLED); - return true; } }; @@ -428,4 +442,4 @@ public: void AddSC_server_commandscript() { new server_commandscript(); -} \ No newline at end of file +} -- cgit v1.2.3 From 5de44b3632465d563cc5e5cc0cac964f228e4890 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Thu, 21 Jun 2012 19:59:47 +0200 Subject: Core/Commands: Convert reset commands in commandscript --- src/server/game/Chat/Chat.cpp | 13 -- src/server/game/Chat/Chat.h | 8 - src/server/game/Chat/Commands/Level3.cpp | 259 ------------------------ src/server/game/Scripting/ScriptLoader.cpp | 2 + src/server/scripts/Commands/CMakeLists.txt | 2 +- src/server/scripts/Commands/cs_reset.cpp | 312 +++++++++++++++++++++++++++++ 6 files changed, 315 insertions(+), 281 deletions(-) create mode 100644 src/server/scripts/Commands/cs_reset.cpp (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index bbfab474e22..7a146e89505 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -165,18 +165,6 @@ ChatCommand* ChatHandler::getCommandTable() { NULL, 0, false, NULL, "", NULL } }; - static ChatCommand resetCommandTable[] = - { - { "achievements", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetAchievementsCommand>, "", NULL }, - { "honor", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetHonorCommand>, "", NULL }, - { "level", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetLevelCommand>, "", NULL }, - { "spells", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetSpellsCommand>, "", NULL }, - { "stats", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetStatsCommand>, "", NULL }, - { "talents", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetTalentsCommand>, "", NULL }, - { "all", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleResetAllCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - static ChatCommand sendCommandTable[] = { { "items", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleSendItemsCommand>, "", NULL }, @@ -229,7 +217,6 @@ ChatCommand* ChatHandler::getCommandTable() { "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable }, { "guild", SEC_ADMINISTRATOR, true, NULL, "", guildCommandTable }, { "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable }, - { "reset", SEC_ADMINISTRATOR, true, NULL, "", resetCommandTable }, { "channel", SEC_ADMINISTRATOR, true, NULL, "", channelCommandTable }, diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index 9fc9b394947..bbe138b923d 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -184,14 +184,6 @@ class ChatHandler bool HandlePDumpLoadCommand(const char *args); bool HandlePDumpWriteCommand(const char *args); - bool HandleResetAchievementsCommand(const char * args); - bool HandleResetAllCommand(const char * args); - bool HandleResetHonorCommand(const char * args); - bool HandleResetLevelCommand(const char * args); - bool HandleResetSpellsCommand(const char* args); - bool HandleResetStatsCommand(const char * args); - bool HandleResetTalentsCommand(const char* args); - bool HandleSendItemsCommand(const char* args); bool HandleSendMailCommand(const char* args); bool HandleSendMessageCommand(const char * args); diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index eed4c11e1a9..e6419bf4e1e 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -1990,265 +1990,6 @@ bool ChatHandler::HandleChangeWeather(const char *args) return true; } -bool ChatHandler::HandleResetAchievementsCommand (const char * args) -{ - Player* target; - uint64 target_guid; - if (!extractPlayerTarget((char*)args, &target, &target_guid)) - return false; - - if (target) - target->GetAchievementMgr().Reset(); - else - AchievementMgr::DeleteFromDB(GUID_LOPART(target_guid)); - - return true; -} - -bool ChatHandler::HandleResetHonorCommand (const char * args) -{ - Player* target; - if (!extractPlayerTarget((char*)args, &target)) - return false; - - target->SetHonorPoints(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; -} - -static bool HandleResetStatsOrLevelHelper(Player* player) -{ - ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(player->getClass()); - if (!cEntry) - { - sLog->outError("Class %u not found in DBC (Wrong DBC files?)", player->getClass()); - return false; - } - - uint8 powertype = cEntry->powerType; - - // reset m_form if no aura - if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT)) - player->SetShapeshiftForm(FORM_NONE); - - player->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE); - player->SetFloatValue(UNIT_FIELD_COMBATREACH, DEFAULT_COMBAT_REACH); - - player->setFactionForRace(player->getRace()); - - player->SetUInt32Value(UNIT_FIELD_BYTES_0, ((player->getRace()) | (player->getClass() << 8) | (player->getGender() << 16) | (powertype << 24))); - - // reset only if player not in some form; - if (player->GetShapeshiftForm() == FORM_NONE) - player->InitDisplayIds(); - - player->SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP); - - player->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); - - //-1 is default value - player->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, uint32(-1)); - - //player->SetUInt32Value(PLAYER_FIELD_BYTES, 0xEEE00000); - return true; -} - -bool ChatHandler::HandleResetLevelCommand(const char * args) -{ - Player* target; - if (!extractPlayerTarget((char*)args, &target)) - return false; - - if (!HandleResetStatsOrLevelHelper(target)) - return false; - - uint8 oldLevel = target->getLevel(); - - // set starting level - uint32 start_level = target->getClass() != CLASS_DEATH_KNIGHT - ? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL) - : sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL); - - target->_ApplyAllLevelScaleItemMods(false); - target->SetLevel(start_level); - target->InitRunes(); - target->InitStatsForLevel(true); - target->InitTaxiNodesForLevel(); - target->InitGlyphsForLevel(); - target->InitTalentForLevel(); - target->SetUInt32Value(PLAYER_XP, 0); - - target->_ApplyAllLevelScaleItemMods(true); - - // reset level for pet - if (Pet* pet = target->GetPet()) - pet->SynchronizeLevelWithOwner(); - - sScriptMgr->OnPlayerLevelChanged(target, oldLevel); - - return true; -} - -bool ChatHandler::HandleResetStatsCommand(const char * args) -{ - Player* target; - if (!extractPlayerTarget((char*)args, &target)) - return false; - - if (!HandleResetStatsOrLevelHelper(target)) - return false; - - target->InitRunes(); - target->InitStatsForLevel(true); - target->InitTaxiNodesForLevel(); - target->InitGlyphsForLevel(); - target->InitTalentForLevel(); - - return true; -} - -bool ChatHandler::HandleResetSpellsCommand(const char* args) -{ - Player* target; - uint64 targetGuid; - std::string targetName; - if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - return false; - - if (target) - { - target->resetSpells(/* bool myClassOnly */); - - ChatHandler(target).SendSysMessage(LANG_RESET_SPELLS); - if (!m_session || m_session->GetPlayer() != target) - PSendSysMessage(LANG_RESET_SPELLS_ONLINE, GetNameLink(target).c_str()); - } - else - { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); - - stmt->setUInt16(0, uint16(AT_LOGIN_RESET_SPELLS)); - stmt->setUInt32(1, GUID_LOPART(targetGuid)); - - CharacterDatabase.Execute(stmt); - - PSendSysMessage(LANG_RESET_SPELLS_OFFLINE, targetName.c_str()); - } - - return true; -} - -bool ChatHandler::HandleResetTalentsCommand(const char* args) -{ - Player* target; - uint64 targetGuid; - std::string targetName; - if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - { - // Try reset talents as Hunter Pet - Creature* creature = getSelectedCreature(); - if (!*args && creature && creature->isPet()) - { - Unit* owner = creature->GetOwner(); - if (owner && owner->GetTypeId() == TYPEID_PLAYER && creature->ToPet()->IsPermanentPetFor(owner->ToPlayer())) - { - creature->ToPet()->resetTalents(); - owner->ToPlayer()->SendTalentsInfoData(true); - - ChatHandler(owner->ToPlayer()).SendSysMessage(LANG_RESET_PET_TALENTS); - if (!m_session || m_session->GetPlayer() != owner->ToPlayer()) - PSendSysMessage(LANG_RESET_PET_TALENTS_ONLINE, GetNameLink(owner->ToPlayer()).c_str()); - } - return true; - } - - SendSysMessage(LANG_NO_CHAR_SELECTED); - SetSentErrorMessage(true); - return false; - } - - if (target) - { - target->resetTalents(true); - target->SendTalentsInfoData(false); - ChatHandler(target).SendSysMessage(LANG_RESET_TALENTS); - if (!m_session || m_session->GetPlayer() != target) - PSendSysMessage(LANG_RESET_TALENTS_ONLINE, GetNameLink(target).c_str()); - - Pet* pet = target->GetPet(); - Pet::resetTalentsForAllPetsOf(target, pet); - if (pet) - target->SendTalentsInfoData(true); - return true; - } - else if (targetGuid) - { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); - - stmt->setUInt16(0, uint16(AT_LOGIN_NONE | AT_LOGIN_RESET_PET_TALENTS)); - stmt->setUInt32(1, GUID_LOPART(targetGuid)); - - CharacterDatabase.Execute(stmt); - - std::string nameLink = playerLink(targetName); - PSendSysMessage(LANG_RESET_TALENTS_OFFLINE, nameLink.c_str()); - return true; - } - - SendSysMessage(LANG_NO_CHAR_SELECTED); - SetSentErrorMessage(true); - return false; -} - -bool ChatHandler::HandleResetAllCommand(const char * args) -{ - if (!*args) - return false; - - std::string casename = args; - - AtLoginFlags atLogin; - - // Command specially created as single command to prevent using short case names - if (casename == "spells") - { - atLogin = AT_LOGIN_RESET_SPELLS; - sWorld->SendWorldText(LANG_RESETALL_SPELLS); - if (!m_session) - SendSysMessage(LANG_RESETALL_SPELLS); - } - else if (casename == "talents") - { - atLogin = AtLoginFlags(AT_LOGIN_RESET_TALENTS | AT_LOGIN_RESET_PET_TALENTS); - sWorld->SendWorldText(LANG_RESETALL_TALENTS); - if (!m_session) - SendSysMessage(LANG_RESETALL_TALENTS); - } - else - { - PSendSysMessage(LANG_RESETALL_UNKNOWN_CASE, args); - SetSentErrorMessage(true); - return false; - } - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ALL_AT_LOGIN_FLAGS); - - stmt->setUInt16(0, uint16(atLogin)); - - CharacterDatabase.Execute(stmt); - - TRINITY_READ_GUARD(HashMapHolder::LockType, *HashMapHolder::GetLock()); - HashMapHolder::MapType const& plist = sObjectAccessor->GetPlayers(); - for (HashMapHolder::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr) - itr->second->SetAtLoginFlag(atLogin); - - return true; -} bool ChatHandler::HandleBanAccountCommand(const char *args) { diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 94da23110b8..86b990253b0 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -60,6 +60,7 @@ void AddSC_modify_commandscript(); void AddSC_npc_commandscript(); void AddSC_quest_commandscript(); void AddSC_reload_commandscript(); +void AddSC_reset_commandscript(); void AddSC_tele_commandscript(); void AddSC_server_commandscript(); void AddSC_titles_commandscript(); @@ -666,6 +667,7 @@ void AddCommandScripts() AddSC_npc_commandscript(); AddSC_quest_commandscript(); AddSC_reload_commandscript(); + AddSC_reset_commandscript(); AddSC_tele_commandscript(); AddSC_server_commandscript(); AddSC_titles_commandscript(); diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index 962efd1d79c..c27b51a1ca2 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -28,6 +28,7 @@ set(scripts_STAT_SRCS Commands/cs_npc.cpp Commands/cs_quest.cpp Commands/cs_reload.cpp + Commands/cs_reset.cpp Commands/cs_tele.cpp Commands/cs_server.cpp Commands/cs_titles.cpp @@ -35,7 +36,6 @@ set(scripts_STAT_SRCS # Commands/cs_lookup.cpp # Commands/cs_pdump.cpp # Commands/cs_guild.cpp -# Commands/cs_reset.cpp # Commands/cs_channel.cpp # Commands/cs_pet.cpp # Commands/cs_ticket.cpp diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp new file mode 100644 index 00000000000..deb8f710b11 --- /dev/null +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -0,0 +1,312 @@ +/* + * 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: reset_commandscript +%Complete: 100 +Comment: All reset related commands +Category: commandscripts +EndScriptData */ + +#include "ScriptMgr.h" +#include "Chat.h" + +class reset_commandscript : public CommandScript +{ +public: + reset_commandscript() : CommandScript("reset_commandscript") { } + + ChatCommand* GetCommands() const + { + static ChatCommand resetCommandTable[] = + { + { "achievements", SEC_ADMINISTRATOR, true, &HandleResetAchievementsCommand, "", NULL }, + { "honor", SEC_ADMINISTRATOR, true, &HandleResetHonorCommand, "", NULL }, + { "level", SEC_ADMINISTRATOR, true, &HandleResetLevelCommand, "", NULL }, + { "spells", SEC_ADMINISTRATOR, true, &HandleResetSpellsCommand, "", NULL }, + { "stats", SEC_ADMINISTRATOR, true, &HandleResetStatsCommand, "", NULL }, + { "talents", SEC_ADMINISTRATOR, true, &HandleResetTalentsCommand, "", NULL }, + { "all", SEC_ADMINISTRATOR, true, &HandleResetAllCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + static ChatCommand commandTable[] = + { + { "reset", SEC_ADMINISTRATOR, true, NULL, "", resetCommandTable }, + { NULL, 0, false, NULL, "", NULL } + }; + return commandTable; + } + + static bool HandleResetAchievementsCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid)) + return false; + + if (target) + target->GetAchievementMgr().Reset(); + else + AchievementMgr::DeleteFromDB(GUID_LOPART(targetGuid)); + + return true; + } + + static bool HandleResetHonorCommand(ChatHandler* handler, char const* args) + { + Player* target; + if (!handler->extractPlayerTarget((char*)args, &target)) + return false; + + target->SetHonorPoints(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; + } + + static bool HandleResetStatsOrLevelHelper(Player* player) + { + ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(player->getClass()); + if (!classEntry) + { + sLog->outError("Class %u not found in DBC (Wrong DBC files?)", player->getClass()); + return false; + } + + uint8 powerType = classEntry->powerType; + + // reset m_form if no aura + if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT)) + player->SetShapeshiftForm(FORM_NONE); + + player->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE); + player->SetFloatValue(UNIT_FIELD_COMBATREACH, DEFAULT_COMBAT_REACH); + + player->setFactionForRace(player->getRace()); + + player->SetUInt32Value(UNIT_FIELD_BYTES_0, ((player->getRace()) | (player->getClass() << 8) | (player->getGender() << 16) | (powerType << 24))); + + // reset only if player not in some form; + if (player->GetShapeshiftForm() == FORM_NONE) + player->InitDisplayIds(); + + player->SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP); + + player->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + + //-1 is default value + player->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, uint32(-1)); + + //player->SetUInt32Value(PLAYER_FIELD_BYTES, 0xEEE00000); + return true; + } + + static bool HandleResetLevelCommand(ChatHandler* handler, char const* args) + { + Player* target; + if (!handler->extractPlayerTarget((char*)args, &target)) + return false; + + if (!HandleResetStatsOrLevelHelper(target)) + return false; + + uint8 oldLevel = target->getLevel(); + + // set starting level + uint32 startLevel = target->getClass() != CLASS_DEATH_KNIGHT + ? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL) + : sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL); + + target->_ApplyAllLevelScaleItemMods(false); + target->SetLevel(startLevel); + target->InitRunes(); + target->InitStatsForLevel(true); + target->InitTaxiNodesForLevel(); + target->InitGlyphsForLevel(); + target->InitTalentForLevel(); + target->SetUInt32Value(PLAYER_XP, 0); + + target->_ApplyAllLevelScaleItemMods(true); + + // reset level for pet + if (Pet* pet = target->GetPet()) + pet->SynchronizeLevelWithOwner(); + + sScriptMgr->OnPlayerLevelChanged(target, oldLevel); + + return true; + } + + static bool HandleResetSpellsCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + return false; + + if (target) + { + target->resetSpells(/* bool myClassOnly */); + + ChatHandler(target).SendSysMessage(LANG_RESET_SPELLS); + if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target) + handler->PSendSysMessage(LANG_RESET_SPELLS_ONLINE, handler->GetNameLink(target).c_str()); + } + else + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); + stmt->setUInt16(0, uint16(AT_LOGIN_RESET_SPELLS)); + stmt->setUInt32(1, GUID_LOPART(targetGuid)); + CharacterDatabase.Execute(stmt); + + handler->PSendSysMessage(LANG_RESET_SPELLS_OFFLINE, targetName.c_str()); + } + + return true; + } + + static bool HandleResetStatsCommand(ChatHandler* handler, char const* args) + { + Player* target; + if (!handler->extractPlayerTarget((char*)args, &target)) + return false; + + if (!HandleResetStatsOrLevelHelper(target)) + return false; + + target->InitRunes(); + target->InitStatsForLevel(true); + target->InitTaxiNodesForLevel(); + target->InitGlyphsForLevel(); + target->InitTalentForLevel(); + + return true; + } + + static bool HandleResetTalentsCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + { + // Try reset talents as Hunter Pet + Creature* creature = handler->getSelectedCreature(); + if (!*args && creature && creature->isPet()) + { + Unit* owner = creature->GetOwner(); + if (owner && owner->GetTypeId() == TYPEID_PLAYER && creature->ToPet()->IsPermanentPetFor(owner->ToPlayer())) + { + creature->ToPet()->resetTalents(); + owner->ToPlayer()->SendTalentsInfoData(true); + + ChatHandler(owner->ToPlayer()).SendSysMessage(LANG_RESET_PET_TALENTS); + if (!handler->GetSession() || handler->GetSession()->GetPlayer() != owner->ToPlayer()) + handler->PSendSysMessage(LANG_RESET_PET_TALENTS_ONLINE, handler->GetNameLink(owner->ToPlayer()).c_str()); + } + return true; + } + + handler->SendSysMessage(LANG_NO_CHAR_SELECTED); + handler->SetSentErrorMessage(true); + return false; + } + + if (target) + { + target->resetTalents(true); + target->SendTalentsInfoData(false); + ChatHandler(target).SendSysMessage(LANG_RESET_TALENTS); + if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target) + handler->PSendSysMessage(LANG_RESET_TALENTS_ONLINE, handler->GetNameLink(target).c_str()); + + Pet* pet = target->GetPet(); + Pet::resetTalentsForAllPetsOf(target, pet); + if (pet) + target->SendTalentsInfoData(true); + return true; + } + else if (targetGuid) + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); + stmt->setUInt16(0, uint16(AT_LOGIN_NONE | AT_LOGIN_RESET_PET_TALENTS)); + stmt->setUInt32(1, GUID_LOPART(targetGuid)); + CharacterDatabase.Execute(stmt); + + std::string nameLink = handler->playerLink(targetName); + handler->PSendSysMessage(LANG_RESET_TALENTS_OFFLINE, nameLink.c_str()); + return true; + } + + handler->SendSysMessage(LANG_NO_CHAR_SELECTED); + handler->SetSentErrorMessage(true); + return false; + } + + static bool HandleResetAllCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + std::string caseName = args; + + AtLoginFlags atLogin; + + // Command specially created as single command to prevent using short case names + if (caseName == "spells") + { + atLogin = AT_LOGIN_RESET_SPELLS; + sWorld->SendWorldText(LANG_RESETALL_SPELLS); + if (!handler->GetSession()) + handler->SendSysMessage(LANG_RESETALL_SPELLS); + } + else if (caseName == "talents") + { + atLogin = AtLoginFlags(AT_LOGIN_RESET_TALENTS | AT_LOGIN_RESET_PET_TALENTS); + sWorld->SendWorldText(LANG_RESETALL_TALENTS); + if (!handler->GetSession()) + handler->SendSysMessage(LANG_RESETALL_TALENTS); + } + else + { + handler->PSendSysMessage(LANG_RESETALL_UNKNOWN_CASE, args); + handler->SetSentErrorMessage(true); + return false; + } + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ALL_AT_LOGIN_FLAGS); + stmt->setUInt16(0, uint16(atLogin)); + CharacterDatabase.Execute(stmt); + + TRINITY_READ_GUARD(HashMapHolder::LockType, *HashMapHolder::GetLock()); + HashMapHolder::MapType const& plist = sObjectAccessor->GetPlayers(); + for (HashMapHolder::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr) + itr->second->SetAtLoginFlag(atLogin); + + return true; + } +}; + +void AddSC_reset_commandscript() +{ + new reset_commandscript(); +} -- cgit v1.2.3 From e50fa50736034404635c5392413770529c5ad570 Mon Sep 17 00:00:00 2001 From: kandera Date: Fri, 22 Jun 2012 15:54:11 -0300 Subject: fix build --- src/server/scripts/Commands/cs_list.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index bec5eacdc21..49af62ac497 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -25,6 +25,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "Chat.h" #include "SpellAuraEffects.h" +#include "ObjectAccessor.h" class list_commandscript : public CommandScript { -- cgit v1.2.3 From 9bf7ee3ee94c7951593ca35f973c74c0af43f517 Mon Sep 17 00:00:00 2001 From: kandera Date: Fri, 22 Jun 2012 16:31:35 -0300 Subject: fix build #2 --- src/server/scripts/Commands/cs_list.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index 49af62ac497..7acbc42e20e 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -26,6 +26,7 @@ EndScriptData */ #include "Chat.h" #include "SpellAuraEffects.h" #include "ObjectAccessor.h" +#include "ObjectMgr.h" class list_commandscript : public CommandScript { -- cgit v1.2.3 From e0997874f5bf8d38b67ad3dee66e3d808dd1a059 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 29 Jun 2012 21:53:35 +0200 Subject: Core/SpellScripts: Changed OnUnitTargetSelect hook to OnObjectAreaTargetSelect, it will now work with WorldObject instead of only Units and call it even for empty target lists --- src/server/game/Grids/Notifiers/GridNotifiers.h | 7 ++- src/server/game/Spells/Spell.cpp | 20 ++++--- src/server/game/Spells/Spell.h | 2 +- src/server/game/Spells/SpellScript.cpp | 30 ++++++---- src/server/game/Spells/SpellScript.h | 18 +++--- src/server/scripts/Commands/cs_instance.cpp | 2 +- src/server/scripts/Commands/cs_list.cpp | 2 +- .../BattleForMountHyjal/boss_kazrogal.cpp | 13 ++--- src/server/scripts/Kalimdor/dustwallow_marsh.cpp | 12 ++-- .../RubySanctum/boss_saviana_ragefire.cpp | 12 ++-- .../TrialOfTheChampion/boss_argent_challenge.cpp | 13 +++-- .../FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp | 18 +++--- .../IcecrownCitadel/boss_blood_queen_lana_thel.cpp | 32 +++++------ .../IcecrownCitadel/boss_deathbringer_saurfang.cpp | 38 ++++++------- .../IcecrownCitadel/boss_lord_marrowgar.cpp | 4 +- .../IcecrownCitadel/boss_professor_putricide.cpp | 44 +++++++-------- .../Northrend/IcecrownCitadel/boss_rotface.cpp | 28 +++++----- .../Northrend/IcecrownCitadel/boss_sindragosa.cpp | 45 +++++++-------- .../IcecrownCitadel/boss_the_lich_king.cpp | 64 ++++++++++++---------- .../IcecrownCitadel/boss_valithria_dreamwalker.cpp | 6 +- .../Northrend/IcecrownCitadel/icecrown_citadel.cpp | 46 ++++++++-------- .../scripts/Northrend/Naxxramas/boss_gothik.cpp | 6 +- .../scripts/Northrend/Naxxramas/boss_thaddius.cpp | 6 +- .../scripts/Northrend/Nexus/Oculus/boss_varos.cpp | 16 +++--- .../Ulduar/HallsOfStone/boss_krystallus.cpp | 2 +- .../Ulduar/Ulduar/boss_algalon_the_observer.cpp | 18 +++--- .../Northrend/Ulduar/Ulduar/boss_auriaya.cpp | 18 +++--- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 12 ++-- .../Northrend/Ulduar/Ulduar/boss_kologarn.cpp | 24 ++++---- .../scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp | 8 +-- .../scripts/Northrend/Ulduar/Ulduar/ulduar.h | 6 +- .../UtgardeKeep/UtgardePinnacle/boss_svala.cpp | 12 ++-- .../Outland/TempestKeep/Eye/boss_astromancer.cpp | 4 +- .../Mechanar/boss_mechano_lord_capacitus.cpp | 6 +- .../scripts/Outland/boss_doomlord_kazzak.cpp | 2 +- src/server/scripts/Spells/spell_dk.cpp | 13 ++--- src/server/scripts/Spells/spell_druid.cpp | 34 ++++++------ src/server/scripts/Spells/spell_paladin.cpp | 4 +- src/server/scripts/Spells/spell_priest.cpp | 6 +- src/server/scripts/Spells/spell_shaman.cpp | 29 +++++----- src/server/scripts/Spells/spell_warlock.cpp | 6 +- src/server/scripts/Spells/spell_warrior.cpp | 4 +- src/server/scripts/World/boss_emerald_dragons.cpp | 24 ++++---- src/server/shared/Packets/ByteBuffer.h | 3 +- 44 files changed, 368 insertions(+), 351 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 7bb4492f99c..072db578220 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -1325,11 +1325,16 @@ namespace Trinity { public: UnitAuraCheck(bool present, uint32 spellId, uint64 casterGUID = 0) : _present(present), _spellId(spellId), _casterGUID(casterGUID) {} - bool operator()(Unit* unit) + bool operator()(Unit* unit) const { return unit->HasAura(_spellId, _casterGUID) == _present; } + bool operator()(WorldObject* object) const + { + return object->ToUnit() && object->ToUnit()->HasAura(_spellId, _casterGUID) == _present; + } + private: bool _present; uint32 _spellId; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index f823e45525d..6b102c25882 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1041,7 +1041,9 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge { Trinity::WorldObjectSpellConeTargetCheck check(coneAngle, radius, m_caster, m_spellInfo, selectionType, condList); Trinity::WorldObjectListSearcher searcher(m_caster, targets, check, containerTypeMask); - SearchTargets > (searcher, containerTypeMask, m_caster, m_caster, radius); + SearchTargets >(searcher, containerTypeMask, m_caster, m_caster, radius); + + CallScriptObjectAreaTargetSelectHandlers(targets, effIndex); if (!targets.empty()) { @@ -1069,8 +1071,6 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge gObjTargets.push_back(gObjTarget); } - CallScriptAfterUnitTargetSelectHandlers(unitTargets, effIndex); - for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr) AddUnitTarget(*itr, effMask, false); @@ -1217,6 +1217,8 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge gObjTargets.push_back(gObjTarget); } + CallScriptObjectAreaTargetSelectHandlers(targets, effIndex); + if (!unitTargets.empty()) { // Special target selection for smart heals and energizes @@ -1342,8 +1344,6 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge Trinity::Containers::RandomResizeList(unitTargets, maxTargets); } - CallScriptAfterUnitTargetSelectHandlers(unitTargets, effIndex); - for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr) AddUnitTarget(*itr, effMask, false); } @@ -1359,6 +1359,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge Trinity::Containers::RandomResizeList(gObjTargets, maxTargets); } + for (std::list::iterator itr = gObjTargets.begin(); itr != gObjTargets.end(); ++itr) AddGOTarget(*itr, effMask); } @@ -1567,7 +1568,8 @@ void Spell::SelectImplicitChainTargets(SpellEffIndex effIndex, SpellImplicitTarg if (Unit* unitTarget = (*itr)->ToUnit()) unitTargets.push_back(unitTarget); - CallScriptAfterUnitTargetSelectHandlers(unitTargets, effIndex); + // Chain primary target is added earlier + CallScriptObjectAreaTargetSelectHandlers(targets, effIndex); for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr) AddUnitTarget(*itr, effMask, false); @@ -7036,15 +7038,15 @@ void Spell::CallScriptAfterHitHandlers() } } -void Spell::CallScriptAfterUnitTargetSelectHandlers(std::list& unitTargets, SpellEffIndex effIndex) +void Spell::CallScriptObjectAreaTargetSelectHandlers(std::list& targets, SpellEffIndex effIndex) { 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(); + std::list::iterator hookItrEnd = (*scritr)->OnObjectAreaTargetSelect.end(), hookItr = (*scritr)->OnObjectAreaTargetSelect.begin(); for (; hookItr != hookItrEnd; ++hookItr) if ((*hookItr).IsEffectAffected(m_spellInfo, effIndex)) - (*hookItr).Call(*scritr, unitTargets); + (*hookItr).Call(*scritr, targets); (*scritr)->_FinishScriptCall(); } diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 8f43b9b2290..98455904cf5 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -630,7 +630,7 @@ class Spell void CallScriptBeforeHitHandlers(); void CallScriptOnHitHandlers(); void CallScriptAfterHitHandlers(); - void CallScriptAfterUnitTargetSelectHandlers(std::list& unitTargets, SpellEffIndex effIndex); + void CallScriptObjectAreaTargetSelectHandlers(std::list& targets, SpellEffIndex effIndex); std::list m_loadedScripts; struct HitTriggerSpell diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index e6ce80c20f0..eaccb8fc005 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -203,50 +203,56 @@ void SpellScript::HitHandler::Call(SpellScript* spellScript) (spellScript->*pHitHandlerScript)(); } -SpellScript::UnitTargetHandler::UnitTargetHandler(SpellUnitTargetFnType _pUnitTargetHandlerScript, uint8 _effIndex, uint16 _targetType) +SpellScript::ObjectAreaTargetSelectHandler::ObjectAreaTargetSelectHandler(SpellObjectAreaTargetSelectFnType _pObjectAreaTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType) : _SpellScript::EffectHook(_effIndex), targetType(_targetType) { - pUnitTargetHandlerScript = _pUnitTargetHandlerScript; + pObjectAreaTargetSelectHandlerScript = _pObjectAreaTargetSelectHandlerScript; } -std::string SpellScript::UnitTargetHandler::ToString() +std::string SpellScript::ObjectAreaTargetSelectHandler::ToString() { std::ostringstream oss; oss << "Index: " << EffIndexToString() << " Target: " << targetType; return oss.str(); } -bool SpellScript::UnitTargetHandler::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) +bool SpellScript::ObjectAreaTargetSelectHandler::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) { if (!targetType) return false; - return (effIndex == EFFECT_ALL) || (spellEntry->Effects[effIndex].TargetA.GetTarget() == targetType || spellEntry->Effects[effIndex].TargetB.GetTarget() == targetType); + + if (spellEntry->Effects[effIndex].TargetA.GetTarget() != targetType && + spellEntry->Effects[effIndex].TargetB.GetTarget() != targetType) + return false; + + // TODO: Smart check if this hook will run for this targetType + return true; } -void SpellScript::UnitTargetHandler::Call(SpellScript* spellScript, std::list& unitTargets) +void SpellScript::ObjectAreaTargetSelectHandler::Call(SpellScript* spellScript, std::list& targets) { - (spellScript->*pUnitTargetHandlerScript)(unitTargets); + (spellScript->*pObjectAreaTargetSelectHandlerScript)(targets); } bool SpellScript::_Validate(SpellInfo const* entry) { - for (std::list::iterator itr = OnEffectLaunch.begin(); itr != OnEffectLaunch.end(); ++itr) + for (std::list::iterator itr = OnEffectLaunch.begin(); itr != OnEffectLaunch.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunch` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectLaunchTarget.begin(); itr != OnEffectLaunchTarget.end(); ++itr) + for (std::list::iterator itr = OnEffectLaunchTarget.begin(); itr != OnEffectLaunchTarget.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunchTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectHit.begin(); itr != OnEffectHit.end(); ++itr) + for (std::list::iterator itr = OnEffectHit.begin(); itr != OnEffectHit.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHit` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnEffectHitTarget.begin(); itr != OnEffectHitTarget.end(); ++itr) + for (std::list::iterator itr = OnEffectHitTarget.begin(); itr != OnEffectHitTarget.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHitTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); - for (std::list::iterator itr = OnUnitTargetSelect.begin(); itr != OnUnitTargetSelect.end(); ++itr) + for (std::list::iterator itr = OnObjectAreaTargetSelect.begin(); itr != OnObjectAreaTargetSelect.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnUnitTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index 7b194b7827f..a145a0b7377 100755 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -154,7 +154,7 @@ class SpellScript : public _SpellScript typedef void(CLASSNAME::*SpellEffectFnType)(SpellEffIndex); \ typedef void(CLASSNAME::*SpellHitFnType)(); \ typedef void(CLASSNAME::*SpellCastFnType)(); \ - typedef void(CLASSNAME::*SpellUnitTargetFnType)(std::list&); \ + typedef void(CLASSNAME::*SpellObjectAreaTargetSelectFnType)(std::list&); \ SPELLSCRIPT_FUNCTION_TYPE_DEFINES(SpellScript) @@ -196,15 +196,15 @@ class SpellScript : public _SpellScript SpellHitFnType pHitHandlerScript; }; - class UnitTargetHandler : public _SpellScript::EffectHook + class ObjectAreaTargetSelectHandler : public _SpellScript::EffectHook { public: - UnitTargetHandler(SpellUnitTargetFnType _pUnitTargetHandlerScript, uint8 _effIndex, uint16 _targetType); + ObjectAreaTargetSelectHandler(SpellObjectAreaTargetSelectFnType _pObjectAreaTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType); std::string ToString(); bool CheckEffect(SpellInfo const* spellEntry, uint8 targetType); - void Call(SpellScript* spellScript, std::list& unitTargets); + void Call(SpellScript* spellScript, std::list& targets); private: - SpellUnitTargetFnType pUnitTargetHandlerScript; + SpellObjectAreaTargetSelectFnType pObjectAreaTargetSelectHandlerScript; uint16 targetType; }; @@ -213,7 +213,7 @@ class SpellScript : public _SpellScript class CheckCastHandlerFunction : public SpellScript::CheckCastHandler { public: CheckCastHandlerFunction(SpellCheckCastFnType _checkCastHandlerScript) : SpellScript::CheckCastHandler((SpellScript::SpellCheckCastFnType)_checkCastHandlerScript) {} }; \ class EffectHandlerFunction : public SpellScript::EffectHandler { public: EffectHandlerFunction(SpellEffectFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : SpellScript::EffectHandler((SpellScript::SpellEffectFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \ class HitHandlerFunction : public SpellScript::HitHandler { public: HitHandlerFunction(SpellHitFnType _pHitHandlerScript) : SpellScript::HitHandler((SpellScript::SpellHitFnType)_pHitHandlerScript) {} }; \ - class UnitTargetHandlerFunction : public SpellScript::UnitTargetHandler { public: UnitTargetHandlerFunction(SpellUnitTargetFnType _pUnitTargetHandlerScript, uint8 _effIndex, uint16 _targetType) : SpellScript::UnitTargetHandler((SpellScript::SpellUnitTargetFnType)_pUnitTargetHandlerScript, _effIndex, _targetType) {} }; \ + class ObjectAreaTargetSelectHandlerFunction : public SpellScript::ObjectAreaTargetSelectHandler { public: ObjectAreaTargetSelectHandlerFunction(SpellObjectAreaTargetSelectFnType _pObjectAreaTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType) : SpellScript::ObjectAreaTargetSelectHandler((SpellScript::SpellObjectAreaTargetSelectFnType)_pObjectAreaTargetSelectHandlerScript, _effIndex, _targetType) {} }; \ #define PrepareSpellScript(CLASSNAME) SPELLSCRIPT_FUNCTION_TYPE_DEFINES(CLASSNAME) SPELLSCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME) public: @@ -269,8 +269,8 @@ class SpellScript : public _SpellScript // example: OnUnitTargetSelect += SpellUnitTargetFn(class::function, EffectIndexSpecifier, TargetsNameSpecifier); // where function is void function(std::list& targetList) - HookList OnUnitTargetSelect; - #define SpellUnitTargetFn(F, I, N) UnitTargetHandlerFunction(&F, I, N) + HookList OnObjectAreaTargetSelect; + #define SpellObjectAreaTargetSelectFn(F, I, N) ObjectAreaTargetSelectHandlerFunction(&F, I, N) // hooks are executed in following order, at specified event of spell: // 1. BeforeCast - executed when spell preparation is finished (when cast bar becomes full) before cast is handled @@ -302,7 +302,7 @@ class SpellScript : public _SpellScript // -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: + // 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 diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp index 127a3848ebc..f51727af2ef 100644 --- a/src/server/scripts/Commands/cs_instance.cpp +++ b/src/server/scripts/Commands/cs_instance.cpp @@ -66,7 +66,7 @@ public: return ss.str(); } - static bool HandleInstanceListBindsCommand(ChatHandler* handler, char const* args) + static bool HandleInstanceListBindsCommand(ChatHandler* handler, char const* /*args*/) { Player* player = handler->getSelectedPlayer(); if (!player) diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index 7acbc42e20e..746956581a6 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -207,7 +207,7 @@ public: } // mail case - uint32 mailCount; + uint32 mailCount = 0; stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_COUNT_ITEM); stmt->setUInt32(0, itemId); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index c1ae04cf4c0..9160983b0df 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -199,11 +199,10 @@ public: class MarkTargetFilter { public: - bool operator()(Unit* target) const + bool operator()(WorldObject* target) const { - if (target->getPowerType() != POWER_MANA) - return true; - + if (Unit* unit = target->ToUnit()) + return unit->getPowerType() != POWER_MANA; return false; } }; @@ -217,14 +216,14 @@ class spell_mark_of_kazrogal : public SpellScriptLoader { PrepareSpellScript(spell_mark_of_kazrogal_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove_if(MarkTargetFilter()); + targets.remove_if(MarkTargetFilter()); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_mark_of_kazrogal_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mark_of_kazrogal_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index 397b0849d5e..5800a6a58a0 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -707,16 +707,16 @@ class spell_energize_aoe : public SpellScriptLoader return true; } - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - for (std::list::iterator itr = unitList.begin(); itr != unitList.end();) + for (std::list::iterator itr = targets.begin(); itr != targets.end();) { if ((*itr)->GetTypeId() == TYPEID_PLAYER && (*itr)->ToPlayer()->GetQuestStatus(GetSpellInfo()->Effects[EFFECT_1].CalcValue()) == QUEST_STATUS_INCOMPLETE) ++itr; else - unitList.erase(itr++); + targets.erase(itr++); } - unitList.push_back(GetCaster()); + targets.push_back(GetCaster()); } void HandleScript(SpellEffIndex effIndex) @@ -728,8 +728,8 @@ class spell_energize_aoe : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_energize_aoe_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - OnUnitTargetSelect += SpellUnitTargetFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENTRY); } }; 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 4e5e01cc745..5a7809dbe70 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp @@ -186,7 +186,7 @@ class ConflagrationTargetSelector public: ConflagrationTargetSelector() { } - bool operator()(Unit* unit) + bool operator()(WorldObject* unit) const { return unit->GetTypeId() != TYPEID_PLAYER; } @@ -201,12 +201,12 @@ class spell_saviana_conflagration_init : public SpellScriptLoader { PrepareSpellScript(spell_saviana_conflagration_init_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove_if (ConflagrationTargetSelector()); + targets.remove_if(ConflagrationTargetSelector()); uint8 maxSize = uint8(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 6 : 3); - if (unitList.size() > maxSize) - Trinity::Containers::RandomResizeList(unitList, maxSize); + if (targets.size() > maxSize) + Trinity::Containers::RandomResizeList(targets, maxSize); } void HandleDummy(SpellEffIndex effIndex) @@ -218,7 +218,7 @@ class spell_saviana_conflagration_init : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_saviana_conflagration_init_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_saviana_conflagration_init_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_saviana_conflagration_init_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; 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 305266ee628..e96408acc09 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp @@ -60,9 +60,9 @@ class OrientationCheck : public std::unary_function { public: explicit OrientationCheck(Unit* _caster) : caster(_caster) { } - bool operator() (Unit* unit) + bool operator()(WorldObject* object) { - return !unit->isInFront(caster, 2.5f) || !unit->IsWithinDist(caster, 40.0f); + return !object->isInFront(caster, 2.5f) || !object->IsWithinDist(caster, 40.0f); } private: @@ -76,15 +76,16 @@ class spell_eadric_radiance : public SpellScriptLoader class spell_eadric_radiance_SpellScript : public SpellScript { PrepareSpellScript(spell_eadric_radiance_SpellScript); - void FilterTargets(std::list& unitList) + + void FilterTargets(std::list& unitList) { - unitList.remove_if (OrientationCheck(GetCaster())); + unitList.remove_if(OrientationCheck(GetCaster())); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); } }; diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp index 4a28ebe6495..5b6bf14c29e 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp @@ -359,7 +359,7 @@ class DistanceCheck public: explicit DistanceCheck(Unit* _caster) : caster(_caster) { } - bool operator() (Unit* unit) + bool operator() (WorldObject* unit) const { if (caster->GetExactDist2d(unit) <= 10.0f) return true; @@ -378,25 +378,25 @@ class spell_bronjahm_soulstorm_targeting : public SpellScriptLoader { PrepareSpellScript(spell_bronjahm_soulstorm_targeting_SpellScript); - void FilterTargetsInitial(std::list& unitList) + void FilterTargetsInitial(std::list& targets) { - unitList.remove_if (DistanceCheck(GetCaster())); - sharedUnitList = unitList; + targets.remove_if(DistanceCheck(GetCaster())); + sharedTargets = targets; } // use the same target for first and second effect - void FilterTargetsSubsequent(std::list& unitList) + void FilterTargetsSubsequent(std::list& targets) { - unitList = sharedUnitList; + targets = sharedTargets; } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_bronjahm_soulstorm_targeting_SpellScript::FilterTargetsInitial, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_bronjahm_soulstorm_targeting_SpellScript::FilterTargetsSubsequent, EFFECT_2, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_bronjahm_soulstorm_targeting_SpellScript::FilterTargetsInitial, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_bronjahm_soulstorm_targeting_SpellScript::FilterTargetsSubsequent, EFFECT_2, TARGET_UNIT_DEST_AREA_ENEMY); } - std::list sharedUnitList; + std::list sharedTargets; }; SpellScript* GetSpellScript() const 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 ee966256e2b..0d092ec86b2 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 @@ -631,9 +631,9 @@ class BloodboltHitCheck public: explicit BloodboltHitCheck(LanaThelAI* ai) : _ai(ai) {} - bool operator()(Unit* unit) + bool operator()(WorldObject* object) const { - return _ai->WasBloodbolted(unit->GetGUID()); + return _ai->WasBloodbolted(object->GetGUID()); } private: @@ -661,13 +661,13 @@ class spell_blood_queen_bloodbolt : public SpellScriptLoader return GetCaster()->GetEntry() == NPC_BLOOD_QUEEN_LANA_THEL; } - void FilterTargets(std::list& targets) + void FilterTargets(std::list& targets) { uint32 targetCount = (targets.size() + 2) / 3; - targets.remove_if (BloodboltHitCheck(static_cast(GetCaster()->GetAI()))); + targets.remove_if(BloodboltHitCheck(static_cast(GetCaster()->GetAI()))); 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) + for (std::list::const_iterator itr = targets.begin(); itr != targets.end(); ++itr) GetCaster()->GetAI()->SetGUID((*itr)->GetGUID(), GUID_BLOODBOLT); } @@ -679,7 +679,7 @@ class spell_blood_queen_bloodbolt : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_blood_queen_bloodbolt_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_blood_queen_bloodbolt_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_blood_queen_bloodbolt_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); } }; @@ -699,19 +699,19 @@ class spell_blood_queen_pact_of_the_darkfallen : public SpellScriptLoader { PrepareSpellScript(spell_blood_queen_pact_of_the_darkfallen_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove_if (Trinity::UnitAuraCheck(false, SPELL_PACT_OF_THE_DARKFALLEN)); + targets.remove_if(Trinity::UnitAuraCheck(false, SPELL_PACT_OF_THE_DARKFALLEN)); bool remove = true; - std::list::const_iterator itrEnd = unitList.end(), itr, itr2; + std::list::const_iterator itrEnd = targets.end(), itr, itr2; // we can do this, unitList is MAX 4 in size - for (itr = unitList.begin(); itr != itrEnd && remove; ++itr) + for (itr = targets.begin(); itr != itrEnd && remove; ++itr) { if (!GetCaster()->IsWithinDist(*itr, 5.0f, false)) remove = false; - for (itr2 = unitList.begin(); itr2 != itrEnd && remove; ++itr2) + for (itr2 = targets.begin(); itr2 != itrEnd && remove; ++itr2) if (itr != itr2 && !(*itr2)->IsWithinDist(*itr, 5.0f, false)) remove = false; } @@ -721,14 +721,14 @@ class spell_blood_queen_pact_of_the_darkfallen : public SpellScriptLoader if (InstanceScript* instance = GetCaster()->GetInstanceScript()) { instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PACT_OF_THE_DARKFALLEN); - unitList.clear(); + targets.clear(); } } } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_blood_queen_pact_of_the_darkfallen_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_blood_queen_pact_of_the_darkfallen_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); } }; @@ -785,15 +785,15 @@ class spell_blood_queen_pact_of_the_darkfallen_dmg_target : public SpellScriptLo { PrepareSpellScript(spell_blood_queen_pact_of_the_darkfallen_dmg_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { - unitList.remove_if (Trinity::UnitAuraCheck(true, SPELL_PACT_OF_THE_DARKFALLEN)); + unitList.remove_if(Trinity::UnitAuraCheck(true, SPELL_PACT_OF_THE_DARKFALLEN)); unitList.push_back(GetCaster()); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_blood_queen_pact_of_the_darkfallen_dmg_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_blood_queen_pact_of_the_darkfallen_dmg_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 494be259baa..5d3a6814eb2 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -1198,34 +1198,34 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader return true; } - void FilterTargetsInitial(std::list& unitList) + void FilterTargetsInitial(std::list& targets) { - if (unitList.empty()) + if (targets.empty()) return; // select one random target, with preference of ranged targets uint32 targetsAtRange = 0; uint32 const minTargets = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 10 : 4); - unitList.sort(Trinity::ObjectDistanceOrderPred(GetCaster(), false)); + targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster(), false)); // get target count at range - for (std::list::iterator itr = unitList.begin(); itr != unitList.end(); ++itr, ++targetsAtRange) + for (std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr, ++targetsAtRange) if ((*itr)->GetDistance(GetCaster()) < 12.0f) break; // set the upper cap if (targetsAtRange < minTargets) - targetsAtRange = std::min(unitList.size() - 1, minTargets); + targetsAtRange = std::min(targets.size() - 1, minTargets); - std::list::const_iterator itr = unitList.begin(); + std::list::const_iterator itr = targets.begin(); std::advance(itr, urand(0, targetsAtRange)); target = *itr; - unitList.clear(); - unitList.push_back(target); + targets.clear(); + targets.push_back(target); } // use the same target for first and second effect - void FilterTargetsSubsequent(std::list& unitList) + void FilterTargetsSubsequent(std::list& unitList) { if (!target) return; @@ -1241,12 +1241,12 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader 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); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(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; + WorldObject* target; }; SpellScript* GetSpellScript() const @@ -1269,20 +1269,20 @@ class spell_deathbringer_boiling_blood : public SpellScriptLoader return GetCaster()->GetTypeId() == TYPEID_UNIT; } - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove(GetCaster()->getVictim()); - if (unitList.empty()) + targets.remove(GetCaster()->getVictim()); + if (targets.empty()) return; - Unit* target = Trinity::Containers::SelectRandomContainerElement(unitList); - unitList.clear(); - unitList.push_back(target); + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(target); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_deathbringer_boiling_blood_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_deathbringer_boiling_blood_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 1672d8b2d87..0c5cb0aba52 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -416,7 +416,7 @@ class spell_marrowgar_coldflame : public SpellScriptLoader { PrepareSpellScript(spell_marrowgar_coldflame_SpellScript); - void SelectTarget(std::list& targets) + void SelectTarget(std::list& targets) { targets.clear(); // select any unit but not the tank (by owners threatlist) @@ -438,7 +438,7 @@ class spell_marrowgar_coldflame : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_marrowgar_coldflame_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_marrowgar_coldflame_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_marrowgar_coldflame_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index b2662b644a7..a9ba0baa86f 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -870,26 +870,26 @@ class spell_putricide_ooze_channel : public SpellScriptLoader return GetCaster()->GetTypeId() == TYPEID_UNIT; } - void SelectTarget(std::list& targetList) + void SelectTarget(std::list& targets) { - if (targetList.empty()) + if (targets.empty()) { FinishCast(SPELL_FAILED_NO_VALID_TARGETS); GetCaster()->ToCreature()->DespawnOrUnsummon(1); // despawn next update return; } - Unit* target = Trinity::Containers::SelectRandomContainerElement(targetList); - targetList.clear(); - targetList.push_back(target); + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(target); _target = target; } - void SetTarget(std::list& targetList) + void SetTarget(std::list& targets) { - targetList.clear(); + targets.clear(); if (_target) - targetList.push_back(_target); + targets.push_back(_target); } void StartAttack() @@ -912,14 +912,14 @@ class spell_putricide_ooze_channel : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_ooze_channel_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - 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); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_ooze_channel_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_ooze_channel_SpellScript::SetTarget, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(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; + WorldObject* _target; }; SpellScript* GetSpellScript() const @@ -933,7 +933,7 @@ class ExactDistanceCheck public: ExactDistanceCheck(Unit* source, float dist) : _source(source), _dist(dist) {} - bool operator()(Unit* unit) + bool operator()(WorldObject* unit) const { return _source->GetExactDist2d(unit) > _dist; } @@ -952,15 +952,15 @@ class spell_putricide_slime_puddle : public SpellScriptLoader { PrepareSpellScript(spell_putricide_slime_puddle_SpellScript); - void ScaleRange(std::list& targets) + void ScaleRange(std::list& targets) { targets.remove_if(ExactDistanceCheck(GetCaster(), 2.5f * GetCaster()->GetFloatValue(OBJECT_FIELD_SCALE_X))); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_slime_puddle_SpellScript::ScaleRange, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_slime_puddle_SpellScript::ScaleRange, EFFECT_1, TARGET_UNIT_DEST_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_slime_puddle_SpellScript::ScaleRange, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_slime_puddle_SpellScript::ScaleRange, EFFECT_1, TARGET_UNIT_DEST_AREA_ENTRY); } }; @@ -1178,13 +1178,13 @@ class spell_putricide_eat_ooze : public SpellScriptLoader { PrepareSpellScript(spell_putricide_eat_ooze_SpellScript); - void SelectTarget(std::list& targets) + void SelectTarget(std::list& targets) { if (targets.empty()) return; targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster())); - Unit* target = targets.front(); + WorldObject* target = targets.front(); targets.clear(); targets.push_back(target); } @@ -1211,7 +1211,7 @@ class spell_putricide_eat_ooze : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_putricide_eat_ooze_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_eat_ooze_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_eat_ooze_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENTRY); } }; @@ -1458,15 +1458,15 @@ class spell_putricide_mutated_transformation_dmg : public SpellScriptLoader { PrepareSpellScript(spell_putricide_mutated_transformation_dmg_SpellScript); - void FilterTargetsInitial(std::list& unitList) + void FilterTargetsInitial(std::list& targets) { if (Unit* owner = ObjectAccessor::GetUnit(*GetCaster(), GetCaster()->GetCreatorGUID())) - unitList.remove(owner); + targets.remove(owner); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_mutated_transformation_dmg_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_mutated_transformation_dmg_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index a4ab13f6ada..079a2ef48e1 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -449,23 +449,23 @@ class spell_rotface_ooze_flood : public SpellScriptLoader GetHitUnit()->CastSpell(triggers.back(), uint32(GetEffectValue()), false, NULL, NULL, GetOriginalCaster() ? GetOriginalCaster()->GetGUID() : 0); } - void FilterTargets(std::list& targetList) + void FilterTargets(std::list& targets) { // get 2 targets except 2 nearest - targetList.sort(Trinity::ObjectDistanceOrderPred(GetCaster())); + targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster())); // .resize() runs pop_back(); - if (targetList.size() > 4) - targetList.resize(4); + if (targets.size() > 4) + targets.resize(4); - while (targetList.size() > 2) - targetList.pop_front(); + while (targets.size() > 2) + targets.pop_front(); } void Register() { OnEffectHitTarget += SpellEffectFn(spell_rotface_ooze_flood_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - OnUnitTargetSelect += SpellUnitTargetFn(spell_rotface_ooze_flood_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rotface_ooze_flood_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); } }; @@ -490,7 +490,7 @@ class spell_rotface_mutated_infection : public SpellScriptLoader return true; } - void FilterTargets(std::list& targets) + void FilterTargets(std::list& targets) { // remove targets with this aura already // tank is not on this list @@ -498,13 +498,13 @@ class spell_rotface_mutated_infection : public SpellScriptLoader if (targets.empty()) return; - Unit* target = Trinity::Containers::SelectRandomContainerElement(targets); + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); _target = target; } - void ReplaceTargets(std::list& targets) + void ReplaceTargets(std::list& targets) { targets.clear(); if (_target) @@ -520,13 +520,13 @@ class spell_rotface_mutated_infection : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_rotface_mutated_infection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_rotface_mutated_infection_SpellScript::ReplaceTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_rotface_mutated_infection_SpellScript::ReplaceTargets, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rotface_mutated_infection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rotface_mutated_infection_SpellScript::ReplaceTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rotface_mutated_infection_SpellScript::ReplaceTargets, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY); AfterHit += SpellHitFn(spell_rotface_mutated_infection_SpellScript::NotifyTargets); } - Unit* _target; + WorldObject* _target; }; SpellScript* GetSpellScript() const diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index fdc9a6a21d6..f6d9de9e967 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -1044,9 +1044,9 @@ class spell_sindragosa_s_fury : public SpellScriptLoader return true; } - void CountTargets(std::list& unitList) + void CountTargets(std::list& targets) { - _targetCount = unitList.size(); + _targetCount = targets.size(); } void HandleDummy(SpellEffIndex effIndex) @@ -1071,7 +1071,7 @@ class spell_sindragosa_s_fury : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_sindragosa_s_fury_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_sindragosa_s_fury_SpellScript::CountTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sindragosa_s_fury_SpellScript::CountTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENTRY); } uint32 _targetCount; @@ -1088,9 +1088,11 @@ class UnchainedMagicTargetSelector public: UnchainedMagicTargetSelector() { } - bool operator()(Unit* unit) + bool operator()(WorldObject* object) const { - return unit->getPowerType() != POWER_MANA; + if (Unit* unit = object->ToUnit()) + return unit->getPowerType() != POWER_MANA; + return true; } }; @@ -1103,7 +1105,7 @@ class spell_sindragosa_unchained_magic : public SpellScriptLoader { PrepareSpellScript(spell_sindragosa_unchained_magic_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { unitList.remove_if(UnchainedMagicTargetSelector()); uint32 maxSize = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 6 : 2); @@ -1113,7 +1115,7 @@ class spell_sindragosa_unchained_magic : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_sindragosa_unchained_magic_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sindragosa_unchained_magic_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; @@ -1296,7 +1298,7 @@ class MysticBuffetTargetFilter public: explicit MysticBuffetTargetFilter(Unit* caster) : _caster(caster) { } - bool operator()(Unit* unit) + bool operator()(WorldObject* unit) const { return !unit->IsWithinLOSInMap(_caster); } @@ -1314,14 +1316,14 @@ class spell_sindragosa_mystic_buffet : public SpellScriptLoader { PrepareSpellScript(spell_sindragosa_mystic_buffet_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove_if(MysticBuffetTargetFilter(GetCaster())); + targets.remove_if(MysticBuffetTargetFilter(GetCaster())); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_sindragosa_mystic_buffet_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sindragosa_mystic_buffet_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; @@ -1399,22 +1401,15 @@ class spell_frostwarden_handler_order_whelp : public SpellScriptLoader return true; } - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - for (std::list::iterator itr = unitList.begin(); itr != unitList.end();) - { - if ((*itr)->GetTypeId() != TYPEID_PLAYER) - unitList.erase(itr++); - else - ++itr; - } - - if (unitList.empty()) + targets.remove_if(Trinity::ObjectTypeIdCheck(TYPEID_PLAYER, false)); + if (targets.empty()) return; - Unit* target = Trinity::Containers::SelectRandomContainerElement(unitList); - unitList.clear(); - unitList.push_back(target); + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(target); } void HandleForcedCast(SpellEffIndex effIndex) @@ -1435,7 +1430,7 @@ class spell_frostwarden_handler_order_whelp : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_frostwarden_handler_order_whelp_SpellScript::HandleForcedCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST); - OnUnitTargetSelect += SpellUnitTargetFn(spell_frostwarden_handler_order_whelp_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_frostwarden_handler_order_whelp_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); } }; 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 d2eaab361a1..a8657925131 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -391,7 +391,7 @@ class HeightDifferenceCheck { } - bool operator()(Unit* unit) const + bool operator()(WorldObject* unit) const { return (unit->GetPositionZ() - _baseObject->GetPositionZ() > _difference) != _reverse; } @@ -2288,7 +2288,7 @@ class spell_the_lich_king_shadow_trap_periodic : public SpellScriptLoader { PrepareSpellScript(spell_the_lich_king_shadow_trap_periodic_SpellScript); - void CheckTargetCount(std::list& targets) + void CheckTargetCount(std::list& targets) { if (targets.empty()) return; @@ -2298,7 +2298,7 @@ class spell_the_lich_king_shadow_trap_periodic : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_shadow_trap_periodic_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_shadow_trap_periodic_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; @@ -2322,10 +2322,10 @@ class spell_the_lich_king_quake : public SpellScriptLoader return GetCaster()->GetInstanceScript() != NULL; } - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { if (GameObject* platform = ObjectAccessor::GetGameObject(*GetCaster(), GetCaster()->GetInstanceScript()->GetData64(DATA_ARTHAS_PLATFORM))) - unitList.remove_if(HeightDifferenceCheck(platform, 5.0f, false)); + targets.remove_if(HeightDifferenceCheck(platform, 5.0f, false)); } void HandleSendEvent(SpellEffIndex /*effIndex*/) @@ -2336,7 +2336,7 @@ class spell_the_lich_king_quake : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_quake_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_quake_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); OnEffectHit += SpellEffectFn(spell_the_lich_king_quake_SpellScript::HandleSendEvent, EFFECT_1, SPELL_EFFECT_SEND_EVENT); } }; @@ -2363,7 +2363,7 @@ class spell_the_lich_king_ice_burst_target_search : public SpellScriptLoader return true; } - void CheckTargetCount(std::list& unitList) + void CheckTargetCount(std::list& unitList) { if (unitList.empty()) return; @@ -2371,12 +2371,16 @@ class spell_the_lich_king_ice_burst_target_search : public SpellScriptLoader // if there is at least one affected target cast the explosion GetCaster()->CastSpell(GetCaster(), SPELL_ICE_BURST, true); if (GetCaster()->GetTypeId() == TYPEID_UNIT) + { + GetCaster()->ToCreature()->SetReactState(REACT_PASSIVE); + GetCaster()->AttackStop(); GetCaster()->ToCreature()->DespawnOrUnsummon(500); + } } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_ice_burst_target_search_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_ice_burst_target_search_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; @@ -2425,7 +2429,7 @@ class ExactDistanceCheck public: ExactDistanceCheck(Unit* source, float dist) : _source(source), _dist(dist) {} - bool operator()(Unit* unit) + bool operator()(WorldObject* unit) { return _source->GetExactDist2d(unit) > _dist; } @@ -2444,7 +2448,7 @@ class spell_the_lich_king_defile : public SpellScriptLoader { PrepareSpellScript(spell_the_lich_king_defile_SpellScript); - void CorrectRange(std::list& targets) + void CorrectRange(std::list& targets) { targets.remove_if(ExactDistanceCheck(GetCaster(), 10.0f * GetCaster()->GetFloatValue(OBJECT_FIELD_SCALE_X))); } @@ -2460,8 +2464,8 @@ class spell_the_lich_king_defile : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_defile_SpellScript::CorrectRange, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_defile_SpellScript::CorrectRange, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_defile_SpellScript::CorrectRange, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_defile_SpellScript::CorrectRange, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); OnHit += SpellHitFn(spell_the_lich_king_defile_SpellScript::ChangeDamageAndGrow); } }; @@ -2563,26 +2567,26 @@ class spell_the_lich_king_valkyr_target_search : public SpellScriptLoader return true; } - void SelectTarget(std::list& unitList) + void SelectTarget(std::list& targets) { - if (unitList.empty()) + if (targets.empty()) return; - unitList.remove_if(Trinity::UnitAuraCheck(true, GetSpellInfo()->Id)); - if (unitList.empty()) + targets.remove_if(Trinity::UnitAuraCheck(true, GetSpellInfo()->Id)); + if (targets.empty()) return; - _target = Trinity::Containers::SelectRandomContainerElement(unitList); - unitList.clear(); - unitList.push_back(_target); + _target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(_target); GetCaster()->GetAI()->SetGUID(_target->GetGUID()); } - void ReplaceTarget(std::list& unitList) + void ReplaceTarget(std::list& targets) { - unitList.clear(); + targets.clear(); if (_target) - unitList.push_back(_target); + targets.push_back(_target); } void HandleScript(SpellEffIndex effIndex) @@ -2593,12 +2597,12 @@ class spell_the_lich_king_valkyr_target_search : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_valkyr_target_search_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_valkyr_target_search_SpellScript::ReplaceTarget, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_valkyr_target_search_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_valkyr_target_search_SpellScript::ReplaceTarget, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_the_lich_king_valkyr_target_search_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } - Unit* _target; + WorldObject* _target; }; SpellScript* GetSpellScript() const @@ -2775,7 +2779,7 @@ class spell_the_lich_king_vile_spirit_move_target_search : public SpellScriptLoa return GetCaster()->GetTypeId() == TYPEID_UNIT; } - void SelectTarget(std::list& targets) + void SelectTarget(std::list& targets) { if (targets.empty()) return; @@ -2796,11 +2800,11 @@ class spell_the_lich_king_vile_spirit_move_target_search : public SpellScriptLoa void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_vile_spirit_move_target_search_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_vile_spirit_move_target_search_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_the_lich_king_vile_spirit_move_target_search_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } - Unit* _target; + WorldObject* _target; }; SpellScript* GetSpellScript() const @@ -2823,7 +2827,7 @@ class spell_the_lich_king_vile_spirit_damage_target_search : public SpellScriptL return GetCaster()->GetTypeId() == TYPEID_UNIT; } - void CheckTargetCount(std::list& targets) + void CheckTargetCount(std::list& targets) { if (targets.empty()) return; @@ -2840,7 +2844,7 @@ class spell_the_lich_king_vile_spirit_damage_target_search : public SpellScriptL void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_the_lich_king_vile_spirit_damage_target_search_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_the_lich_king_vile_spirit_damage_target_search_SpellScript::CheckTargetCount, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } Unit* _target; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index 31ed1eedf10..82946ad1f13 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -1187,13 +1187,13 @@ class spell_dreamwalker_summoner : public SpellScriptLoader return true; } - void FilterTargets(std::list& targets) + void FilterTargets(std::list& targets) { targets.remove_if (Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED)); if (targets.empty()) return; - Unit* target = Trinity::Containers::SelectRandomContainerElement(targets); + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); } @@ -1209,7 +1209,7 @@ class spell_dreamwalker_summoner : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_dreamwalker_summoner_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dreamwalker_summoner_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); OnEffectHitTarget += SpellEffectFn(spell_dreamwalker_summoner_SpellScript::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST); } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 46e8c1428e4..17e33912a86 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1834,15 +1834,15 @@ class DeathPlagueTargetSelector public: explicit DeathPlagueTargetSelector(Unit* caster) : _caster(caster) {} - bool operator()(Unit* unit) + bool operator()(WorldObject* object) const { - if (unit == _caster) + if (object == _caster) return true; - if (unit->GetTypeId() != TYPEID_PLAYER) + if (object->GetTypeId() != TYPEID_PLAYER) return true; - if (unit->HasAura(SPELL_RECENTLY_INFECTED) || unit->HasAura(SPELL_DEATH_PLAGUE_AURA)) + if (object->ToUnit()->HasAura(SPELL_RECENTLY_INFECTED) || object->ToUnit()->HasAura(SPELL_DEATH_PLAGUE_AURA)) return true; return false; @@ -1868,25 +1868,25 @@ class spell_frost_giant_death_plague : public SpellScriptLoader } // First effect - void CountTargets(std::list& unitList) + void CountTargets(std::list& targets) { - unitList.remove(GetCaster()); - _failed = unitList.empty(); + targets.remove(GetCaster()); + _failed = targets.empty(); } // Second effect - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { // Select valid targets for jump - unitList.remove_if (DeathPlagueTargetSelector(GetCaster())); - if (!unitList.empty()) + targets.remove_if(DeathPlagueTargetSelector(GetCaster())); + if (!targets.empty()) { - Unit* target = Trinity::Containers::SelectRandomContainerElement(unitList); - unitList.clear(); - unitList.push_back(target); + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(target); } - unitList.push_back(GetCaster()); + targets.push_back(GetCaster()); } void HandleScript(SpellEffIndex effIndex) @@ -1900,8 +1900,8 @@ class spell_frost_giant_death_plague : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_frost_giant_death_plague_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_frost_giant_death_plague_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_frost_giant_death_plague_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_frost_giant_death_plague_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ALLY); OnEffectHitTarget += SpellEffectFn(spell_frost_giant_death_plague_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); } @@ -1950,9 +1950,11 @@ class spell_icc_harvest_blight_specimen : public SpellScriptLoader class AliveCheck { public: - bool operator()(Unit* unit) + bool operator()(WorldObject* object) const { - return unit->isAlive(); + if (Unit* unit = object->ToUnit()) + return unit->isAlive(); + return true; } }; @@ -1965,10 +1967,10 @@ class spell_svalna_revive_champion : public SpellScriptLoader { PrepareSpellScript(spell_svalna_revive_champion_SpellScript); - void RemoveAliveTarget(std::list& unitList) + void RemoveAliveTarget(std::list& targets) { - unitList.remove_if(AliveCheck()); - Trinity::Containers::RandomResizeList(unitList, 2); + targets.remove_if(AliveCheck()); + Trinity::Containers::RandomResizeList(targets, 2); } void Land(SpellEffIndex /*effIndex*/) @@ -1988,7 +1990,7 @@ class spell_svalna_revive_champion : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_svalna_revive_champion_SpellScript::RemoveAliveTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_svalna_revive_champion_SpellScript::RemoveAliveTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENTRY); OnEffectHit += SpellEffectFn(spell_svalna_revive_champion_SpellScript::Land, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index 7f4915cb3f1..faaea9c4cae 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -602,14 +602,14 @@ class spell_gothik_shadow_bolt_volley : public SpellScriptLoader { PrepareSpellScript(spell_gothik_shadow_bolt_volley_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove_if(Trinity::UnitAuraCheck(false, SPELL_SHADOW_MARK)); + targets.remove_if(Trinity::UnitAuraCheck(false, SPELL_SHADOW_MARK)); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_gothik_shadow_bolt_volley_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gothik_shadow_bolt_volley_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index ccc8e9a5663..e45700ebd72 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -456,10 +456,10 @@ class spell_thaddius_pos_neg_charge : public SpellScriptLoader return GetCaster()->GetTypeId() == TYPEID_UNIT; } - void HandleTargets(std::list& targetList) + void HandleTargets(std::list& targets) { uint8 count = 0; - for (std::list::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit) + for (std::list::iterator ihit = targets.begin(); ihit != targets.end(); ++ihit) if ((*ihit)->GetGUID() != GetCaster()->GetGUID()) if (Player* target = (*ihit)->ToPlayer()) if (target->HasAura(GetTriggeringSpell()->Id)) @@ -498,7 +498,7 @@ class spell_thaddius_pos_neg_charge : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_thaddius_pos_neg_charge_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); - OnUnitTargetSelect += SpellUnitTargetFn(spell_thaddius_pos_neg_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_thaddius_pos_neg_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); } }; diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index 19a84fdae84..d200e8bf4bf 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -297,7 +297,7 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader { PrepareSpellScript(spell_varos_energize_core_area_enemySpellScript) - void FilterTargets(std::list& targetList) + void FilterTargets(std::list& targets) { Creature* varos = GetCaster()->ToCreature(); if (!varos) @@ -308,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 = targets.begin(); itr != targets.end();) { Position pos; (*itr)->GetPosition(&pos); @@ -317,7 +317,7 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader float diff = fabs(orientation - angle); if (diff > 1.0f) - itr = targetList.erase(itr); + itr = targets.erase(itr); else ++itr; } @@ -325,7 +325,7 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_varos_energize_core_area_enemySpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_varos_energize_core_area_enemySpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; @@ -344,7 +344,7 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader { PrepareSpellScript(spell_varos_energize_core_area_entrySpellScript) - void FilterTargets(std::list& targetList) + void FilterTargets(std::list& targets) { Creature* varos = GetCaster()->ToCreature(); if (!varos) @@ -355,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 = targets.begin(); itr != targets.end();) { Position pos; (*itr)->GetPosition(&pos); @@ -364,7 +364,7 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader float diff = fabs(orientation - angle); if (diff > 1.0f) - itr = targetList.erase(itr); + itr = targets.erase(itr); else ++itr; } @@ -372,7 +372,7 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_varos_energize_core_area_entrySpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_varos_energize_core_area_entrySpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); } }; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp index e5e3daede91..93bea92503c 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp @@ -159,7 +159,7 @@ public: DoScriptText(SAY_KILL, me); } - void SpellHitTarget(Unit* target, const SpellInfo* pSpell) + void SpellHitTarget(Unit* /*target*/, const SpellInfo* pSpell) { //this part should be in the core if (pSpell->Id == SPELL_SHATTER || pSpell->Id == H_SPELL_SHATTER) 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 2af73389ecb..7ee67060f97 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 @@ -1080,7 +1080,7 @@ class NotVictimFilter { } - bool operator()(Unit* target) + bool operator()(WorldObject* target) { return target != _victim; } @@ -1098,14 +1098,14 @@ class spell_algalon_arcane_barrage : public SpellScriptLoader { PrepareSpellScript(spell_algalon_arcane_barrage_SpellScript); - void SelectTarget(std::list& targets) + 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); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_algalon_arcane_barrage_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; @@ -1118,9 +1118,9 @@ class spell_algalon_arcane_barrage : public SpellScriptLoader class ActiveConstellationFilter { public: - bool operator()(Unit* target) const + bool operator()(WorldObject* target) const { - return target->GetAI()->GetData(0); + return target->ToUnit() && target->ToUnit()->GetAI() && target->ToUnit()->GetAI()->GetData(0); } }; @@ -1133,7 +1133,7 @@ class spell_algalon_trigger_3_adds : public SpellScriptLoader { PrepareSpellScript(spell_algalon_trigger_3_adds_SpellScript); - void SelectTarget(std::list& targets) + void SelectTarget(std::list& targets) { targets.remove_if(ActiveConstellationFilter()); } @@ -1150,7 +1150,7 @@ class spell_algalon_trigger_3_adds : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_algalon_trigger_3_adds_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_algalon_trigger_3_adds_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); } }; @@ -1202,7 +1202,7 @@ class spell_algalon_big_bang : public SpellScriptLoader return true; } - void CountTargets(std::list& targets) + void CountTargets(std::list& targets) { _targetCount = targets.size(); } @@ -1215,7 +1215,7 @@ class spell_algalon_big_bang : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_algalon_big_bang_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_algalon_big_bang_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); AfterCast += SpellCastFn(spell_algalon_big_bang_SpellScript::CheckTargets); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index 472ff153d73..ec3125f7c0a 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -472,9 +472,9 @@ class npc_feral_defender : public CreatureScript class SanctumSentryCheck { public: - bool operator() (Unit* unit) + bool operator()(WorldObject* object) const { - if (unit->GetEntry() == NPC_SANCTUM_SENTRY) + if (object->GetEntry() == NPC_SANCTUM_SENTRY) return false; return true; @@ -490,14 +490,14 @@ class spell_auriaya_strenght_of_the_pack : public SpellScriptLoader { PrepareSpellScript(spell_auriaya_strenght_of_the_pack_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { - unitList.remove_if (SanctumSentryCheck()); + unitList.remove_if(SanctumSentryCheck()); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_auriaya_strenght_of_the_pack_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_auriaya_strenght_of_the_pack_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); } }; @@ -516,15 +516,15 @@ class spell_auriaya_sentinel_blast : public SpellScriptLoader { PrepareSpellScript(spell_auriaya_sentinel_blast_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { - unitList.remove_if (PlayerOrPetCheck()); + unitList.remove_if(PlayerOrPetCheck()); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_auriaya_sentinel_blast_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_auriaya_sentinel_blast_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_auriaya_sentinel_blast_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_auriaya_sentinel_blast_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); } }; 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 8ff6c2e1a3a..ce0a61d1099 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1617,7 +1617,7 @@ class FlameLeviathanPursuedTargetSelector public: explicit FlameLeviathanPursuedTargetSelector(Unit* unit) : _me(unit) {}; - bool operator()(Unit* target) const + bool operator()(WorldObject* target) const { //! No players, only vehicles (todo: check if blizzlike) Creature* creatureTarget = target->ToCreature(); @@ -1665,7 +1665,7 @@ class spell_pursue : public SpellScriptLoader return true; } - void FilterTargets(std::list& targets) + void FilterTargets(std::list& targets) { targets.remove_if(FlameLeviathanPursuedTargetSelector(GetCaster())); if (targets.empty()) @@ -1681,7 +1681,7 @@ class spell_pursue : public SpellScriptLoader } } - void FilterTargetsSubsequently(std::list& targets) + void FilterTargetsSubsequently(std::list& targets) { targets.clear(); if (_target) @@ -1708,12 +1708,12 @@ class spell_pursue : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_pursue_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_pursue_SpellScript::FilterTargetsSubsequently, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pursue_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pursue_SpellScript::FilterTargetsSubsequently, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_pursue_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA); } - Unit* _target; + WorldObject* _target; }; SpellScript* GetSpellScript() const diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index d89d640b083..24a9171e29f 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -354,7 +354,7 @@ class StoneGripTargetSelector : public std::unary_function public: StoneGripTargetSelector(Creature* me, Unit const* victim) : _me(me), _victim(victim) {} - bool operator() (Unit* target) + bool operator()(WorldObject* target) { if (target == _victim && _me->getThreatManager().getThreatList().size() > 1) return true; @@ -385,10 +385,10 @@ class spell_ulduar_stone_grip_cast_target : public SpellScriptLoader return true; } - void FilterTargetsInitial(std::list& unitList) + void FilterTargetsInitial(std::list& unitList) { // Remove "main tank" and non-player targets - unitList.remove_if (StoneGripTargetSelector(GetCaster()->ToCreature(), GetCaster()->getVictim())); + unitList.remove_if(StoneGripTargetSelector(GetCaster()->ToCreature(), GetCaster()->getVictim())); // Maximum affected targets per difficulty mode uint32 maxTargets = 1; if (GetSpellInfo()->Id == 63981) @@ -397,7 +397,7 @@ class spell_ulduar_stone_grip_cast_target : public SpellScriptLoader // Return a random amount of targets based on maxTargets while (maxTargets < unitList.size()) { - std::list::iterator itr = unitList.begin(); + std::list::iterator itr = unitList.begin(); advance(itr, urand(0, unitList.size()-1)); unitList.erase(itr); } @@ -406,20 +406,20 @@ class spell_ulduar_stone_grip_cast_target : public SpellScriptLoader m_unitList = unitList; } - void FillTargetsSubsequential(std::list& unitList) + void FillTargetsSubsequential(std::list& unitList) { unitList = m_unitList; } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_ulduar_stone_grip_cast_target_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_ulduar_stone_grip_cast_target_SpellScript::FillTargetsSubsequential, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_ulduar_stone_grip_cast_target_SpellScript::FillTargetsSubsequential, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ulduar_stone_grip_cast_target_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ulduar_stone_grip_cast_target_SpellScript::FillTargetsSubsequential, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ulduar_stone_grip_cast_target_SpellScript::FillTargetsSubsequential, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY); } // Shared between effects - std::list m_unitList; + std::list m_unitList; }; SpellScript* GetSpellScript() const @@ -598,14 +598,14 @@ class spell_kologarn_stone_shout : public SpellScriptLoader { PrepareSpellScript(spell_kologarn_stone_shout_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { - unitList.remove_if (PlayerOrPetCheck()); + unitList.remove_if(PlayerOrPetCheck()); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_kologarn_stone_shout_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kologarn_stone_shout_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index a2044854672..7ada42144a8 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -950,9 +950,9 @@ class spell_xt002_tympanic_tantrum : public SpellScriptLoader { PrepareSpellScript(spell_xt002_tympanic_tantrum_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove_if(PlayerOrPetCheck()); + targets.remove_if(PlayerOrPetCheck()); } void RecalculateDamage() @@ -962,8 +962,8 @@ class spell_xt002_tympanic_tantrum : public SpellScriptLoader 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); + 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); } }; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h index d35f0559080..858a82bbe57 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h @@ -268,10 +268,10 @@ GameObjectAI* GetUlduarAI(GameObject* go) class PlayerOrPetCheck { public: - bool operator() (Unit* unit) + bool operator()(WorldObject* object) const { - if (unit->GetTypeId() != TYPEID_PLAYER) - if (!unit->ToCreature()->isPet()) + if (object->GetTypeId() != TYPEID_PLAYER) + if (!object->ToCreature()->isPet()) return 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 44cd1184098..7969accc28c 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -522,12 +522,12 @@ public: }; }; -class checkRitualTarget +class RitualTargetCheck { public: - explicit checkRitualTarget(Unit* _caster) : caster(_caster) { } + explicit RitualTargetCheck(Unit* _caster) : caster(_caster) { } - bool operator() (Unit* unit) + bool operator() (WorldObject* unit) const { if (InstanceScript* instance = caster->GetInstanceScript()) if (instance->GetData64(DATA_SACRIFICED_PLAYER) == unit->GetGUID()) @@ -549,14 +549,14 @@ class spell_paralyze_pinnacle : public SpellScriptLoader { PrepareSpellScript(spell_paralyze_pinnacle_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { - unitList.remove_if(checkRitualTarget(GetCaster())); + unitList.remove_if(RitualTargetCheck(GetCaster())); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_paralyze_pinnacle_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_paralyze_pinnacle_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index d202fdd2f44..0454274401c 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -518,7 +518,7 @@ class spell_astromancer_wrath_of_the_astromancer : public SpellScriptLoader return true; } - void CountTargets(std::list& targetList) + void CountTargets(std::list& targetList) { _targetCount = targetList.size(); } @@ -549,7 +549,7 @@ class spell_astromancer_wrath_of_the_astromancer : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_astromancer_wrath_of_the_astromancer_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_astromancer_wrath_of_the_astromancer_SpellScript::CountTargets, EFFECT_0, TARGET_DEST_CASTER_RADIUS); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_astromancer_wrath_of_the_astromancer_SpellScript::CountTargets, EFFECT_0, TARGET_DEST_CASTER_RADIUS); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp index 3579a7d697b..1cd67065af1 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp @@ -52,10 +52,10 @@ class spell_capacitus_polarity_charge : public SpellScriptLoader return true; } - void HandleTargets(std::list& targetList) + void HandleTargets(std::list& targetList) { uint8 count = 0; - for (std::list::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit) + for (std::list::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit) if ((*ihit)->GetGUID() != GetCaster()->GetGUID()) if (Player* target = (*ihit)->ToPlayer()) if (target->HasAura(GetTriggeringSpell()->Id)) @@ -88,7 +88,7 @@ class spell_capacitus_polarity_charge : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_charge_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); - OnUnitTargetSelect += SpellUnitTargetFn(spell_capacitus_polarity_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_capacitus_polarity_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); } }; diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp index ab568249027..96897ae3033 100644 --- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp +++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp @@ -191,7 +191,7 @@ class spell_mark_of_kazzak : public SpellScriptLoader return true; } - void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* owner = GetUnitOwner()) amount = CalculatePctU(owner->GetPower(POWER_MANA), 5); diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index ae887baa413..6a58f3d03c5 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -349,16 +349,15 @@ class spell_dk_death_pact : public SpellScriptLoader return SPELL_FAILED_NO_PET; } - void FilterTargets(std::list& unitList) + 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()->GetCreatureTemplate()->type == CREATURE_TYPE_UNDEAD) + if (Unit* unit = (*itr)->ToUnit()) + if (unit->GetOwnerGUID() == GetCaster()->GetGUID() && unit->GetCreatureType() == CREATURE_TYPE_UNDEAD) { - unit_to_add = (*itr); + unit_to_add = unit; break; } } @@ -371,7 +370,7 @@ class spell_dk_death_pact : public SpellScriptLoader void Register() { OnCheckCast += SpellCheckCastFn(spell_dk_death_pact_SpellScript::CheckCast); - OnUnitTargetSelect += SpellUnitTargetFn(spell_dk_death_pact_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dk_death_pact_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ALLY); } }; diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 4c8a9db1571..f1f624fa8e9 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -232,37 +232,37 @@ class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { if (!GetCaster()->ToPlayer()->GetGroup()) { - unitList.clear(); - unitList.push_back(GetCaster()); + targets.clear(); + targets.push_back(GetCaster()); } else { - unitList.remove(GetExplTargetUnit()); + targets.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)) - tempTargets.push_back(*itr); + for (std::list::const_iterator itr = targets.begin(); itr != targets.end(); ++itr) + if ((*itr)->GetTypeId() == TYPEID_PLAYER && GetCaster()->IsInRaidWith((*itr)->ToUnit())) + tempTargets.push_back((*itr)->ToUnit()); if (tempTargets.empty()) { - unitList.clear(); + targets.clear(); FinishCast(SPELL_FAILED_DONT_REPORT); return; } Unit* target = Trinity::Containers::SelectRandomContainerElement(tempTargets); - unitList.clear(); - unitList.push_back(target); + targets.clear(); + targets.push_back(target); } } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_dru_t10_restoration_4p_bonus_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dru_t10_restoration_4p_bonus_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY); } }; @@ -281,14 +281,14 @@ class spell_dru_starfall_aoe : public SpellScriptLoader { PrepareSpellScript(spell_dru_starfall_aoe_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove(GetExplTargetUnit()); + targets.remove(GetExplTargetUnit()); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_dru_starfall_aoe_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dru_starfall_aoe_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); } }; @@ -341,9 +341,9 @@ class spell_dru_starfall_dummy : public SpellScriptLoader { PrepareSpellScript(spell_dru_starfall_dummy_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - Trinity::Containers::RandomResizeList(unitList, 2); + Trinity::Containers::RandomResizeList(targets, 2); } void HandleDummy(SpellEffIndex /*effIndex*/) @@ -366,7 +366,7 @@ class spell_dru_starfall_dummy : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_dru_starfall_dummy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dru_starfall_dummy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_dru_starfall_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 329e0d2e170..7d248b35853 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -409,7 +409,7 @@ class spell_pal_divine_storm_dummy : public SpellScriptLoader return true; } - void CountTargets(std::list& targetList) + void CountTargets(std::list& targetList) { _targetCount = targetList.size(); } @@ -428,7 +428,7 @@ class spell_pal_divine_storm_dummy : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_pal_divine_storm_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - OnUnitTargetSelect += SpellUnitTargetFn(spell_pal_divine_storm_dummy_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pal_divine_storm_dummy_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); } }; diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 6910bf47805..aab1e974e53 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -132,14 +132,14 @@ class spell_pri_mind_sear : public SpellScriptLoader { PrepareSpellScript(spell_pri_mind_sear_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { - unitList.remove_if (Trinity::ObjectGUIDCheck(GetCaster()->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT))); + unitList.remove_if(Trinity::ObjectGUIDCheck(GetCaster()->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT))); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_pri_mind_sear_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_mind_sear_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); } }; diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index fce3d0415a6..c863c2363af 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -262,9 +262,12 @@ class EarthenPowerTargetSelector public: EarthenPowerTargetSelector() { } - bool operator() (Unit* target) + bool operator() (WorldObject* target) { - if (!target->HasAuraWithMechanic(1 << MECHANIC_SNARE)) + if (!target->ToUnit()) + return true; + + if (!target->ToUnit()->HasAuraWithMechanic(1 << MECHANIC_SNARE)) return true; return false; @@ -280,14 +283,14 @@ class spell_sha_earthen_power : public SpellScriptLoader { PrepareSpellScript(spell_sha_earthen_power_SpellScript); - void FilterTargets(std::list& unitList) + 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); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_earthen_power_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); } }; @@ -313,7 +316,7 @@ class spell_sha_bloodlust : public SpellScriptLoader return true; } - void RemoveInvalidTargets(std::list& targets) + void RemoveInvalidTargets(std::list& targets) { targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_SATED)); } @@ -326,9 +329,9 @@ class spell_sha_bloodlust : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); - OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID); - OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID); AfterHit += SpellHitFn(spell_sha_bloodlust_SpellScript::ApplyDebuff); } }; @@ -355,9 +358,9 @@ class spell_sha_heroism : public SpellScriptLoader return true; } - void RemoveInvalidTargets(std::list& targets) + void RemoveInvalidTargets(std::list& targets) { - targets.remove_if (Trinity::UnitAuraCheck(true, SHAMAN_SPELL_EXHAUSTION)); + targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_EXHAUSTION)); } void ApplyDebuff() @@ -368,9 +371,9 @@ class spell_sha_heroism : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); - OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID); - OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID); AfterHit += SpellHitFn(spell_sha_heroism_SpellScript::ApplyDebuff); } }; diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index e20eb07d45a..74118599b9f 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -302,15 +302,15 @@ class spell_warl_seed_of_corruption : public SpellScriptLoader { PrepareSpellScript(spell_warl_seed_of_corruption_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { if (GetExplTargetUnit()) - unitList.remove(GetExplTargetUnit()); + targets.remove(GetExplTargetUnit()); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_warl_seed_of_corruption_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warl_seed_of_corruption_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); } }; diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 463b9b2fb97..c64101e11ea 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -77,7 +77,7 @@ class spell_warr_improved_spell_reflection : public SpellScriptLoader { PrepareSpellScript(spell_warr_improved_spell_reflection_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { if (GetCaster()) unitList.remove(GetCaster()); @@ -85,7 +85,7 @@ class spell_warr_improved_spell_reflection : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_warr_improved_spell_reflection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warr_improved_spell_reflection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY); } }; diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index 045dea9c9a9..abb20130ef8 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -224,9 +224,9 @@ class DreamFogTargetSelector public: DreamFogTargetSelector() { } - bool operator()(Unit* unit) + bool operator()(WorldObject* object) const { - return unit->HasAura(SPELL_SLEEP); + return object->ToUnit() && object->ToUnit()->HasAura(SPELL_SLEEP); } }; @@ -239,14 +239,14 @@ class spell_dream_fog_sleep : public SpellScriptLoader { PrepareSpellScript(spell_dream_fog_sleep_SpellScript); - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& unitList) { - unitList.remove_if (DreamFogTargetSelector()); + unitList.remove_if(DreamFogTargetSelector()); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_dream_fog_sleep_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dream_fog_sleep_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); } }; @@ -265,10 +265,12 @@ class MarkOfNatureTargetSelector public: MarkOfNatureTargetSelector() { } - bool operator()(Unit* unit) + bool operator()(WorldObject* object) const { - // return anyone that isn't tagged or already under the influence of Aura of Nature - return !(unit->HasAura(SPELL_MARK_OF_NATURE) && !unit->HasAura(SPELL_AURA_OF_NATURE)); + if (Unit* unit = object->ToUnit()) + // return anyone that isn't tagged or already under the influence of Aura of Nature + return !(unit->HasAura(SPELL_MARK_OF_NATURE) && !unit->HasAura(SPELL_AURA_OF_NATURE)); + return true; } }; @@ -290,9 +292,9 @@ class spell_mark_of_nature : public SpellScriptLoader return true; } - void FilterTargets(std::list& unitList) + void FilterTargets(std::list& targets) { - unitList.remove_if (MarkOfNatureTargetSelector()); + targets.remove_if(MarkOfNatureTargetSelector()); } void HandleEffect(SpellEffIndex effIndex) @@ -305,7 +307,7 @@ class spell_mark_of_nature : public SpellScriptLoader void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_mark_of_nature_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mark_of_nature_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_mark_of_nature_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_APPLY_AURA); } }; diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index fb2fdf09583..4fac31a9ac6 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -185,8 +185,7 @@ class ByteBuffer ByteBuffer &operator<<(const char *str) { - size_t len = 0; - if (str && (len = strlen(str))) + if (size_t len = (str ? strlen(str) : 0)) append((uint8 const*)str, len); append((uint8)0); return *this; -- cgit v1.2.3 From 16d4cc7e0b6431efccf0bdc7973e7d3e3c8e705f Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 1 Jul 2012 16:18:11 -0500 Subject: Fixed build --- src/server/scripts/Commands/cs_reset.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index deb8f710b11..88d648773eb 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -24,6 +24,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "Chat.h" +#include "ObjectAccessor.h" class reset_commandscript : public CommandScript { -- cgit v1.2.3