diff options
Diffstat (limited to 'src')
1175 files changed, 10853 insertions, 7966 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7c2ebe9906c..11cd235f366 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # 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/genrev/CMakeLists.txt b/src/genrev/CMakeLists.txt index 022ff5b2f6f..c01c57b636f 100644 --- a/src/genrev/CMakeLists.txt +++ b/src/genrev/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # 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/CMakeLists.txt b/src/server/CMakeLists.txt index 2b6c553e10b..7d85cdb6e21 100644 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # 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/authserver/Authentication/AuthCodes.cpp b/src/server/authserver/Authentication/AuthCodes.cpp index bdb96ca0d25..55229e0d18b 100644 --- a/src/server/authserver/Authentication/AuthCodes.cpp +++ b/src/server/authserver/Authentication/AuthCodes.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/authserver/Authentication/AuthCodes.h b/src/server/authserver/Authentication/AuthCodes.h index 148225377ff..492ac53f8cd 100644 --- a/src/server/authserver/Authentication/AuthCodes.h +++ b/src/server/authserver/Authentication/AuthCodes.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/authserver/CMakeLists.txt b/src/server/authserver/CMakeLists.txt index 581b48f571c..328369cb908 100644 --- a/src/server/authserver/CMakeLists.txt +++ b/src/server/authserver/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # 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/authserver/Main.cpp b/src/server/authserver/Main.cpp index 90d112a1433..f4f73e2c33d 100644 --- a/src/server/authserver/Main.cpp +++ b/src/server/authserver/Main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp index 79df2b15605..72873e40ce5 100644 --- a/src/server/authserver/Realms/RealmList.cpp +++ b/src/server/authserver/Realms/RealmList.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/authserver/Realms/RealmList.h b/src/server/authserver/Realms/RealmList.h index 52482897ea4..1949c34df9a 100644 --- a/src/server/authserver/Realms/RealmList.h +++ b/src/server/authserver/Realms/RealmList.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index ed3b3cf4145..9145c8413ff 100644 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/authserver/Server/AuthSocket.h b/src/server/authserver/Server/AuthSocket.h index 9be2136b55c..87fd092381e 100644 --- a/src/server/authserver/Server/AuthSocket.h +++ b/src/server/authserver/Server/AuthSocket.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/authserver/Server/RealmAcceptor.h b/src/server/authserver/Server/RealmAcceptor.h index b764e4d2494..6009adff6fb 100644 --- a/src/server/authserver/Server/RealmAcceptor.h +++ b/src/server/authserver/Server/RealmAcceptor.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/authserver/Server/RealmSocket.cpp b/src/server/authserver/Server/RealmSocket.cpp index d65431eca44..e67af783d5f 100644 --- a/src/server/authserver/Server/RealmSocket.cpp +++ b/src/server/authserver/Server/RealmSocket.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/authserver/Server/RealmSocket.h b/src/server/authserver/Server/RealmSocket.h index b093691047c..24f2a5dc109 100644 --- a/src/server/authserver/Server/RealmSocket.h +++ b/src/server/authserver/Server/RealmSocket.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/authserver/authserver.rc b/src/server/authserver/authserver.rc index 97de89432bf..acfed6323ae 100644 --- a/src/server/authserver/authserver.rc +++ b/src/server/authserver/authserver.rc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/BoundingIntervalHierarchy.cpp b/src/server/collision/BoundingIntervalHierarchy.cpp index 8e90cac92f5..ad3753ea3c9 100644 --- a/src/server/collision/BoundingIntervalHierarchy.cpp +++ b/src/server/collision/BoundingIntervalHierarchy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -241,7 +241,7 @@ void BIH::subdivide(int left, int right, std::vector<uint32> &tempTree, buildDat bool BIH::writeToFile(FILE* wf) const { uint32 treeSize = tree.size(); - uint32 check=0, count=0; + uint32 check=0, count; check += fwrite(&bounds.low(), sizeof(float), 3, wf); check += fwrite(&bounds.high(), sizeof(float), 3, wf); check += fwrite(&treeSize, sizeof(uint32), 1, wf); diff --git a/src/server/collision/BoundingIntervalHierarchy.h b/src/server/collision/BoundingIntervalHierarchy.h index a4bbe21006a..7cbaedbfba6 100644 --- a/src/server/collision/BoundingIntervalHierarchy.h +++ b/src/server/collision/BoundingIntervalHierarchy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -87,7 +87,7 @@ class BIH tree.clear(); objects.clear(); // create space for the first node - tree.push_back(3 << 30); // dummy leaf + tree.push_back(3u << 30u); // dummy leaf tree.insert(tree.end(), 2, 0); } public: diff --git a/src/server/collision/BoundingIntervalHierarchyWrapper.h b/src/server/collision/BoundingIntervalHierarchyWrapper.h index e2252ca60c8..8a99078caab 100644 --- a/src/server/collision/BoundingIntervalHierarchyWrapper.h +++ b/src/server/collision/BoundingIntervalHierarchyWrapper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/CMakeLists.txt b/src/server/collision/CMakeLists.txt index 3182b20d008..62af7dd081e 100644 --- a/src/server/collision/CMakeLists.txt +++ b/src/server/collision/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # 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/collision/DynamicTree.cpp b/src/server/collision/DynamicTree.cpp index ebb46614a20..1a2f721a69f 100644 --- a/src/server/collision/DynamicTree.cpp +++ b/src/server/collision/DynamicTree.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/DynamicTree.h b/src/server/collision/DynamicTree.h index 079c0adbf5e..ca199a9cd70 100644 --- a/src/server/collision/DynamicTree.h +++ b/src/server/collision/DynamicTree.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/Management/IVMapManager.h b/src/server/collision/Management/IVMapManager.h index 7cf296625f4..9289d820e5b 100644 --- a/src/server/collision/Management/IVMapManager.h +++ b/src/server/collision/Management/IVMapManager.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/Management/VMapFactory.cpp b/src/server/collision/Management/VMapFactory.cpp index 657f989a0c0..4d3719cf288 100644 --- a/src/server/collision/Management/VMapFactory.cpp +++ b/src/server/collision/Management/VMapFactory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -16,99 +16,12 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include <sys/types.h> #include "VMapFactory.h" #include "VMapManager2.h" -#include "G3D/Table.h" - -using namespace G3D; namespace VMAP { - void chompAndTrim(std::string& str) - { - while (str.length() >0) - { - char lc = str[str.length()-1]; - if (lc == '\r' || lc == '\n' || lc == ' ' || lc == '"' || lc == '\'') - { - str = str.substr(0, str.length()-1); - } - else - { - break; - } - } - while (str.length() >0) - { - char lc = str[0]; - if (lc == ' ' || lc == '"' || lc == '\'') - { - str = str.substr(1, str.length()-1); - } - else - { - break; - } - } - } - - IVMapManager* gVMapManager = 0; - Table<unsigned int, bool>* iIgnoreSpellIds=0; - - //=============================================== - // result false, if no more id are found - - bool getNextId(const std::string& pString, unsigned int& pStartPos, unsigned int& pId) - { - bool result = false; - unsigned int i; - for (i=pStartPos;i<pString.size(); ++i) - { - if (pString[i] == ',') - { - break; - } - } - if (i>pStartPos) - { - std::string idString = pString.substr(pStartPos, i-pStartPos); - pStartPos = i+1; - chompAndTrim(idString); - pId = atoi(idString.c_str()); - result = true; - } - return(result); - } - - //=============================================== - /** - parameter: String of map ids. Delimiter = "," - */ - - void VMapFactory::preventSpellsFromBeingTestedForLoS(const char* pSpellIdString) - { - if (!iIgnoreSpellIds) - iIgnoreSpellIds = new Table<unsigned int, bool>(); - if (pSpellIdString != NULL) - { - unsigned int pos =0; - unsigned int id; - std::string confString(pSpellIdString); - chompAndTrim(confString); - while (getNextId(confString, pos, id)) - { - iIgnoreSpellIds->set(id, true); - } - } - } - - //=============================================== - - bool VMapFactory::checkSpellForLoS(unsigned int pSpellId) - { - return(!iIgnoreSpellIds->containsKey(pSpellId)); - } + IVMapManager* gVMapManager = NULL; //=============================================== // just return the instance @@ -123,9 +36,6 @@ namespace VMAP // delete all internal data structures void VMapFactory::clear() { - delete iIgnoreSpellIds; - iIgnoreSpellIds = NULL; - delete gVMapManager; gVMapManager = NULL; } diff --git a/src/server/collision/Management/VMapFactory.h b/src/server/collision/Management/VMapFactory.h index 27bce523c43..1545a8f6977 100644 --- a/src/server/collision/Management/VMapFactory.h +++ b/src/server/collision/Management/VMapFactory.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -34,9 +34,6 @@ namespace VMAP public: static IVMapManager* createOrGetVMapManager(); static void clear(); - - static void preventSpellsFromBeingTestedForLoS(const char* pSpellIdString); - static bool checkSpellForLoS(unsigned int pSpellId); }; } diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp index 81328d31d7b..5e3741ca753 100644 --- a/src/server/collision/Management/VMapManager2.cpp +++ b/src/server/collision/Management/VMapManager2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/Management/VMapManager2.h b/src/server/collision/Management/VMapManager2.h index 1fba108388a..e2e9965dbfc 100644 --- a/src/server/collision/Management/VMapManager2.h +++ b/src/server/collision/Management/VMapManager2.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/Maps/MapTree.cpp b/src/server/collision/Maps/MapTree.cpp index 89412a69c33..5f4e2b6aa8b 100644 --- a/src/server/collision/Maps/MapTree.cpp +++ b/src/server/collision/Maps/MapTree.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/Maps/MapTree.h b/src/server/collision/Maps/MapTree.h index 1732209c6bc..bd928d85c5a 100644 --- a/src/server/collision/Maps/MapTree.h +++ b/src/server/collision/Maps/MapTree.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp index 434522d3515..380d6b5df21 100644 --- a/src/server/collision/Maps/TileAssembler.cpp +++ b/src/server/collision/Maps/TileAssembler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/Maps/TileAssembler.h b/src/server/collision/Maps/TileAssembler.h index 554940a4663..087c2021b50 100644 --- a/src/server/collision/Maps/TileAssembler.h +++ b/src/server/collision/Maps/TileAssembler.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp index ae8465843b5..237a5b33621 100644 --- a/src/server/collision/Models/GameObjectModel.cpp +++ b/src/server/collision/Models/GameObjectModel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/Models/GameObjectModel.h b/src/server/collision/Models/GameObjectModel.h index 78a0e876676..44abed55267 100644 --- a/src/server/collision/Models/GameObjectModel.h +++ b/src/server/collision/Models/GameObjectModel.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/Models/ModelInstance.cpp b/src/server/collision/Models/ModelInstance.cpp index dd6b16be777..55759ea20c4 100644 --- a/src/server/collision/Models/ModelInstance.cpp +++ b/src/server/collision/Models/ModelInstance.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/Models/ModelInstance.h b/src/server/collision/Models/ModelInstance.h index b0189ad8542..5af02a1d1b1 100644 --- a/src/server/collision/Models/ModelInstance.h +++ b/src/server/collision/Models/ModelInstance.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/Models/WorldModel.cpp b/src/server/collision/Models/WorldModel.cpp index b4f3f73fc98..ca0f95c74e3 100644 --- a/src/server/collision/Models/WorldModel.cpp +++ b/src/server/collision/Models/WorldModel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/Models/WorldModel.h b/src/server/collision/Models/WorldModel.h index ebf828e4935..8e046e561f7 100644 --- a/src/server/collision/Models/WorldModel.h +++ b/src/server/collision/Models/WorldModel.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/PrecompiledHeaders/collisionPCH.h b/src/server/collision/PrecompiledHeaders/collisionPCH.h index 636eaa1bef8..ece2ef1b8ef 100644 --- a/src/server/collision/PrecompiledHeaders/collisionPCH.h +++ b/src/server/collision/PrecompiledHeaders/collisionPCH.h @@ -4,3 +4,6 @@ #include "WorldModel.h" #include "ModelInstance.h" #include "BoundingIntervalHierarchy.h" +#include "RegularGrid.h" +#include "BoundingIntervalHierarchyWrapper.h" +#include "GameObjectModel.h" diff --git a/src/server/collision/VMapDefinitions.h b/src/server/collision/VMapDefinitions.h index cc796d96dd5..609d00cd00f 100644 --- a/src/server/collision/VMapDefinitions.h +++ b/src/server/collision/VMapDefinitions.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/collision/VMapTools.h b/src/server/collision/VMapTools.h index 72d9e8988c1..5aefda6deb4 100644 --- a/src/server/collision/VMapTools.h +++ b/src/server/collision/VMapTools.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp index d9d19c2f009..95a5a9a5116 100644 --- a/src/server/game/AI/CoreAI/CombatAI.cpp +++ b/src/server/game/AI/CoreAI/CombatAI.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/CoreAI/CombatAI.h b/src/server/game/AI/CoreAI/CombatAI.h index fa31e57d780..8b10a8d6190 100644 --- a/src/server/game/AI/CoreAI/CombatAI.h +++ b/src/server/game/AI/CoreAI/CombatAI.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/CoreAI/GameObjectAI.cpp b/src/server/game/AI/CoreAI/GameObjectAI.cpp index 1a08ac1afbe..06e3a4b9ec4 100644 --- a/src/server/game/AI/CoreAI/GameObjectAI.cpp +++ b/src/server/game/AI/CoreAI/GameObjectAI.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h index 4561aa92741..feb3bbefcb8 100644 --- a/src/server/game/AI/CoreAI/GameObjectAI.h +++ b/src/server/game/AI/CoreAI/GameObjectAI.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/CoreAI/GuardAI.cpp b/src/server/game/AI/CoreAI/GuardAI.cpp index 90ca7009098..52c1b9f00c0 100644 --- a/src/server/game/AI/CoreAI/GuardAI.cpp +++ b/src/server/game/AI/CoreAI/GuardAI.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/CoreAI/GuardAI.h b/src/server/game/AI/CoreAI/GuardAI.h index c8dd9d54921..1a8b220cb43 100644 --- a/src/server/game/AI/CoreAI/GuardAI.h +++ b/src/server/game/AI/CoreAI/GuardAI.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/CoreAI/PassiveAI.cpp b/src/server/game/AI/CoreAI/PassiveAI.cpp index 3738d5bab6c..2407b1f71e6 100644 --- a/src/server/game/AI/CoreAI/PassiveAI.cpp +++ b/src/server/game/AI/CoreAI/PassiveAI.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/CoreAI/PassiveAI.h b/src/server/game/AI/CoreAI/PassiveAI.h index b4fd579d693..cb513234be3 100644 --- a/src/server/game/AI/CoreAI/PassiveAI.h +++ b/src/server/game/AI/CoreAI/PassiveAI.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 1de5417b820..a8d2a2248ad 100644 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -44,10 +44,6 @@ PetAI::PetAI(Creature* c) : CreatureAI(c), i_tracker(TIME_INTERVAL_LOOK) UpdateAllies(); } -void PetAI::EnterEvadeMode() -{ -} - bool PetAI::_needToStop() { // This is needed for charmed creatures, as once their target was reset other effects can trigger threat @@ -74,12 +70,13 @@ void PetAI::_stopAttack() me->InterruptNonMeleeSpells(false); me->SendMeleeAttackStop(); // Should stop pet's attack button from flashing me->GetCharmInfo()->SetIsCommandAttack(false); + ClearCharmInfoFlags(); HandleReturnMovement(); } void PetAI::UpdateAI(const uint32 diff) { - if (!me->isAlive()) + if (!me->isAlive() || !me->GetCharmInfo()) return; Unit* owner = me->GetCharmerOrOwner(); @@ -107,39 +104,33 @@ void PetAI::UpdateAI(const uint32 diff) } // Check before attacking to prevent pets from leaving stay position - if (CanAttack(me->getVictim())) + if (me->GetCharmInfo()->HasCommandState(COMMAND_STAY)) + { + if (me->GetCharmInfo()->IsCommandAttack() || (me->GetCharmInfo()->IsAtStay() && me->IsWithinMeleeRange(me->getVictim()))) + DoMeleeAttackIfReady(); + } + else DoMeleeAttackIfReady(); } - else if (owner && me->GetCharmInfo()) //no victim + else { - // Only aggressive pets do target search every update. - // Defensive pets do target search only in these cases: - // * Owner attacks something - handled by OwnerAttacked() - // * Owner receives damage - handled by OwnerDamagedBy() - // * Pet is in combat and current target dies - handled by KilledUnit() - if (me->HasReactState(REACT_AGGRESSIVE)) + if (me->HasReactState(REACT_AGGRESSIVE) || me->GetCharmInfo()->IsAtStay()) { - Unit* nextTarget = SelectNextTarget(); + // Every update we need to check targets only in certain cases + // Aggressive - Allow auto select if owner or pet don't have a target + // Stay - Only pick from pet or owner targets / attackers so targets won't run by + // while chasing our owner. Don't do auto select. + // All other cases (ie: defensive) - Targets are assigned by AttackedBy(), OwnerAttackedBy(), OwnerAttacked(), etc. + Unit* nextTarget = SelectNextTarget(me->HasReactState(REACT_AGGRESSIVE)); if (nextTarget) AttackStart(nextTarget); else - { - me->GetCharmInfo()->SetIsCommandAttack(false); HandleReturnMovement(); - } } else - { - me->GetCharmInfo()->SetIsCommandAttack(false); HandleReturnMovement(); - } } - else if (owner && !me->HasUnitState(UNIT_STATE_FOLLOW)) // no charm info and no victim - HandleReturnMovement(); - - if (!me->GetCharmInfo()) - return; // Autocast (casted only in combat or persistent spells in any state) if (!me->HasUnitState(UNIT_STATE_CASTING)) @@ -191,6 +182,9 @@ void PetAI::UpdateAI(const uint32 diff) } } + if (spellInfo->HasEffect(SPELL_EFFECT_JUMP_DEST)) + continue; // Pets must only jump to target + // No enemy, check friendly if (!spellUsed) { @@ -257,6 +251,12 @@ void PetAI::UpdateAI(const uint32 diff) for (TargetSpellList::const_iterator itr = targetSpellStore.begin(); itr != targetSpellStore.end(); ++itr) delete itr->second; } + + // Update speed as needed to prevent dropping too far behind and despawning + me->UpdateSpeed(MOVE_RUN, true); + me->UpdateSpeed(MOVE_WALK, true); + me->UpdateSpeed(MOVE_FLIGHT, true); + } void PetAI::UpdateAllies() @@ -274,6 +274,7 @@ void PetAI::UpdateAllies() //only pet and owner/not in group->ok if (m_AllySet.size() == 2 && !group) return; + //owner is in group; group members filled in already (no raid -> subgroupcount = whole count) if (group && !group->isRaidGroup() && m_AllySet.size() == (group->GetMembersCount() + 2)) return; @@ -313,15 +314,11 @@ void PetAI::KilledUnit(Unit* victim) me->InterruptNonMeleeSpells(false); me->SendMeleeAttackStop(); // Stops the pet's 'Attack' button from flashing - Unit* nextTarget = SelectNextTarget(); - - if (nextTarget) + // Before returning to owner, see if there are more things to attack + if (Unit* nextTarget = SelectNextTarget(false)) AttackStart(nextTarget); else - { - me->GetCharmInfo()->SetIsCommandAttack(false); HandleReturnMovement(); // Return - } } void PetAI::AttackStart(Unit* target) @@ -332,17 +329,14 @@ void PetAI::AttackStart(Unit* target) if (!CanAttack(target)) return; - if (Unit* owner = me->GetOwner()) - owner->SetInCombatWith(target); - // Only chase if not commanded to stay or if stay but commanded to attack DoAttack(target, (!me->GetCharmInfo()->HasCommandState(COMMAND_STAY) || me->GetCharmInfo()->IsCommandAttack())); } -void PetAI::OwnerDamagedBy(Unit* attacker) +void PetAI::OwnerAttackedBy(Unit* attacker) { - // Called when owner takes damage. Allows defensive pets to know - // that their owner might need help + // Called when owner takes damage. This function helps keep pets from running off + // simply due to owner gaining aggro. if (!attacker) return; @@ -380,10 +374,12 @@ void PetAI::OwnerAttacked(Unit* target) AttackStart(target); } -Unit* PetAI::SelectNextTarget() +Unit* PetAI::SelectNextTarget(bool allowAutoSelect) const { - // Provides next target selection after current target death - // Targets are not evaluated here for being valid attack targets + // Provides next target selection after current target death. + // This function should only be called internally by the AI + // Targets are not evaluated here for being valid targets, that is done in _CanAttack() + // The parameter: allowAutoSelect lets us disable aggressive pet auto targeting for certain situations // Passive pets don't do next target selection if (me->HasReactState(REACT_PASSIVE)) @@ -406,17 +402,17 @@ Unit* PetAI::SelectNextTarget() // Check owner victim // 3.0.2 - Pets now start attacking their owners victim in defensive mode as soon as the hunter does if (Unit* ownerVictim = me->GetCharmerOrOwner()->getVictim()) - if (!ownerVictim->HasBreakableByDamageCrowdControlAura()) return ownerVictim; // Neither pet or owner had a target and aggressive pets can pick any target - // Note: Creature::SelectNearestTarget() If no distance is supplied it uses MAX_VISIBILITY_DISTANCE - // We also want to lock this to LOS so pet doesn't go running through walls and stuff - if (me->HasReactState(REACT_AGGRESSIVE)) - if (Unit* nearTarget = me->ToCreature()->SelectNearestTarget()) - if (nearTarget->IsHostileTo(me) && !nearTarget->HasBreakableByDamageCrowdControlAura()) - if (nearTarget->IsWithinLOS(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ())) - return nearTarget; + // To prevent aggressive pets from chain selecting targets and running off, we + // only select a random target if certain conditions are met. + if (me->HasReactState(REACT_AGGRESSIVE) && allowAutoSelect) + { + if (!me->GetCharmInfo()->IsReturning() || me->GetCharmInfo()->IsFollowing() || me->GetCharmInfo()->IsAtStay()) + if (Unit* nearTarget = me->ToCreature()->SelectNearestHostileUnitInAggroRange(true)) + return nearTarget; + } // Default - no valid targets return NULL; @@ -426,6 +422,11 @@ void PetAI::HandleReturnMovement() { // Handles moving the pet back to stay or owner + // Prevent activating movement when under control of spells + // such as "Eyes of the Beast" + if (me->isCharmed()) + return; + if (me->GetCharmInfo()->HasCommandState(COMMAND_STAY)) { if (!me->GetCharmInfo()->IsAtStay() && !me->GetCharmInfo()->IsReturning()) @@ -436,6 +437,7 @@ void PetAI::HandleReturnMovement() float x, y, z; me->GetCharmInfo()->GetStayPosition(x, y, z); + ClearCharmInfoFlags(); me->GetCharmInfo()->SetIsReturning(true); me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MovePoint(me->GetGUIDLow(), x, y, z); @@ -448,6 +450,7 @@ void PetAI::HandleReturnMovement() { if (!me->GetCharmInfo()->IsCommandAttack()) { + ClearCharmInfoFlags(); me->GetCharmInfo()->SetIsReturning(true); me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveFollow(me->GetCharmerOrOwner(), PET_FOLLOW_DIST, me->GetFollowAngle()); @@ -458,33 +461,33 @@ void PetAI::HandleReturnMovement() void PetAI::DoAttack(Unit* target, bool chase) { - // Handles attack with or without chase and also resets all - // PetAI flags for next update / creature kill + // Handles attack with or without chase and also resets flags + // for next update / creature kill - // me->GetCharmInfo()->SetIsCommandAttack(false); + if (me->Attack(target, true)) + { + if (Unit* owner = me->GetOwner()) + owner->SetInCombatWith(target); - // The following conditions are true if chase == true - // (Follow && (Aggressive || Defensive)) - // ((Stay || Follow) && (Passive && player clicked attack)) + // Play sound to let the player know the pet is attacking something it picked on its own + if (me->HasReactState(REACT_AGGRESSIVE) && !me->GetCharmInfo()->IsCommandAttack()) + me->SendPetAIReaction(me->GetGUID()); - if (chase) - { - if (me->Attack(target, true)) + + if (chase) + { + ClearCharmInfoFlags(); + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveChase(target); + } + else // (Stay && ((Aggressive || Defensive) && In Melee Range))) { - me->GetCharmInfo()->SetIsAtStay(false); - me->GetCharmInfo()->SetIsFollowing(false); - me->GetCharmInfo()->SetIsReturning(false); + ClearCharmInfoFlags(); + me->GetCharmInfo()->SetIsAtStay(true); me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MoveChase(target); + me->GetMotionMaster()->MoveIdle(); } } - else // (Stay && ((Aggressive || Defensive) && In Melee Range))) - { - me->GetCharmInfo()->SetIsAtStay(true); - me->GetCharmInfo()->SetIsFollowing(false); - me->GetCharmInfo()->SetIsReturning(false); - me->Attack(target, true); - } } void PetAI::MovementInform(uint32 moveType, uint32 data) @@ -498,10 +501,8 @@ void PetAI::MovementInform(uint32 moveType, uint32 data) // pet's GUIDLow since we set that as the waypoint ID if (data == me->GetGUIDLow() && me->GetCharmInfo()->IsReturning()) { + ClearCharmInfoFlags(); me->GetCharmInfo()->SetIsAtStay(true); - me->GetCharmInfo()->SetIsReturning(false); - me->GetCharmInfo()->SetIsFollowing(false); - me->GetCharmInfo()->SetIsCommandAttack(false); me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveIdle(); } @@ -513,10 +514,8 @@ void PetAI::MovementInform(uint32 moveType, uint32 data) // otherwise we're probably chasing a creature if (me->GetCharmerOrOwner() && me->GetCharmInfo() && data == me->GetCharmerOrOwner()->GetGUIDLow() && me->GetCharmInfo()->IsReturning()) { - me->GetCharmInfo()->SetIsAtStay(false); - me->GetCharmInfo()->SetIsReturning(false); + ClearCharmInfoFlags(); me->GetCharmInfo()->SetIsFollowing(true); - me->GetCharmInfo()->SetIsCommandAttack(false); } break; } @@ -527,32 +526,55 @@ void PetAI::MovementInform(uint32 moveType, uint32 data) bool PetAI::CanAttack(Unit* target) { - // Evaluates wether a pet can attack a specific - // target based on CommandState, ReactState and other flags + // Evaluates wether a pet can attack a specific target based on CommandState, ReactState and other flags + // IMPORTANT: The order in which things are checked is important, be careful if you add or remove checks - // Can't attack dead targets... - if (!target->isAlive()) + // Hmmm... + if (!target) return false; - // Returning - check first since pets returning ignore attacks - if (me->GetCharmInfo()->IsReturning()) + if (!target->isAlive()) + { + // Clear target to prevent getting stuck on dead targets + me->AttackStop(); + me->InterruptNonMeleeSpells(false); + me->SendMeleeAttackStop(); return false; + } - // Passive - check now so we don't have to worry about passive in later checks + // Passive - passive pets can attack if told to if (me->HasReactState(REACT_PASSIVE)) return me->GetCharmInfo()->IsCommandAttack(); - // Follow - if (me->GetCharmInfo()->HasCommandState(COMMAND_FOLLOW)) - return true; + // CC - mobs under crowd control can be attacked if owner commanded + if (target->HasBreakableByDamageCrowdControlAura()) + return me->GetCharmInfo()->IsCommandAttack(); + + // Returning - pets ignore attacks only if owner clicked follow + if (me->GetCharmInfo()->IsReturning()) + return !me->GetCharmInfo()->IsCommandFollow(); // Stay - can attack if target is within range or commanded to if (me->GetCharmInfo()->HasCommandState(COMMAND_STAY)) return (me->IsWithinMeleeRange(target) || me->GetCharmInfo()->IsCommandAttack()); - // Pets commanded to attack should not stop their approach if attacked by another creature - if (me->getVictim() && (me->getVictim() != target)) - return !me->GetCharmInfo()->IsCommandAttack(); + // Pets attacking something (or chasing) should only switch targets if owner tells them to + if (me->getVictim() && me->getVictim() != target) + { + // Check if our owner selected this target and clicked "attack" + Unit* ownerTarget = NULL; + if (Player* owner = me->GetCharmerOrOwner()->ToPlayer()) + ownerTarget = owner->GetSelectedUnit(); + else + ownerTarget = me->GetCharmerOrOwner()->getVictim(); + + if (ownerTarget && me->GetCharmInfo()->IsCommandAttack()) + return (target->GetGUID() == ownerTarget->GetGUID()); + } + + // Follow + if (me->GetCharmInfo()->HasCommandState(COMMAND_FOLLOW)) + return !me->GetCharmInfo()->IsReturning(); // default, though we shouldn't ever get here return false; @@ -565,11 +587,55 @@ void PetAI::ReceiveEmote(Player* player, uint32 emote) { case TEXT_EMOTE_COWER: if (me->isPet() && me->ToPet()->IsPetGhoul()) - me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + me->HandleEmoteCommand(/*EMOTE_ONESHOT_ROAR*/EMOTE_ONESHOT_OMNICAST_GHOUL); break; case TEXT_EMOTE_ANGRY: if (me->isPet() && me->ToPet()->IsPetGhoul()) - me->HandleEmoteCommand(EMOTE_ONESHOT_COWER); + me->HandleEmoteCommand(/*EMOTE_ONESHOT_COWER*/EMOTE_STATE_STUN); + break; + case TEXT_EMOTE_GLARE: + if (me->isPet() && me->ToPet()->IsPetGhoul()) + me->HandleEmoteCommand(EMOTE_STATE_STUN); + break; + case TEXT_EMOTE_SOOTHE: + if (me->isPet() && me->ToPet()->IsPetGhoul()) + me->HandleEmoteCommand(EMOTE_ONESHOT_OMNICAST_GHOUL); break; } } + +void PetAI::ClearCharmInfoFlags() +{ + // Quick access to set all flags to FALSE + + CharmInfo* ci = me->GetCharmInfo(); + + if (ci) + { + ci->SetIsAtStay(false); + ci->SetIsCommandAttack(false); + ci->SetIsCommandFollow(false); + ci->SetIsFollowing(false); + ci->SetIsReturning(false); + } +} + +void PetAI::AttackedBy(Unit* attacker) +{ + // Called when pet takes damage. This function helps keep pets from running off + // simply due to gaining aggro. + + if (!attacker) + return; + + // Passive pets don't do anything + if (me->HasReactState(REACT_PASSIVE)) + return; + + // Prevent pet from disengaging from current target + if (me->getVictim() && me->getVictim()->isAlive()) + return; + + // Continue to evaluate and attack if necessary + AttackStart(attacker); +} diff --git a/src/server/game/AI/CoreAI/PetAI.h b/src/server/game/AI/CoreAI/PetAI.h index d7f1dca3fbf..674c3dc1748 100644 --- a/src/server/game/AI/CoreAI/PetAI.h +++ b/src/server/game/AI/CoreAI/PetAI.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -31,17 +31,24 @@ class PetAI : public CreatureAI explicit PetAI(Creature* c); - void EnterEvadeMode(); void UpdateAI(const uint32); static int Permissible(const Creature*); void KilledUnit(Unit* /*victim*/); void AttackStart(Unit* target); void MovementInform(uint32 moveType, uint32 data); - void OwnerDamagedBy(Unit* attacker); + void OwnerAttackedBy(Unit* attacker); void OwnerAttacked(Unit* target); + void AttackedBy(Unit* attacker); void ReceiveEmote(Player* player, uint32 textEmote); + // The following aren't used by the PetAI but need to be defined to override + // default CreatureAI functions which interfere with the PetAI + // + void MoveInLineOfSight(Unit* /*who*/) {} // CreatureAI interferes with returning pets + void MoveInLineOfSight_Safe(Unit* /*who*/) {} // CreatureAI interferes with returning pets + void EnterEvadeMode() {} // For fleeing, pets don't use this type of Evade mechanic + private: bool _isVisible(Unit*) const; bool _needToStop(void); @@ -54,10 +61,11 @@ class PetAI : public CreatureAI std::set<uint64> m_AllySet; uint32 m_updateAlliesTimer; - Unit* SelectNextTarget(); + Unit* SelectNextTarget(bool allowAutoSelect) const; void HandleReturnMovement(); void DoAttack(Unit* target, bool chase); bool CanAttack(Unit* target); + void ClearCharmInfoFlags(); }; #endif diff --git a/src/server/game/AI/CoreAI/ReactorAI.cpp b/src/server/game/AI/CoreAI/ReactorAI.cpp index 4683a75a44e..31b9a82c534 100644 --- a/src/server/game/AI/CoreAI/ReactorAI.cpp +++ b/src/server/game/AI/CoreAI/ReactorAI.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/CoreAI/ReactorAI.h b/src/server/game/AI/CoreAI/ReactorAI.h index 4a95dcf04e8..39af09c4a9d 100644 --- a/src/server/game/AI/CoreAI/ReactorAI.h +++ b/src/server/game/AI/CoreAI/ReactorAI.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/CoreAI/TotemAI.cpp b/src/server/game/AI/CoreAI/TotemAI.cpp index d12d3c098e8..8846066fee4 100644 --- a/src/server/game/AI/CoreAI/TotemAI.cpp +++ b/src/server/game/AI/CoreAI/TotemAI.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/CoreAI/TotemAI.h b/src/server/game/AI/CoreAI/TotemAI.h index f0d705345ef..f9a6acc7fce 100644 --- a/src/server/game/AI/CoreAI/TotemAI.h +++ b/src/server/game/AI/CoreAI/TotemAI.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index 9f2c9a86094..a3cb57b3332 100644 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -162,6 +162,28 @@ void UnitAI::DoCast(uint32 spellId) me->CastSpell(target, spellId, false); } +void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered) +{ + if (!victim || (me->HasUnitState(UNIT_STATE_CASTING) && !triggered)) + return; + + me->CastSpell(victim, spellId, triggered); +} + +void UnitAI::DoCastVictim(uint32 spellId, bool triggered) +{ + // Why don't we check for casting unit_state and existing target as we do in DoCast(.. ? + me->CastSpell(me->getVictim(), spellId, triggered); +} + +void UnitAI::DoCastAOE(uint32 spellId, bool triggered) +{ + if (!triggered && me->HasUnitState(UNIT_STATE_CASTING)) + return; + + me->CastSpell((Unit*)NULL, spellId, triggered); +} + #define UPDATE_TARGET(a) {if (AIInfo->target<a) AIInfo->target=a;} void UnitAI::FillAISpellInfo() diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h index 2eab0e89fcd..3cb7c15dce4 100644 --- a/src/server/game/AI/CoreAI/UnitAI.h +++ b/src/server/game/AI/CoreAI/UnitAI.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -29,17 +29,6 @@ class Quest; class Unit; struct AISpellInfoType; -// Default script texts -enum GeneralScriptTexts -{ - DEFAULT_TEXT = -1000000, - EMOTE_GENERIC_FRENZY_KILL = -1000001, - EMOTE_GENERIC_FRENZY = -1000002, - EMOTE_GENERIC_ENRAGED = -1000003, - EMOTE_GENERIC_BERSERK = -1000004, - EMOTE_GENERIC_BERSERK_RAID = -1000005 // RaidBossEmote version of the previous one -}; - //Selection method used by SelectTarget enum SelectAggroTarget { diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index e5868117da8..427818fe571 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -174,3 +174,91 @@ void CreatureAI::EnterEvadeMode() if (!me->getVictim()) AttackStart(attacker); }*/ + +void CreatureAI::SetGazeOn(Unit* target) +{ + if (me->IsValidAttackTarget(target)) + { + AttackStart(target); + me->SetReactState(REACT_PASSIVE); + } +} + +bool CreatureAI::UpdateVictimWithGaze() +{ + if (!me->isInCombat()) + return false; + + if (me->HasReactState(REACT_PASSIVE)) + { + if (me->getVictim()) + return true; + else + me->SetReactState(REACT_AGGRESSIVE); + } + + if (Unit* victim = me->SelectVictim()) + AttackStart(victim); + return me->getVictim(); +} + +bool CreatureAI::UpdateVictim() +{ + if (!me->isInCombat()) + return false; + + if (!me->HasReactState(REACT_PASSIVE)) + { + if (Unit* victim = me->SelectVictim()) + AttackStart(victim); + return me->getVictim(); + } + else if (me->getThreatManager().isThreatListEmpty()) + { + EnterEvadeMode(); + return false; + } + + return true; +} + +bool CreatureAI::_EnterEvadeMode() +{ + if (!me->isAlive()) + return false; + + // dont remove vehicle auras, passengers arent supposed to drop off the vehicle + me->RemoveAllAurasExceptType(SPELL_AURA_CONTROL_VEHICLE); + + // sometimes bosses stuck in combat? + me->DeleteThreatList(); + me->CombatStop(true); + me->LoadCreaturesAddon(); + me->SetLootRecipient(NULL); + me->ResetPlayerDamageReq(); + + if (me->IsInEvadeMode()) + return false; + + return true; +} + +Creature* CreatureAI::DoSummon(uint32 entry, const Position& pos, uint32 despawnTime, TempSummonType summonType) +{ + return me->SummonCreature(entry, pos, summonType, despawnTime); +} + +Creature* CreatureAI::DoSummon(uint32 entry, WorldObject* obj, float radius, uint32 despawnTime, TempSummonType summonType) +{ + Position pos; + obj->GetRandomNearPosition(pos, radius); + return me->SummonCreature(entry, pos, summonType, despawnTime); +} + +Creature* CreatureAI::DoSummonFlyer(uint32 entry, WorldObject* obj, float flightZ, float radius, uint32 despawnTime, TempSummonType summonType) +{ + Position pos; + obj->GetRandomNearPosition(pos, radius); + pos.m_positionZ += flightZ; + return me->SummonCreature(entry, pos, summonType, despawnTime); +} diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index d3ad27935ca..9d61ec0a214 100644 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -117,7 +117,7 @@ class CreatureAI : public UnitAI virtual void SpellHitTarget(Unit* /*target*/, SpellInfo const* /*spell*/) {} // Called when the creature is target of hostile action: swing, hostile spell landed, fear/etc) - //virtual void AttackedBy(Unit* attacker); + virtual void AttackedBy(Unit* /*attacker*/) {} virtual bool IsEscorted() { return false; } // Called when creature is spawned or respawned (for reseting variables) @@ -137,7 +137,7 @@ class CreatureAI : public UnitAI virtual void ReceiveEmote(Player* /*player*/, uint32 /*emoteId*/) {} // Called when owner takes damage - virtual void OwnerDamagedBy(Unit* /*attacker*/) {} + virtual void OwnerAttackedBy(Unit* /*attacker*/) {} // Called when owner attacks something virtual void OwnerAttacked(Unit* /*target*/) {} diff --git a/src/server/game/AI/CreatureAIFactory.h b/src/server/game/AI/CreatureAIFactory.h index f4147826811..b4e031fbe6f 100644 --- a/src/server/game/AI/CreatureAIFactory.h +++ b/src/server/game/AI/CreatureAIFactory.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/CreatureAIImpl.h b/src/server/game/AI/CreatureAIImpl.h index 981ac1f5f16..559240c4a3f 100644 --- a/src/server/game/AI/CreatureAIImpl.h +++ b/src/server/game/AI/CreatureAIImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -311,8 +311,10 @@ const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, c } } -class EventMap : private std::map<uint32, uint32> +class EventMap { + typedef std::map<uint32, uint32> StorageType; + public: EventMap() : _time(0), _phase(0) {} @@ -320,13 +322,16 @@ class EventMap : private std::map<uint32, uint32> uint32 GetTimer() const { return _time; } // Removes all events and clears phase - void Reset() { clear(); _time = 0; _phase = 0; } + void Reset() + { + _eventMap.clear(); _time = 0; _phase = 0; + } void Update(uint32 time) { _time += time; } uint32 GetPhaseMask() const { return (_phase >> 24) & 0xFF; } - bool Empty() const { return empty(); } + bool Empty() const { return _eventMap.empty(); } // Sets event phase, must be in range 1 - 8 void SetPhase(uint32 phase) @@ -346,14 +351,14 @@ class EventMap : private std::map<uint32, uint32> eventId |= (1 << (groupId + 16)); if (phase && phase < 8) eventId |= (1 << (phase + 24)); - const_iterator itr = find(time); - while (itr != end()) + StorageType::const_iterator itr = _eventMap.find(time); + while (itr != _eventMap.end()) { ++time; - itr = find(time); + itr = _eventMap.find(time); } - insert(std::make_pair(time, eventId)); + _eventMap.insert(StorageType::value_type(time, eventId)); } // Removes event with specified id and creates new entry for it @@ -366,41 +371,43 @@ class EventMap : private std::map<uint32, uint32> // Reschedules closest event void RepeatEvent(uint32 time) { - if (empty()) + if (_eventMap.empty()) return; - uint32 eventId = begin()->second; - erase(begin()); + uint32 eventId = _eventMap.begin()->second; + _eventMap.erase(_eventMap.begin()); time += _time; - const_iterator itr = find(time); - while (itr != end()) + StorageType::const_iterator itr = _eventMap.find(time); + while (itr != _eventMap.end()) { ++time; - itr = find(time); + itr = _eventMap.find(time); } - insert(std::make_pair(time, eventId)); + _eventMap.insert(StorageType::value_type(time, eventId)); } // Removes first event void PopEvent() { - erase(begin()); + if (!_eventMap.empty()) + _eventMap.erase(_eventMap.begin()); } // Gets next event id to execute and removes it from map uint32 ExecuteEvent() { - while (!empty()) + while (!_eventMap.empty()) { - if (begin()->first > _time) + StorageType::iterator itr = _eventMap.begin(); + if (itr->first > _time) return 0; - else if (_phase && (begin()->second & 0xFF000000) && !(begin()->second & _phase)) - erase(begin()); + else if (_phase && (itr->second & 0xFF000000) && !(itr->second & _phase)) + _eventMap.erase(itr); else { - uint32 eventId = (begin()->second & 0x0000FFFF); - erase(begin()); + uint32 eventId = (itr->second & 0x0000FFFF); + _eventMap.erase(itr); return eventId; } } @@ -410,14 +417,15 @@ class EventMap : private std::map<uint32, uint32> // Gets next event id to execute uint32 GetEvent() { - while (!empty()) + while (!_eventMap.empty()) { - if (begin()->first > _time) + StorageType::iterator itr = _eventMap.begin(); + if (itr->first > _time) return 0; - else if (_phase && (begin()->second & 0xFF000000) && !(begin()->second & _phase)) - erase(begin()); + else if (_phase && (itr->second & 0xFF000000) && !(itr->second & _phase)) + _eventMap.erase(itr); else - return (begin()->second & 0x0000FFFF); + return (itr->second & 0x0000FFFF); } return 0; @@ -437,13 +445,13 @@ class EventMap : private std::map<uint32, uint32> { uint32 nextTime = _time + delay; uint32 groupMask = (1 << (groupId + 16)); - for (iterator itr = begin(); itr != end() && itr->first < nextTime;) + for (StorageType::iterator itr = _eventMap.begin(); itr != _eventMap.end() && itr->first < nextTime;) { if (itr->second & groupMask) { ScheduleEvent(itr->second, itr->first - _time + delay); - erase(itr); - itr = begin(); + _eventMap.erase(itr); + itr = _eventMap.begin(); } else ++itr; @@ -453,12 +461,12 @@ class EventMap : private std::map<uint32, uint32> // Cancel events with specified id void CancelEvent(uint32 eventId) { - for (iterator itr = begin(); itr != end();) + for (StorageType::iterator itr = _eventMap.begin(); itr != _eventMap.end();) { if (eventId == (itr->second & 0x0000FFFF)) { - erase(itr); - itr = begin(); + _eventMap.erase(itr); + itr = _eventMap.begin(); } else ++itr; @@ -470,12 +478,12 @@ class EventMap : private std::map<uint32, uint32> { uint32 groupMask = (1 << (groupId + 16)); - for (iterator itr = begin(); itr != end();) + for (StorageType::iterator itr = _eventMap.begin(); itr != _eventMap.end();) { if (itr->second & groupMask) { - erase(itr); - itr = begin(); + _eventMap.erase(itr); + itr = _eventMap.begin(); } else ++itr; @@ -486,7 +494,7 @@ class EventMap : private std::map<uint32, uint32> // To get how much time remains substract _time uint32 GetNextEventTime(uint32 eventId) const { - for (const_iterator itr = begin(); itr != end(); ++itr) + for (StorageType::const_iterator itr = _eventMap.begin(); itr != _eventMap.end(); ++itr) if (eventId == (itr->second & 0x0000FFFF)) return itr->first; @@ -496,6 +504,8 @@ class EventMap : private std::map<uint32, uint32> private: uint32 _time; uint32 _phase; + + StorageType _eventMap; }; enum AITarget @@ -530,115 +540,5 @@ struct AISpellInfoType AISpellInfoType* GetAISpellInfo(uint32 i); -inline void CreatureAI::SetGazeOn(Unit* target) -{ - if (me->IsValidAttackTarget(target)) - { - AttackStart(target); - me->SetReactState(REACT_PASSIVE); - } -} - -inline bool CreatureAI::UpdateVictimWithGaze() -{ - if (!me->isInCombat()) - return false; - - if (me->HasReactState(REACT_PASSIVE)) - { - if (me->getVictim()) - return true; - else - me->SetReactState(REACT_AGGRESSIVE); - } - - if (Unit* victim = me->SelectVictim()) - AttackStart(victim); - return me->getVictim(); -} - -inline bool CreatureAI::UpdateVictim() -{ - if (!me->isInCombat()) - return false; - - if (!me->HasReactState(REACT_PASSIVE)) - { - if (Unit* victim = me->SelectVictim()) - AttackStart(victim); - return me->getVictim(); - } - else if (me->getThreatManager().isThreatListEmpty()) - { - EnterEvadeMode(); - return false; - } - - return true; -} - -inline bool CreatureAI::_EnterEvadeMode() -{ - if (!me->isAlive()) - return false; - - // dont remove vehicle auras, passengers arent supposed to drop off the vehicle - me->RemoveAllAurasExceptType(SPELL_AURA_CONTROL_VEHICLE); - - // sometimes bosses stuck in combat? - me->DeleteThreatList(); - me->CombatStop(true); - me->LoadCreaturesAddon(); - me->SetLootRecipient(NULL); - me->ResetPlayerDamageReq(); - - if (me->IsInEvadeMode()) - return false; - - return true; -} - -inline void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered) -{ - if (!victim || (me->HasUnitState(UNIT_STATE_CASTING) && !triggered)) - return; - - me->CastSpell(victim, spellId, triggered); -} - -inline void UnitAI::DoCastVictim(uint32 spellId, bool triggered) -{ - // Why don't we check for casting unit_state and existing target as we do in DoCast(.. ? - me->CastSpell(me->getVictim(), spellId, triggered); -} - -inline void UnitAI::DoCastAOE(uint32 spellId, bool triggered) -{ - if (!triggered && me->HasUnitState(UNIT_STATE_CASTING)) - return; - - me->CastSpell((Unit*)NULL, spellId, triggered); -} - -inline Creature* CreatureAI::DoSummon(uint32 entry, const Position& pos, uint32 despawnTime, TempSummonType summonType) -{ - return me->SummonCreature(entry, pos, summonType, despawnTime); -} - -inline Creature* CreatureAI::DoSummon(uint32 entry, WorldObject* obj, float radius, uint32 despawnTime, TempSummonType summonType) -{ - Position pos; - obj->GetRandomNearPosition(pos, radius); - return me->SummonCreature(entry, pos, summonType, despawnTime); -} - -inline Creature* CreatureAI::DoSummonFlyer(uint32 entry, WorldObject* obj, float flightZ, float radius, uint32 despawnTime, TempSummonType summonType) -{ - Position pos; - obj->GetRandomNearPosition(pos, radius); - pos.m_positionZ += flightZ; - return me->SummonCreature(entry, pos, summonType, despawnTime); -} - #endif diff --git a/src/server/game/AI/CreatureAIRegistry.cpp b/src/server/game/AI/CreatureAIRegistry.cpp index e5c689da339..8f035667a34 100644 --- a/src/server/game/AI/CreatureAIRegistry.cpp +++ b/src/server/game/AI/CreatureAIRegistry.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/CreatureAIRegistry.h b/src/server/game/AI/CreatureAIRegistry.h index 39d792a0d77..5ffa171fedf 100644 --- a/src/server/game/AI/CreatureAIRegistry.h +++ b/src/server/game/AI/CreatureAIRegistry.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp index 4ccaa174e67..920c1c25533 100644 --- a/src/server/game/AI/CreatureAISelector.cpp +++ b/src/server/game/AI/CreatureAISelector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/CreatureAISelector.h b/src/server/game/AI/CreatureAISelector.h index 933ec16f75c..f399b0985b1 100644 --- a/src/server/game/AI/CreatureAISelector.h +++ b/src/server/game/AI/CreatureAISelector.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index 84e44109e58..7172a187504 100644 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -746,15 +746,12 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 break; case ACTION_T_SUMMON_GO: { - GameObject* object = NULL; - float x, y, z; me->GetPosition(x, y, z); - object = me->SummonGameObject(action.raw.param1, x, y, z, 0, 0, 0, 0, 0, action.raw.param2); + GameObject* object = me->SummonGameObject(action.raw.param1, x, y, z, 0, 0, 0, 0, 0, action.raw.param2); if (!object) - { sLog->outError(LOG_FILTER_TSCR, "EventAI failed to spawn object %u. Spawn event %d is on creature %d", action.raw.param1, eventId, me->GetEntry()); - } + break; } case ACTION_T_SET_SHEATH: @@ -1268,7 +1265,7 @@ bool CreatureEventAI::CanCast(Unit* target, SpellInfo const* spell, bool trigger return false; //Check for power - if (!triggered && me->GetPower((Powers)spell->PowerType) < spell->CalcPowerCost(me, spell->GetSchoolMask())) + if (!triggered && me->GetPower((Powers)spell->PowerType) < uint32(spell->CalcPowerCost(me, spell->GetSchoolMask()))) return false; //Unit is out of range of this spell diff --git a/src/server/game/AI/EventAI/CreatureEventAI.h b/src/server/game/AI/EventAI/CreatureEventAI.h index da5f0b084cf..fa4b2a709a6 100644 --- a/src/server/game/AI/EventAI/CreatureEventAI.h +++ b/src/server/game/AI/EventAI/CreatureEventAI.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -81,7 +81,7 @@ enum EventAI_ActionType ACTION_T_THREAT_SINGLE_PCT = 13, // Threat%, Target ACTION_T_THREAT_ALL_PCT = 14, // Threat% ACTION_T_QUEST_EVENT = 15, // QuestID, Target - ACTION_T_CAST_EVENT = 16, // QuestID, SpellId, Target - must be removed as hack? + ACTION_T_CAST_EVENT = 16, // CreatureId, SpellId, Target - must be removed as hack? ACTION_T_SET_UNIT_FIELD = 17, // Field_Number, Value, Target ACTION_T_SET_UNIT_FLAG = 18, // Flags (may be more than one field OR'd together), Target ACTION_T_REMOVE_UNIT_FLAG = 19, // Flags (may be more than one field OR'd together), Target diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp index f3df332c1e9..8fc8debc38a 100644 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.h b/src/server/game/AI/EventAI/CreatureEventAIMgr.h index 75e24266fb5..1ec08682563 100644 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.h +++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 67cabc6ccb1..9709cb0ecc2 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +/* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index 2a221d04404..50363f20ed5 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/AI/ScriptedAI/ScriptedGossip.h b/src/server/game/AI/ScriptedAI/ScriptedGossip.h index ae1b5fcc12d..80142afd14b 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedGossip.h +++ b/src/server/game/AI/ScriptedAI/ScriptedGossip.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +/* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index bd528edc432..e568a36abc4 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h index 6f748f9dee2..ab2ffb7229d 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.h +++ b/src/server/game/AI/SmartScripts/SmartAI.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 2cd65c42f74..c08e085e816 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -1000,6 +1000,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (me) { me->CallForHelp((float)e.action.callHelp.range); + if (e.action.callHelp.withEmote) + { + TrinityStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_CALL_FOR_HELP, LANG_UNIVERSAL, 0); + sCreatureTextMgr->SendChatPacket(me, builder, CHAT_MSG_MONSTER_EMOTE); + } sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_FOR_HELP: Creature %u", me->GetGUIDLow()); } break; @@ -2260,46 +2265,30 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /* case SMART_TARGET_CREATURE_GUID: { Creature* target = NULL; - if (e.target.unitGUID.entry) + if (!trigger && !GetBaseObject()) { - uint64 guid = MAKE_NEW_GUID(e.target.unitGUID.guid, e.target.unitGUID.entry, HIGHGUID_UNIT); - target = HashMapHolder<Creature>::Find(guid); + sLog->outError(LOG_FILTER_SQL, "SMART_TARGET_CREATURE_GUID can not be used without invoker"); + break; } - else - { - if (!trigger && !GetBaseObject()) - { - sLog->outError(LOG_FILTER_SQL, "SMART_TARGET_CREATURE_GUID can not be used without invoker and without entry"); - break; - } - target = FindCreatureNear(trigger ? trigger : GetBaseObject(), e.target.unitGUID.guid); - } + target = FindCreatureNear(trigger ? trigger : GetBaseObject(), e.target.unitGUID.dbGuid); - if (target) + if (target && (!e.target.unitGUID.entry || target->GetEntry() == e.target.unitGUID.entry)) l->push_back(target); break; } case SMART_TARGET_GAMEOBJECT_GUID: { GameObject* target = NULL; - if (e.target.unitGUID.entry) + if (!trigger && !GetBaseObject()) { - uint64 guid = MAKE_NEW_GUID(e.target.goGUID.guid, e.target.goGUID.entry, HIGHGUID_GAMEOBJECT); - target = HashMapHolder<GameObject>::Find(guid); + sLog->outError(LOG_FILTER_SQL, "SMART_TARGET_GAMEOBJECT_GUID can not be used without invoker"); + break; } - else - { - if (!trigger && !GetBaseObject()) - { - sLog->outError(LOG_FILTER_SQL, "SMART_TARGET_GAMEOBJECT_GUID can not be used without invoker and without entry"); - break; - } - target = FindGameObjectNear(trigger ? trigger : GetBaseObject(), e.target.goGUID.guid); - } + target = FindGameObjectNear(trigger ? trigger : GetBaseObject(), e.target.goGUID.dbGuid); - if (target) + if (target && (!e.target.goGUID.entry || target->GetEntry() == e.target.goGUID.entry)) l->push_back(target); break; } diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h index 61e22b25d17..d0d0221493f 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.h +++ b/src/server/game/AI/SmartScripts/SmartScript.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 4e2c51e50c8..a49ae031e63 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -882,7 +882,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_ACTION_RESET_SCRIPT_BASE_OBJECT: case SMART_ACTION_ACTIVATE_GOBJECT: case SMART_ACTION_CALL_SCRIPT_RESET: - case SMART_ACTION_NONE: + case SMART_ACTION_SET_RANGED_MOVEMENT: case SMART_ACTION_CALL_TIMED_ACTIONLIST: case SMART_ACTION_SET_NPC_FLAG: case SMART_ACTION_ADD_NPC_FLAG: diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index cccf5c2ce10..c88ef206b00 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -420,7 +420,7 @@ enum SMART_ACTION SMART_ACTION_UPDATE_TEMPLATE = 36, // Entry, Team SMART_ACTION_DIE = 37, // No Params SMART_ACTION_SET_IN_COMBAT_WITH_ZONE = 38, // No Params - SMART_ACTION_CALL_FOR_HELP = 39, // Radius + SMART_ACTION_CALL_FOR_HELP = 39, // Radius, With Emote SMART_ACTION_SET_SHEATH = 40, // Sheath (0-unarmed, 1-melee, 2-ranged) SMART_ACTION_FORCE_DESPAWN = 41, // timer SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL = 42, // MinHpValue(+pct, -flat) @@ -677,6 +677,7 @@ struct SmartAction struct { uint32 range; + uint32 withEmote; } callHelp; struct @@ -996,7 +997,7 @@ struct SmartTarget struct { - uint32 guid; + uint32 dbGuid; uint32 entry; } unitGUID; @@ -1031,7 +1032,7 @@ struct SmartTarget struct { - uint32 guid; + uint32 dbGuid; uint32 entry; } goGUID; diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index a82de501ea6..01ba222d93b 100644 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Accounts/AccountMgr.h b/src/server/game/Accounts/AccountMgr.h index c14bcc48bdc..7154cf0e867 100644 --- a/src/server/game/Accounts/AccountMgr.h +++ b/src/server/game/Accounts/AccountMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 09e1de0a2bf..2fd55ac29ef 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -2032,8 +2032,6 @@ void AchievementMgr::RemoveTimedAchievement(AchievementCriteriaTimedTypes type, void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement) { - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::CompletedAchievement(%u)", achievement->ID); - // disable for gamemasters with GM-mode enabled if (m_player->isGameMaster()) return; @@ -2041,6 +2039,9 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement) if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID)) return; + sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::CompletedAchievement(%u). Player: %s (%u)", + achievement->ID, m_player->GetName().c_str(), m_player->GetGUIDLow()); + SendAchievementEarned(achievement); CompletedAchievementData& ca = m_completedAchievements[achievement->ID]; ca.date = time(NULL); diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h index 0f3d63cd60f..ce6ab9cd29b 100644 --- a/src/server/game/Achievements/AchievementMgr.h +++ b/src/server/game/Achievements/AchievementMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Addons/AddonMgr.cpp b/src/server/game/Addons/AddonMgr.cpp index a595c73c7c0..86a90d4d78a 100644 --- a/src/server/game/Addons/AddonMgr.cpp +++ b/src/server/game/Addons/AddonMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Addons/AddonMgr.h b/src/server/game/Addons/AddonMgr.h index 9efbabc8b9f..4d387fcfd4c 100644 --- a/src/server/game/Addons/AddonMgr.h +++ b/src/server/game/Addons/AddonMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -37,9 +37,8 @@ struct AddonInfo struct SavedAddon { - SavedAddon(const std::string& name, uint32 crc) + SavedAddon(const std::string& name, uint32 crc) : Name(name) { - Name = name; CRC = crc; } diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 4738d8f6f27..71c44408f72 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -419,6 +419,8 @@ bool AuctionHouseObject::RemoveAuction(AuctionEntry* auction, uint32 /*itemEntry // we need to delete the entry, it is not referenced any more delete auction; + auction = NULL; + return wasInMap; } @@ -471,8 +473,8 @@ void AuctionHouseObject::Update() auction->DeleteFromDB(trans); CharacterDatabase.CommitTransaction(trans); - RemoveAuction(auction, itemEntry); sAuctionMgr->RemoveAItem(auction->itemGUIDLow); + RemoveAuction(auction, itemEntry); } while (result->NextRow()); } diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h index e13b4665b7b..eb35dc494ee 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.h +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index 55f38f748f2..32f71822737 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -1,6 +1,5 @@ /* - * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -42,6 +41,7 @@ Battlefield::Battlefield() m_TypeId = 0; m_BattleId = 0; m_ZoneId = 0; + m_Map = NULL; m_MapId = 0; m_MaxPlayer = 0; m_MinPlayer = 0; diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h index 28216a43758..0da776b9624 100644 --- a/src/server/game/Battlefield/Battlefield.h +++ b/src/server/game/Battlefield/Battlefield.h @@ -1,6 +1,5 @@ /* - * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Battlefield/BattlefieldMgr.cpp b/src/server/game/Battlefield/BattlefieldMgr.cpp index 6122b25e8e8..5aec0458b19 100644 --- a/src/server/game/Battlefield/BattlefieldMgr.cpp +++ b/src/server/game/Battlefield/BattlefieldMgr.cpp @@ -1,6 +1,5 @@ /* - * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Battlefield/BattlefieldMgr.h b/src/server/game/Battlefield/BattlefieldMgr.h index 1ec1f3b1151..28b2a3c148a 100644 --- a/src/server/game/Battlefield/BattlefieldMgr.h +++ b/src/server/game/Battlefield/BattlefieldMgr.h @@ -1,6 +1,5 @@ /* - * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 63f95e159af..a36d204a4b7 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -1,6 +1,5 @@ /* - * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index 0ac87af94ba..f313357e323 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -1,6 +1,5 @@ /* - * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index 628eb5ff3c1..1b0955fb670 100644 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -337,7 +337,7 @@ void ArenaTeam::Disband(WorldSession* session) // Broadcast update if (session) { - BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName().c_str(), GetName(), ""); + BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName(), GetName(), ""); if (Player* player = session->GetPlayer()) sLog->outDebug(LOG_FILTER_ARENAS, "Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName().c_str(), player->GetGUIDLow(), GetType(), GetId()); diff --git a/src/server/game/Battlegrounds/ArenaTeam.h b/src/server/game/Battlegrounds/ArenaTeam.h index 137ac93d3c0..7a1d9fa131c 100644 --- a/src/server/game/Battlegrounds/ArenaTeam.h +++ b/src/server/game/Battlegrounds/ArenaTeam.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp index 8a2dcecd209..b80332c47b4 100644 --- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp +++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.h b/src/server/game/Battlegrounds/ArenaTeamMgr.h index bf06418145d..589877a150d 100644 --- a/src/server/game/Battlegrounds/ArenaTeamMgr.h +++ b/src/server/game/Battlegrounds/ArenaTeamMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 22f960ceaef..52183b9509d 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -1183,10 +1183,6 @@ void Battleground::AddPlayer(Player* player) player->CastSpell(player, SPELL_ARENA_PREPARATION, true); player->ResetAllPowers(); } - - WorldPacket data(SMSG_ARENA_OPPONENT_UPDATE, 8); - data << uint64(player->GetGUID()); - SendPacketToTeam(team, &data, player, false); } else { @@ -1884,7 +1880,7 @@ int32 Battleground::GetObjectType(uint64 guid) return -1; } -void Battleground::HandleKillUnit(Creature* /*creature*/, Player* /*killer*/) +void Battleground::HandleKillUnit(Creature* /*victim*/, Player* /*killer*/) { } diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 0a837f9f3c3..8aba0ae7e4d 100644 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -108,7 +108,7 @@ enum BattlegroundTimeIntervals RESURRECTION_INTERVAL = 30000, // ms //REMIND_INTERVAL = 10000, // ms INVITATION_REMIND_TIME = 20000, // ms - INVITE_ACCEPT_WAIT_TIME = 40000, // ms + INVITE_ACCEPT_WAIT_TIME = 60000, // ms TIME_TO_AUTOREMOVE = 120000, // ms MAX_OFFLINE_TIME = 300, // secs RESPAWN_ONE_DAY = 86400, // secs diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index a0f95e1eaef..71ac8cf8180 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -1135,9 +1135,8 @@ BattlegroundTypeId BattlegroundMgr::GetRandomBG(BattlegroundTypeId bgTypeId) if (weight) { - uint32 selectedWeight = 0; // Select a random value - selectedWeight = urand(0, weight - 1); + uint32 selectedWeight = urand(0, weight - 1); // Select the correct bg (if we have in DB A(10), B(20), C(10), D(15) --> [0---A---9|10---B---29|30---C---39|40---D---54]) weight = 0; for (BattlegroundSelectionWeightMap::const_iterator it = selectionWeights.begin(); it != selectionWeights.end(); ++it) diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h index 22c42b0febc..236494792d4 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.h +++ b/src/server/game/Battlegrounds/BattlegroundMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index c610cafa1b1..150cec08e3c 100644 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.h b/src/server/game/Battlegrounds/BattlegroundQueue.h index 6f8c774864d..0595d73fcc6 100644 --- a/src/server/game/Battlegrounds/BattlegroundQueue.h +++ b/src/server/game/Battlegrounds/BattlegroundQueue.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index cb0d651ad47..61c68bca121 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ BattlegroundAB::BattlegroundAB() { + m_IsInformedNearVictory = false; m_BuffChange = true; BgObjects.resize(BG_AB_OBJECT_MAX); BgCreatures.resize(BG_AB_ALL_NODES_COUNT + 5);//+5 for aura triggers diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h index 6e01437b895..87e27a990ed 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index b12aec245cd..e0c62f9ca56 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h index b7fa8d6ece8..7cd4d571cad 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp index 402406f7fd0..b0ffc7855dd 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBE.h b/src/server/game/Battlegrounds/Zones/BattlegroundBE.h index 27a88fcfc33..9953e548df6 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundBE.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundBE.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp index 02c5167c9ec..e7462f970a3 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h index ff4b279a2cf..c9fe5e43c33 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index ab0f94b74f6..4ddf7a8b052 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h index 43e7fb4f933..72c6a42b5db 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index dbffc318c78..6c5753a2360 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h index 9e58a93fd2d..7845c002155 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp index 6677d665290..4d0cdf08eba 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundNA.h b/src/server/game/Battlegrounds/Zones/BattlegroundNA.h index 0241cf182a7..d53f47787a4 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundNA.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundNA.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp index 2c715193a3b..1b18583827d 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRL.h b/src/server/game/Battlegrounds/Zones/BattlegroundRL.h index 56d089909e0..e5e55782005 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRL.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRL.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp index 130ba4f3290..9f15bd29bed 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.h b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h index 115fd95d1b0..af6b5996edd 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index ab479eeff2d..6f7a5f616b4 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h index 9089f0c2818..aa3106d237f 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 63204129f24..f56aa9e61b6 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h index b0d68177072..3501999963f 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/CMakeLists.txt b/src/server/game/CMakeLists.txt index cf71bb1b2fa..368407e7924 100644 --- a/src/server/game/CMakeLists.txt +++ b/src/server/game/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # 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/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index 9f4816d6c7c..f4dd059846e 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Calendar/CalendarMgr.h b/src/server/game/Calendar/CalendarMgr.h index db6acb667ec..3674e707399 100644 --- a/src/server/game/Calendar/CalendarMgr.h +++ b/src/server/game/Calendar/CalendarMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 8ce7d7d2139..9e7a63c9093 100644 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Chat/Channels/Channel.h b/src/server/game/Chat/Channels/Channel.h index b9883144cbc..0b3b84088a5 100644 --- a/src/server/game/Chat/Channels/Channel.h +++ b/src/server/game/Chat/Channels/Channel.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Chat/Channels/ChannelMgr.cpp b/src/server/game/Chat/Channels/ChannelMgr.cpp index acd85f11ed8..bb2a7e08b0f 100644 --- a/src/server/game/Chat/Channels/ChannelMgr.cpp +++ b/src/server/game/Chat/Channels/ChannelMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Chat/Channels/ChannelMgr.h b/src/server/game/Chat/Channels/ChannelMgr.h index c1d1793c446..f03514461f8 100644 --- a/src/server/game/Chat/Channels/ChannelMgr.h +++ b/src/server/game/Chat/Channels/ChannelMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 6441bd1bcb6..0bf7c8591e3 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index 3b08fd9aa76..4b93ddc1f42 100644 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index c02df6198f8..4ec8488466c 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Chat/ChatLink.h b/src/server/game/Chat/ChatLink.h index 392d28aca54..57785fbe1a0 100644 --- a/src/server/game/Chat/ChatLink.h +++ b/src/server/game/Chat/ChatLink.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Combat/HostileRefManager.cpp b/src/server/game/Combat/HostileRefManager.cpp index 05b4fa171c7..5b228229e89 100644 --- a/src/server/game/Combat/HostileRefManager.cpp +++ b/src/server/game/Combat/HostileRefManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Combat/HostileRefManager.h b/src/server/game/Combat/HostileRefManager.h index b8991d8faf8..e1d3fd5ed84 100644 --- a/src/server/game/Combat/HostileRefManager.h +++ b/src/server/game/Combat/HostileRefManager.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 2c45067d95a..0e13019c8a2 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Combat/ThreatManager.h b/src/server/game/Combat/ThreatManager.h index 665acd6d751..8162ad50eb7 100644 --- a/src/server/game/Combat/ThreatManager.h +++ b/src/server/game/Combat/ThreatManager.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Combat/UnitEvents.h b/src/server/game/Combat/UnitEvents.h index 8d57ef6c59c..21cd2d80964 100644 --- a/src/server/game/Combat/UnitEvents.h +++ b/src/server/game/Combat/UnitEvents.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 37835618183..0526c9276f9 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -154,11 +154,27 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) case CONDITION_ACTIVE_EVENT: condMeets = sGameEventMgr->IsActiveEvent(ConditionValue1); break; - case CONDITION_INSTANCE_DATA: + case CONDITION_INSTANCE_INFO: { Map* map = object->GetMap(); - if (map && map->IsDungeon() && ((InstanceMap*)map)->GetInstanceScript()) - condMeets = ((InstanceMap*)map)->GetInstanceScript()->GetData(ConditionValue1) == ConditionValue2; + if (map && map->IsDungeon()) + { + if (InstanceScript const* instance = ((InstanceMap*)map)->GetInstanceScript()) + { + switch (ConditionValue3) + { + case INSTANCE_INFO_DATA: + condMeets = instance->GetData(ConditionValue1) == ConditionValue2; + break; + case INSTANCE_INFO_DATA64: + condMeets = instance->GetData64(ConditionValue1) == ConditionValue2; + break; + case INSTANCE_INFO_BOSS_STATE: + condMeets = instance->GetBossState(ConditionValue1) == EncounterState(ConditionValue2); + break; + } + } + } break; } case CONDITION_MAPID: @@ -367,7 +383,7 @@ uint32 Condition::GetSearcherTypeMaskForCondition() case CONDITION_ACTIVE_EVENT: mask |= GRID_MAP_TYPE_MASK_ALL; break; - case CONDITION_INSTANCE_DATA: + case CONDITION_INSTANCE_INFO: mask |= GRID_MAP_TYPE_MASK_ALL; break; case CONDITION_MAPID: @@ -473,6 +489,7 @@ uint32 Condition::GetMaxAvailableConditionTargets() case CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION: case CONDITION_SOURCE_TYPE_SMART_EVENT: case CONDITION_SOURCE_TYPE_NPC_VENDOR: + case CONDITION_SOURCE_TYPE_SPELL_PROC: return 2; default: return 1; @@ -1387,6 +1404,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) break; } case CONDITION_SOURCE_TYPE_SPELL: + case CONDITION_SOURCE_TYPE_SPELL_PROC: { SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(cond->SourceEntry); if (!spellProto) @@ -1899,7 +1917,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) break; } case CONDITION_AREAID: - case CONDITION_INSTANCE_DATA: + case CONDITION_INSTANCE_INFO: break; case CONDITION_WORLD_STATE: { diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 807b75c4ee6..fec5cd6fc95 100644 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ enum ConditionTypes CONDITION_DRUNKENSTATE = 10, // DrunkenState 0, 0 true if player is drunk enough CONDITION_WORLD_STATE = 11, // index value 0 true if world has the value for the index CONDITION_ACTIVE_EVENT = 12, // event_id 0 0 true if event is active - CONDITION_INSTANCE_DATA = 13, // entry data 0 true if data is set in current instance + CONDITION_INSTANCE_INFO = 13, // entry data type true if the instance info defined by type (enum InstanceInfo) equals data. CONDITION_QUEST_NONE = 14, // quest_id 0 0 true if doesn't have quest saved CONDITION_CLASS = 15, // class 0 0 true if player's class is equal to class CONDITION_RACE = 16, // race 0 0 true if player's race is equal to race @@ -128,7 +128,8 @@ enum ConditionSourceType CONDITION_SOURCE_TYPE_VEHICLE_SPELL = 21, CONDITION_SOURCE_TYPE_SMART_EVENT = 22, CONDITION_SOURCE_TYPE_NPC_VENDOR = 23, - CONDITION_SOURCE_TYPE_MAX = 24 // MAX + CONDITION_SOURCE_TYPE_SPELL_PROC = 24, + CONDITION_SOURCE_TYPE_MAX = 25 // MAX }; enum ComparisionType @@ -152,6 +153,13 @@ enum RelationType RELATION_MAX }; +enum InstanceInfo +{ + INSTANCE_INFO_DATA = 0, + INSTANCE_INFO_DATA64, + INSTANCE_INFO_BOSS_STATE +}; + enum { MAX_CONDITION_TARGETS = 3 diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index b544e966084..fefb51323c4 100644 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -310,6 +310,8 @@ bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags } else if (spellFlags & SPELL_DISABLE_DEPRECATED_SPELL) // call not from spellcast return true; + else if (flags & SPELL_DISABLE_LOS) + return spellFlags & SPELL_DISABLE_LOS; break; } diff --git a/src/server/game/Conditions/DisableMgr.h b/src/server/game/Conditions/DisableMgr.h index b1bb43315bd..89761931048 100644 --- a/src/server/game/Conditions/DisableMgr.h +++ b/src/server/game/Conditions/DisableMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -42,8 +42,10 @@ enum SpellDisableTypes SPELL_DISABLE_DEPRECATED_SPELL = 0x8, SPELL_DISABLE_MAP = 0x10, SPELL_DISABLE_AREA = 0x20, + SPELL_DISABLE_LOS = 0x40, MAX_SPELL_DISABLE_TYPE = ( SPELL_DISABLE_PLAYER | SPELL_DISABLE_CREATURE | SPELL_DISABLE_PET | - SPELL_DISABLE_DEPRECATED_SPELL | SPELL_DISABLE_MAP | SPELL_DISABLE_AREA) + SPELL_DISABLE_DEPRECATED_SPELL | SPELL_DISABLE_MAP | SPELL_DISABLE_AREA | + SPELL_DISABLE_LOS) }; enum VmapDisableTypes diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index fa6b5f0695f..70af15da6e9 100644 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -365,24 +365,6 @@ enum SummonPropGroup SUMMON_PROP_GROUP_UNKNOWN3 = 4 // 86 spells in 3.0.3, taxi/mounts }; -// SummonProperties.dbc, col 3 -enum SummonPropType -{ - SUMMON_PROP_TYPE_UNKNOWN = 0, // different summons, 1330 spells in 3.0.3 - SUMMON_PROP_TYPE_SUMMON = 1, // generic summons, 49 spells in 3.0.3 - SUMMON_PROP_TYPE_GUARDIAN = 2, // summon guardian, 393 spells in 3.0.3 - SUMMON_PROP_TYPE_ARMY = 3, // summon army, 5 spells in 3.0.3 - SUMMON_PROP_TYPE_TOTEM = 4, // summon totem, 169 spells in 3.0.3 - SUMMON_PROP_TYPE_CRITTER = 5, // critter/minipet, 195 spells in 3.0.3 - SUMMON_PROP_TYPE_DK = 6, // summon DRW/Ghoul, 2 spells in 3.0.3 - SUMMON_PROP_TYPE_BOMB = 7, // summon bot/bomb, 4 spells in 3.0.3 - SUMMON_PROP_TYPE_PHASING = 8, // something todo with DK prequest line, 2 spells in 3.0.3 - SUMMON_PROP_TYPE_SIEGE_VEH = 9, // summon different vehicles, 14 spells in 3.0.3 - SUMMON_PROP_TYPE_DRAKE_VEH = 10, // summon drake (vehicle), 3 spells - SUMMON_PROP_TYPE_LIGHTWELL = 11, // summon lightwell, 6 spells in 3.0.3 - SUMMON_PROP_TYPE_JEEVES = 12 // summon Jeeves, 1 spell in 3.3.5a -}; - // SummonProperties.dbc, col 5 enum SummonPropFlags { diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index b74c8a4d1f5..3fdff8e11d6 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -198,7 +198,7 @@ uint32 DBCFileCount = 0; static bool LoadDBC_assert_print(uint32 fsize, uint32 rsize, const std::string& filename) { - sLog->outError(LOG_FILTER_GENERAL, "Size of '%s' setted by format string (%u) not equal size of C++ structure (%u).", filename.c_str(), fsize, rsize); + sLog->outError(LOG_FILTER_GENERAL, "Size of '%s' set by format string (%u) not equal size of C++ structure (%u).", filename.c_str(), fsize, rsize); // ASSERT must fail after function call return false; @@ -238,7 +238,7 @@ inline void LoadDBC(uint32& availableDbcLocales, StoreProblemList& errors, DBCSt if (FILE* f = fopen(dbcFilename.c_str(), "rb")) { char buf[100]; - snprintf(buf, 100, " (exists, but has %u fields instead of " SIZEFMTD ") Possible wrong client version.", storage.GetFieldCount(), strlen(storage.GetFormat())); + snprintf(buf, 100, " exists, and has %u field(s) (expected " SIZEFMTD "). Extracted file might be from wrong client version or a database-update has been forgotten.", storage.GetFieldCount(), strlen(storage.GetFormat())); errors.push_back(dbcFilename + buf); fclose(f); } diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index cd30ed587f8..c77d0ee32f1 100644 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index f57724fe58b..aa19863ec29 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index bb671d4dd72..1395440fb6d 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/DungeonFinding/LFG.h b/src/server/game/DungeonFinding/LFG.h index 8477002279c..ebbcfb1d71a 100644 --- a/src/server/game/DungeonFinding/LFG.h +++ b/src/server/game/DungeonFinding/LFG.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/DungeonFinding/LFGGroupData.cpp b/src/server/game/DungeonFinding/LFGGroupData.cpp index 68e7ab82c32..427225bf323 100644 --- a/src/server/game/DungeonFinding/LFGGroupData.cpp +++ b/src/server/game/DungeonFinding/LFGGroupData.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/DungeonFinding/LFGGroupData.h b/src/server/game/DungeonFinding/LFGGroupData.h index 2054e776282..2ad020d3bc1 100644 --- a/src/server/game/DungeonFinding/LFGGroupData.h +++ b/src/server/game/DungeonFinding/LFGGroupData.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 668b1622738..9d5d8e40b54 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -51,7 +51,7 @@ void LFGMgr::_LoadFromDB(Field* fields, uint64 guid) if (!fields) return; - if (!IS_GROUP(guid)) + if (!IS_GROUP_GUID(guid)) return; SetLeader(guid, MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER)); @@ -77,7 +77,7 @@ void LFGMgr::_LoadFromDB(Field* fields, uint64 guid) void LFGMgr::_SaveToDB(uint64 guid, uint32 db_guid) { - if (!IS_GROUP(guid)) + if (!IS_GROUP_GUID(guid)) return; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_LFG_DATA); @@ -188,7 +188,7 @@ void LFGMgr::LoadRewards() RewardMapStore.clear(); // ORDER BY is very important for GetRandomDungeonReward! - QueryResult result = WorldDatabase.Query("SELECT dungeonId, maxLevel, firstQuestId, firstMoneyVar, firstXPVar, otherQuestId, otherMoneyVar, otherXPVar FROM lfg_dungeon_rewards ORDER BY dungeonId, maxLevel ASC"); + QueryResult result = WorldDatabase.Query("SELECT dungeonId, maxLevel, firstQuestId, otherQuestId FROM lfg_dungeon_rewards ORDER BY dungeonId, maxLevel ASC"); if (!result) { @@ -205,11 +205,7 @@ void LFGMgr::LoadRewards() uint32 dungeonId = fields[0].GetUInt32(); uint32 maxLevel = fields[1].GetUInt8(); uint32 firstQuestId = fields[2].GetUInt32(); - uint32 firstMoneyVar = fields[3].GetUInt32(); - uint32 firstXPVar = fields[4].GetUInt32(); - uint32 otherQuestId = fields[5].GetUInt32(); - uint32 otherMoneyVar = fields[6].GetUInt32(); - uint32 otherXPVar = fields[7].GetUInt32(); + uint32 otherQuestId = fields[3].GetUInt32(); if (!GetLFGDungeon(dungeonId)) { @@ -223,10 +219,10 @@ void LFGMgr::LoadRewards() maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); } - if (firstQuestId && !sObjectMgr->GetQuestTemplate(firstQuestId)) + if (!firstQuestId || !sObjectMgr->GetQuestTemplate(firstQuestId)) { sLog->outError(LOG_FILTER_SQL, "First quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", firstQuestId, dungeonId); - firstQuestId = 0; + continue; } if (otherQuestId && !sObjectMgr->GetQuestTemplate(otherQuestId)) @@ -235,9 +231,10 @@ void LFGMgr::LoadRewards() otherQuestId = 0; } - RewardMapStore.insert(LfgRewardContainer::value_type(dungeonId, new LfgReward(maxLevel, firstQuestId, firstMoneyVar, firstXPVar, otherQuestId, otherMoneyVar, otherXPVar))); + RewardMapStore.insert(LfgRewardContainer::value_type(dungeonId, new LfgReward(maxLevel, firstQuestId, otherQuestId))); ++count; - } while (result->NextRow()); + } + while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u lfg dungeon rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } @@ -434,7 +431,7 @@ void LFGMgr::Update(uint32 diff) } else SendLfgUpdatePlayer(guid, LfgUpdateData(LFG_UPDATETYPE_PROPOSAL_BEGIN, GetSelectedDungeons(guid), GetComment(guid))); - SendLfgUpdateProposal(guid, m_lfgProposalId, proposal); + SendLfgUpdateProposal(guid, proposal); } if (proposal.state == LFG_PROPOSAL_SUCCESS) @@ -552,27 +549,8 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const LfgState state = GetState(gguid); if (state == LFG_STATE_QUEUED) { - LfgDungeonSet const& playerDungeons = GetSelectedDungeons(guid); - if (playerDungeons == dungeons) // Joining the same dungeons -- Send OK - { - player->GetSession()->SendLfgJoinResult(joinData); // Default value of joinData.result = LFG_JOIN_OK - if (grp) - { - LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_ADDED_TO_QUEUE, dungeons, comment); - for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) - if (itr->getSource() && itr->getSource()->GetSession()) - itr->getSource()->GetSession()->SendLfgUpdateParty(updateData); - } - else - player->GetSession()->SendLfgUpdatePlayer(LfgUpdateData(LFG_UPDATETYPE_JOIN_QUEUE, dungeons, comment)); - - return; - } - else // Remove from queue and rejoin - { - LFGQueue& queue = GetQueue(gguid); - queue.RemoveFromQueue(gguid); - } + LFGQueue& queue = GetQueue(gguid); + queue.RemoveFromQueue(gguid); } // Check player or group member restrictions @@ -620,7 +598,8 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const bool isDungeon = false; for (LfgDungeonSet::const_iterator it = dungeons.begin(); it != dungeons.end() && joinData.result == LFG_JOIN_OK; ++it) { - switch (GetDungeonType(*it)) + LfgType type = GetDungeonType(*it); + switch (type) { case LFG_TYPE_RANDOM: if (dungeons.size() > 1) // Only allow 1 random dungeon @@ -640,6 +619,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const isRaid = true; break; default: + sLog->outError(LOG_FILTER_LFG, "Wrong dungeon type %u for dungeon %u", type, *it); joinData.result = LFG_JOIN_DUNGEON_INVALID; break; } @@ -719,8 +699,8 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const { LfgRolesMap rolesMap; rolesMap[guid] = roles; - LFGQueue& queue = GetQueue(gguid); - queue.AddQueueData(guid, time_t(time(NULL)), dungeons, rolesMap); + LFGQueue& queue = GetQueue(guid); + queue.AddQueueData(guid, time(NULL), dungeons, rolesMap); if (!isContinue) { @@ -758,7 +738,7 @@ void LFGMgr::LeaveLfg(uint64 guid) { sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::LeaveLfg: [" UI64FMTD "]", guid); - uint64 gguid = IS_GROUP(guid) ? guid : GetGroup(guid); + uint64 gguid = IS_GROUP_GUID(guid) ? guid : GetGroup(guid); LfgState state = GetState(guid); switch (state) { @@ -873,7 +853,7 @@ void LFGMgr::UpdateRoleCheck(uint64 gguid, uint64 guid /* = 0 */, uint8 roles /* { uint64 pguid = it->first; - if (!sendRoleChosen) + if (sendRoleChosen) SendLfgRoleChosen(pguid, guid, roles); SendLfgRoleCheckUpdate(pguid, roleCheck); @@ -916,7 +896,7 @@ void LFGMgr::UpdateRoleCheck(uint64 gguid, uint64 guid /* = 0 */, uint8 roles /* @param[in] players Set of players to check their dungeon restrictions @param[out] lockMap Map of players Lock status info of given dungeons (Empty if dungeons is not empty) */ -void LFGMgr::GetCompatibleDungeons(LfgDungeonSet& dungeons, const LfgGuidSet& players, LfgLockPartyMap& lockMap) +void LFGMgr::GetCompatibleDungeons(LfgDungeonSet& dungeons, LfgGuidSet const& players, LfgLockPartyMap& lockMap) { lockMap.clear(); for (LfgGuidSet::const_iterator it = players.begin(); it != players.end() && !dungeons.empty(); ++it) @@ -1083,9 +1063,10 @@ void LFGMgr::MakeNewGroup(LfgProposal const& proposal) grp->SendUpdate(); } -uint32 LFGMgr::AddProposal(LfgProposal const& proposal) +uint32 LFGMgr::AddProposal(LfgProposal& proposal) { - ProposalsStore[++m_lfgProposalId] = proposal; + proposal.id = ++m_lfgProposalId; + ProposalsStore[m_lfgProposalId] = proposal; return m_lfgProposalId; } @@ -1129,16 +1110,14 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept) if (!allAnswered) { for (LfgProposalPlayerContainer::const_iterator it = proposal.players.begin(); it != proposal.players.end(); ++it) - { - uint64 guid = it->first; - SendLfgUpdateProposal(guid, proposalId, proposal); - } + SendLfgUpdateProposal(it->first, proposal); + return; } bool sendUpdate = proposal.state != LFG_PROPOSAL_SUCCESS; proposal.state = LFG_PROPOSAL_SUCCESS; - time_t joinTime = time_t(time(NULL)); + time_t joinTime = time(NULL); LFGQueue& queue = GetQueue(guid); LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_GROUP_FOUND); @@ -1149,7 +1128,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept) uint32 dungeonId = (*GetSelectedDungeons(pguid).begin()); int32 waitTime = -1; if (sendUpdate) - SendLfgUpdateProposal(pguid, proposalId, proposal); + SendLfgUpdateProposal(pguid, proposal); if (gguid) { @@ -1236,7 +1215,7 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate uint64 guid = it->first; uint64 gguid = it->second.group ? it->second.group : guid; - SendLfgUpdateProposal(guid, itProposal->first, proposal); + SendLfgUpdateProposal(guid, proposal); if (toRemove.find(gguid) != toRemove.end()) // Didn't accept or in same group that someone that didn't accept { @@ -1465,106 +1444,126 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false* } } - if (error == LFG_TELEPORTERROR_OK) - { - if (!player->GetMap()->IsDungeon()) - player->SetBattlegroundEntryPoint(); - - if (player->isInFlight()) - { - player->GetMotionMaster()->MovementExpired(); - player->CleanupAfterTaxiFlight(); - } + if (!player->GetMap()->IsDungeon()) + player->SetBattlegroundEntryPoint(); - if (!player->TeleportTo(mapid, x, y, z, orientation)) - { - error = LFG_TELEPORTERROR_INVALID_LOCATION; - sLog->outError(LOG_FILTER_LFG, "TeleportPlayer: Failed to teleport [" UI64FMTD "] to map %u (x: %f, y: %f, z: %f)", player->GetGUID(), mapid, x, y, z); - } + if (player->isInFlight()) + { + player->GetMotionMaster()->MovementExpired(); + player->CleanupAfterTaxiFlight(); } + + if (!player->TeleportTo(mapid, x, y, z, orientation)) + error = LFG_TELEPORTERROR_INVALID_LOCATION; } + else + error = LFG_TELEPORTERROR_INVALID_LOCATION; if (error != LFG_TELEPORTERROR_OK) player->GetSession()->SendLfgTeleportError(uint8(error)); - sLog->outDebug(LOG_FILTER_LFG, "TeleportPlayer: Player %s is being teleported in. Result: %u", - player->GetName().c_str(), error); + sLog->outDebug(LOG_FILTER_LFG, "TeleportPlayer: Player %s is being teleported in to map %u " + "(x: %f, y: %f, z: %f) Result: %u", player->GetName().c_str(), dungeon->map, + dungeon->x, dungeon->y, dungeon->z, error); } /** - Give completion reward to player + Finish a dungeon and give reward, if any. - @param[in] dungeonId Id of the dungeon finished - @param[in] player Player to reward + @param[in] guid Group guid + @param[in] dungeonId Dungeonid */ -void LFGMgr::RewardDungeonDoneFor(const uint32 dungeonId, Player* player) +void LFGMgr::FinishDungeon(uint64 gguid, const uint32 dungeonId) { - Group* group = player->GetGroup(); - if (!group || !group->isLFGGroup()) - { - sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] is not in a group or not a LFGGroup. Ignoring", player->GetGUID()); - return; - } - - uint64 guid = player->GetGUID(); - uint64 gguid = player->GetGroup()->GetGUID(); uint32 gDungeonId = GetDungeon(gguid); if (gDungeonId != dungeonId) { - sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] Finished dungeon %u but group queued for %u. Ignoring", guid, dungeonId, gDungeonId); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::FinishDungeon: [" UI64FMTD "] Finished dungeon %u but group queued for %u. Ignoring", gguid, dungeonId, gDungeonId); return; } - if (GetState(guid) == LFG_STATE_FINISHED_DUNGEON) + if (GetState(gguid) == LFG_STATE_FINISHED_DUNGEON) // Shouldn't happen. Do not reward multiple times { - sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] Already rewarded player. Ignoring", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::FinishDungeon: [" UI64FMTD "] Already rewarded group. Ignoring", gguid); return; } - // Mark dungeon as finished SetState(gguid, LFG_STATE_FINISHED_DUNGEON); - // Clear player related lfg stuff - uint32 rDungeonId = (*GetSelectedDungeons(guid).begin()); - SetState(guid, LFG_STATE_FINISHED_DUNGEON); - - // Give rewards only if its a random or seasonal dungeon - LFGDungeonData const* dungeon = GetLFGDungeon(rDungeonId); - if (!dungeon || (dungeon->type != LFG_TYPE_RANDOM && !dungeon->seasonal)) + const LfgGuidSet& players = GetPlayers(gguid); + for (LfgGuidSet::const_iterator it = players.begin(); it != players.end(); ++it) { - sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] dungeon %u is not random nor seasonal", guid, rDungeonId); - return; - } + uint64 guid = (*it); + if (GetState(guid) == LFG_STATE_FINISHED_DUNGEON) + { + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::FinishDungeon: [" UI64FMTD "] Already rewarded player. Ignoring", guid); + continue; + } - // Update achievements - if (dungeon->difficulty == DUNGEON_DIFFICULTY_HEROIC) - player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS, 1); + uint32 rDungeonId = 0; + const LfgDungeonSet& dungeons = GetSelectedDungeons(guid); + if (!dungeons.empty()) + rDungeonId = (*dungeons.begin()); - LfgReward const* reward = GetRandomDungeonReward(rDungeonId, player->getLevel()); - if (!reward) - return; + SetState(guid, LFG_STATE_FINISHED_DUNGEON); - uint8 index = 0; - Quest const* qReward = sObjectMgr->GetQuestTemplate(reward->reward[index].questId); - if (!qReward) - return; + // Give rewards only if its a random dungeon + LFGDungeonData const* dungeon = GetLFGDungeon(rDungeonId); - // if we can take the quest, means that we haven't done this kind of "run", IE: First Heroic Random of Day. - if (player->CanRewardQuest(qReward, false)) - player->RewardQuest(qReward, 0, NULL, false); - else - { - index = 1; - qReward = sObjectMgr->GetQuestTemplate(reward->reward[index].questId); - if (!qReward) - return; - // we give reward without informing client (retail does this) - player->RewardQuest(qReward, 0, NULL, false); - } + if (!dungeon || (dungeon->type != LFG_TYPE_RANDOM && !dungeon->seasonal)) + { + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::FinishDungeon: [" UI64FMTD "] dungeon %u is not random or seasonal", guid, rDungeonId); + continue; + } + + Player* player = ObjectAccessor::FindPlayer(guid); + if (!player || !player->IsInWorld()) + { + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::FinishDungeon: [" UI64FMTD "] not found in world", guid); + continue; + } + + LFGDungeonData const* dungeonDone = GetLFGDungeon(dungeonId); + uint32 mapId = dungeonDone ? uint32(dungeonDone->map) : 0; - // Give rewards - sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] done dungeon %u, %s previously done.", player->GetGUID(), GetDungeon(gguid), index > 0 ? " " : " not"); - player->GetSession()->SendLfgPlayerReward(dungeon->Entry(), GetDungeon(gguid, false), index, reward, qReward); + if (player->GetMapId() != mapId) + { + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::FinishDungeon: [" UI64FMTD "] is in map %u and should be in %u to get reward", guid, player->GetMapId(), mapId); + continue; + } + + // Update achievements + if (dungeon->difficulty == DUNGEON_DIFFICULTY_HEROIC) + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS, 1); + + LfgReward const* reward = GetRandomDungeonReward(rDungeonId, player->getLevel()); + if (!reward) + continue; + + bool done = false; + Quest const* quest = sObjectMgr->GetQuestTemplate(reward->firstQuest); + if (!quest) + continue; + + // if we can take the quest, means that we haven't done this kind of "run", IE: First Heroic Random of Day. + if (player->CanRewardQuest(quest, false)) + player->RewardQuest(quest, 0, NULL, false); + else + { + done = true; + quest = sObjectMgr->GetQuestTemplate(reward->otherQuest); + if (!quest) + continue; + // we give reward without informing client (retail does this) + player->RewardQuest(quest, 0, NULL, false); + } + + // Give rewards + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::FinishDungeon: [" UI64FMTD "] done dungeon %u, %s previously done.", player->GetGUID(), GetDungeon(gguid), done? " " : " not"); + LfgPlayerRewardData data = LfgPlayerRewardData(dungeon->Entry(), GetDungeon(gguid, false), done, quest); + player->GetSession()->SendLfgPlayerReward(data); + } + SetDungeon(gguid, 0); } // --------------------------------------------------------------------------// @@ -1577,7 +1576,7 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 dungeonId, Player* player) @param[in] randomdungeon Random dungeon id (if value = 0 will return all dungeons) @returns Set of dungeons that can be done. */ -const LfgDungeonSet& LFGMgr::GetDungeonsByRandom(uint32 randomdungeon) +LfgDungeonSet const& LFGMgr::GetDungeonsByRandom(uint32 randomdungeon) { LFGDungeonData const* dungeon = GetLFGDungeon(randomdungeon); uint32 group = dungeon ? dungeon->group : 0; @@ -1624,7 +1623,7 @@ LfgType LFGMgr::GetDungeonType(uint32 dungeonId) LfgState LFGMgr::GetState(uint64 guid) { LfgState state; - if (IS_GROUP(guid)) + if (IS_GROUP_GUID(guid)) state = GroupsStore[guid].GetState(); else state = PlayersStore[guid].GetState(); @@ -1675,13 +1674,13 @@ bool LFGMgr::IsTeleported(uint64 pguid) return false; } -const LfgDungeonSet& LFGMgr::GetSelectedDungeons(uint64 guid) +LfgDungeonSet const& LFGMgr::GetSelectedDungeons(uint64 guid) { sLog->outTrace(LOG_FILTER_LFG, "LFGMgr::GetSelectedDungeons: [" UI64FMTD "]", guid); return PlayersStore[guid].GetSelectedDungeons(); } -const LfgLockMap& LFGMgr::GetLockedDungeons(uint64 guid) +LfgLockMap const& LFGMgr::GetLockedDungeons(uint64 guid) { sLog->outTrace(LOG_FILTER_LFG, "LFGMgr::GetLockedDungeons: [" UI64FMTD "]", guid); return PlayersStore[guid].GetLockedDungeons(); @@ -1696,7 +1695,7 @@ uint8 LFGMgr::GetKicksLeft(uint64 guid) void LFGMgr::RestoreState(uint64 guid, char const *debugMsg) { - if (IS_GROUP(guid)) + if (IS_GROUP_GUID(guid)) { LfgGroupData& data = GroupsStore[guid]; if (sLog->ShouldLog(LOG_FILTER_LFG, LOG_LEVEL_DEBUG)) @@ -1725,10 +1724,10 @@ void LFGMgr::RestoreState(uint64 guid, char const *debugMsg) void LFGMgr::SetState(uint64 guid, LfgState state) { - if (IS_GROUP(guid)) + if (IS_GROUP_GUID(guid)) { LfgGroupData& data = GroupsStore[guid]; - if (sLog->ShouldLog(LOG_FILTER_LFG, LOG_LEVEL_DEBUG)) + if (sLog->ShouldLog(LOG_FILTER_LFG, LOG_LEVEL_TRACE)) { std::string const& ns = GetStateString(state); std::string const& ps = GetStateString(data.GetState()); @@ -1741,7 +1740,7 @@ void LFGMgr::SetState(uint64 guid, LfgState state) else { LfgPlayerData& data = PlayersStore[guid]; - if (sLog->ShouldLog(LOG_FILTER_LFG, LOG_LEVEL_DEBUG)) + if (sLog->ShouldLog(LOG_FILTER_LFG, LOG_LEVEL_TRACE)) { std::string const& ns = GetStateString(state); std::string const& ps = GetStateString(data.GetState()); @@ -1765,19 +1764,19 @@ void LFGMgr::SetRoles(uint64 guid, uint8 roles) PlayersStore[guid].SetRoles(roles); } -void LFGMgr::SetComment(uint64 guid, const std::string& comment) +void LFGMgr::SetComment(uint64 guid, std::string const& comment) { sLog->outTrace(LOG_FILTER_LFG, "LFGMgr::SetComment: [" UI64FMTD "] comment: %s", guid, comment.c_str()); PlayersStore[guid].SetComment(comment); } -void LFGMgr::SetSelectedDungeons(uint64 guid, const LfgDungeonSet& dungeons) +void LFGMgr::SetSelectedDungeons(uint64 guid, LfgDungeonSet const& dungeons) { - sLog->outTrace(LOG_FILTER_LFG, "LFGMgr::SetSelectedDungeons: [" UI64FMTD "]", guid); + sLog->outTrace(LOG_FILTER_LFG, "LFGMgr::SetSelectedDungeons: [" UI64FMTD "] Dungeons: %s", guid, ConcatenateDungeons(dungeons).c_str()); PlayersStore[guid].SetSelectedDungeons(dungeons); } -void LFGMgr::SetLockedDungeons(uint64 guid, const LfgLockMap& lock) +void LFGMgr::SetLockedDungeons(uint64 guid, LfgLockMap const& lock) { sLog->outTrace(LOG_FILTER_LFG, "LFGMgr::SetLockedDungeons: [" UI64FMTD "]", guid); PlayersStore[guid].SetLockedDungeons(lock); @@ -1918,10 +1917,10 @@ void LFGMgr::SendLfgBootProposalUpdate(uint64 guid, LfgPlayerBoot const& boot) player->GetSession()->SendLfgBootProposalUpdate(boot); } -void LFGMgr::SendLfgUpdateProposal(uint64 guid, uint32 proposalId, LfgProposal const& proposal) +void LFGMgr::SendLfgUpdateProposal(uint64 guid, LfgProposal const& proposal) { if (Player* player = ObjectAccessor::FindPlayer(guid)) - player->GetSession()->SendLfgUpdateProposal(proposalId, proposal); + player->GetSession()->SendLfgUpdateProposal(proposal); } void LFGMgr::SendLfgQueueStatus(uint64 guid, LfgQueueStatusData const& data) @@ -1932,15 +1931,15 @@ void LFGMgr::SendLfgQueueStatus(uint64 guid, LfgQueueStatusData const& data) bool LFGMgr::IsLfgGroup(uint64 guid) { - return guid && IS_GROUP(guid) && GroupsStore[guid].IsLfgGroup(); + return guid && IS_GROUP_GUID(guid) && GroupsStore[guid].IsLfgGroup(); } LFGQueue& LFGMgr::GetQueue(uint64 guid) { uint8 queueId = 0; - if (IS_GROUP(guid)) + if (IS_GROUP_GUID(guid)) { - const LfgGuidSet& players = GetPlayers(guid); + LfgGuidSet const& players = GetPlayers(guid); uint64 pguid = players.empty() ? 0 : (*players.begin()); if (pguid) queueId = GetTeam(pguid); diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index 14bc0becb02..0a1b90ee04d 100644 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -28,6 +28,7 @@ class Group; class Player; +class Quest; enum LfgOptions { @@ -37,9 +38,9 @@ enum LfgOptions enum LFGMgrEnum { - LFG_TIME_ROLECHECK = 40 * IN_MILLISECONDS, + LFG_TIME_ROLECHECK = 45 * IN_MILLISECONDS, LFG_TIME_BOOT = 120, - LFG_TIME_PROPOSAL = 120, + LFG_TIME_PROPOSAL = 45, LFG_QUEUEUPDATE_INTERVAL = 15 * IN_MILLISECONDS, LFG_SPELL_DUNGEON_COOLDOWN = 71328, LFG_SPELL_DUNGEON_DESERTER = 71041, @@ -188,27 +189,25 @@ struct LfgQueueStatusData uint8 dps; }; +struct LfgPlayerRewardData +{ + LfgPlayerRewardData(uint32 random, uint32 current, bool _done, Quest const* _quest): + rdungeonEntry(random), sdungeonEntry(current), done(_done), quest(_quest) { } + uint32 rdungeonEntry; + uint32 sdungeonEntry; + bool done; + Quest const* quest; +}; + /// Reward info struct LfgReward { + LfgReward(uint32 _maxLevel = 0, uint32 _firstQuest = 0, uint32 _otherQuest = 0): + maxLevel(_maxLevel), firstQuest(_firstQuest), otherQuest(_otherQuest) { } + uint32 maxLevel; - struct - { - uint32 questId; - uint32 variableMoney; - uint32 variableXP; - } reward[2]; - - LfgReward(uint32 _maxLevel = 0, uint32 firstQuest = 0, uint32 firstVarMoney = 0, uint32 firstVarXp = 0, uint32 otherQuest = 0, uint32 otherVarMoney = 0, uint32 otherVarXp = 0) - : maxLevel(_maxLevel) - { - reward[0].questId = firstQuest; - reward[0].variableMoney = firstVarMoney; - reward[0].variableXP = firstVarXp; - reward[1].questId = otherQuest; - reward[1].variableMoney = otherVarMoney; - reward[1].variableXP = otherVarXp; - } + uint32 firstQuest; + uint32 otherQuest; }; /// Stores player data related to proposal to join @@ -223,10 +222,11 @@ struct LfgProposalPlayer /// Stores group data related to proposal to join struct LfgProposal { - LfgProposal(uint32 dungeon = 0): dungeonId(dungeon), state(LFG_PROPOSAL_INITIATING), + LfgProposal(uint32 dungeon = 0): id(0), dungeonId(dungeon), state(LFG_PROPOSAL_INITIATING), group(0), leader(0), cancelTime(0), encounters(0), isNew(true) { } + uint32 id; ///< Proposal Id uint32 dungeonId; ///< Dungeon to join LfgProposalState state; ///< State of the proposal uint64 group; ///< Proposal group (0 if new) @@ -235,7 +235,8 @@ struct LfgProposal uint32 encounters; ///< Dungeon Encounters bool isNew; ///< Determines if it's new group or not LfgGuidList queues; ///< Queue Ids to remove/readd - LfgProposalPlayerContainer players; ///< Players data + LfgGuidList showorder; ///< Show order in update window + LfgProposalPlayerContainer players; ///< Players data }; /// Stores all rolecheck info of a group that wants to join @@ -299,7 +300,7 @@ class LFGMgr // Reward void LoadRewards(); - void RewardDungeonDoneFor(uint32 const dungeonId, Player* player); + void FinishDungeon(uint64 gguid, uint32 dungeonId); LfgReward const* GetRandomDungeonReward(uint32 dungeon, uint8 level); // Queue @@ -314,7 +315,7 @@ class LFGMgr void GetCompatibleDungeons(LfgDungeonSet& dungeons, LfgGuidSet const& players, LfgLockPartyMap& lockMap); // Proposals - uint32 AddProposal(LfgProposal const& proposal); + uint32 AddProposal(LfgProposal& proposal); void UpdateProposal(uint32 proposalId, uint64 guid, bool accept); // Teleportation @@ -403,7 +404,7 @@ class LFGMgr void SendLfgRoleCheckUpdate(uint64 guid, LfgRoleCheck const& roleCheck); void SendLfgUpdateParty(uint64 guid, LfgUpdateData const& data); void SendLfgUpdatePlayer(uint64 guid, LfgUpdateData const& data); - void SendLfgUpdateProposal(uint64 guid, uint32 proposalId, LfgProposal const& proposal); + void SendLfgUpdateProposal(uint64 guid, LfgProposal const& proposal); // General variables uint32 m_QueueTimer; ///< used to check interval of update diff --git a/src/server/game/DungeonFinding/LFGPlayerData.cpp b/src/server/game/DungeonFinding/LFGPlayerData.cpp index deee0ddae3c..410076f7e75 100644 --- a/src/server/game/DungeonFinding/LFGPlayerData.cpp +++ b/src/server/game/DungeonFinding/LFGPlayerData.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -113,12 +113,12 @@ uint8 LfgPlayerData::GetRoles() const return m_Roles; } -const std::string& LfgPlayerData::GetComment() const +std::string const& LfgPlayerData::GetComment() const { return m_Comment; } -const LfgDungeonSet& LfgPlayerData::GetSelectedDungeons() const +LfgDungeonSet const& LfgPlayerData::GetSelectedDungeons() const { return m_SelectedDungeons; } diff --git a/src/server/game/DungeonFinding/LFGPlayerData.h b/src/server/game/DungeonFinding/LFGPlayerData.h index 589404cf65c..055924fd364 100644 --- a/src/server/game/DungeonFinding/LFGPlayerData.h +++ b/src/server/game/DungeonFinding/LFGPlayerData.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/DungeonFinding/LFGQueue.cpp b/src/server/game/DungeonFinding/LFGQueue.cpp index bfcf17dc270..e75a1bdc4b3 100644 --- a/src/server/game/DungeonFinding/LFGQueue.cpp +++ b/src/server/game/DungeonFinding/LFGQueue.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -139,7 +139,7 @@ void LFGQueue::RemoveFromCurrentQueue(uint64 guid) currentQueueStore.remove(guid); } -void LFGQueue::AddQueueData(uint64 guid, time_t joinTime, const LfgDungeonSet &dungeons, const LfgRolesMap &rolesMap) +void LFGQueue::AddQueueData(uint64 guid, time_t joinTime, LfgDungeonSet const& dungeons, LfgRolesMap const& rolesMap) { QueueDataStore[guid] = LfgQueueData(joinTime, dungeons, rolesMap); AddToQueue(guid); @@ -217,7 +217,6 @@ void LFGQueue::SetCompatibilityData(std::string const& key, LfgCompatibilityData CompatibleMapStore[key] = data; } - /** Get the compatibility of a group of guids @@ -358,7 +357,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check) // Store group so we don't need to call Mgr to get it later (if it's player group will be 0 otherwise would have joined as group) for (LfgRolesMap::const_iterator it2 = itQueue->second.roles.begin(); it2 != itQueue->second.roles.end(); ++it2) - proposalGroups[it2->first] = IS_GROUP(itQueue->first) ? itQueue->first : 0; + proposalGroups[it2->first] = IS_GROUP_GUID(itQueue->first) ? itQueue->first : 0; numPlayers += itQueue->second.roles.size(); @@ -482,8 +481,9 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check) return LFG_COMPATIBLES_WITH_LESS_PLAYERS; } + uint64 gguid = *check.begin(); proposal.queues = check; - proposal.isNew = numLfgGroups != 1; + proposal.isNew = numLfgGroups != 1 || !sLFGMgr->GetDungeon(gguid); if (!sLFGMgr->AllQueued(check)) { @@ -601,7 +601,7 @@ std::string LFGQueue::DumpQueueInfo() const for (LfgGuidList::const_iterator it = queue.begin(); it != queue.end(); ++it) { uint64 guid = *it; - if (IS_GROUP(guid)) + if (IS_GROUP_GUID(guid)) { groups++; playersInGroup += sLFGMgr->GetPlayerCount(guid); diff --git a/src/server/game/DungeonFinding/LFGQueue.h b/src/server/game/DungeonFinding/LFGQueue.h index e6ba038a9e6..acb78d2c0f2 100644 --- a/src/server/game/DungeonFinding/LFGQueue.h +++ b/src/server/game/DungeonFinding/LFGQueue.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -52,7 +52,7 @@ struct LfgQueueData healers(LFG_HEALERS_NEEDED), dps(LFG_DPS_NEEDED) { } - LfgQueueData(time_t _joinTime, const LfgDungeonSet &_dungeons, LfgRolesMap const& _roles): + LfgQueueData(time_t _joinTime, LfgDungeonSet const& _dungeons, LfgRolesMap const& _roles): joinTime(_joinTime), tanks(LFG_TANKS_NEEDED), healers(LFG_HEALERS_NEEDED), dps(LFG_DPS_NEEDED), dungeons(_dungeons), roles(_roles) { } @@ -87,7 +87,7 @@ class LFGQueue // Add/Remove from queue void AddToQueue(uint64 guid); void RemoveFromQueue(uint64 guid); - void AddQueueData(uint64 guid, time_t joinTime, const LfgDungeonSet &dungeons, const LfgRolesMap &rolesMap); + void AddQueueData(uint64 guid, time_t joinTime, LfgDungeonSet const& dungeons, LfgRolesMap const& rolesMap); void RemoveQueueData(uint64 guid); // Update Timers (when proposal success) diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp index 32dc8319215..568b61eef2f 100644 --- a/src/server/game/DungeonFinding/LFGScripts.cpp +++ b/src/server/game/DungeonFinding/LFGScripts.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -107,20 +107,10 @@ void LFGGroupScript::OnAddMember(Group* group, uint64 guid) LfgState gstate = sLFGMgr->GetState(gguid); LfgState state = sLFGMgr->GetState(guid); sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "] leader " UI64FMTD "] gstate: %u, state: %u", gguid, guid, leader, gstate, state); - LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_UPDATE_STATUS); - for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) - { - if (Player* plrg = itr->getSource()) - { - plrg->GetSession()->SendLfgUpdatePlayer(updateData); - plrg->GetSession()->SendLfgUpdateParty(updateData); - } - } if (state == LFG_STATE_QUEUED) sLFGMgr->LeaveLfg(guid); - // TODO - if group is queued and new player is added convert to rolecheck without notify the current players queued if (gstate == LFG_STATE_QUEUED) sLFGMgr->LeaveLfg(gguid); } diff --git a/src/server/game/DungeonFinding/LFGScripts.h b/src/server/game/DungeonFinding/LFGScripts.h index ac1f66abbda..227543e1899 100644 --- a/src/server/game/DungeonFinding/LFGScripts.h +++ b/src/server/game/DungeonFinding/LFGScripts.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp index 9f3b416d0f6..3f1b6b58d94 100644 --- a/src/server/game/Entities/Corpse/Corpse.cpp +++ b/src/server/game/Entities/Corpse/Corpse.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Corpse/Corpse.h b/src/server/game/Entities/Corpse/Corpse.h index afac900df32..30b15108cf2 100644 --- a/src/server/game/Entities/Corpse/Corpse.h +++ b/src/server/game/Entities/Corpse/Corpse.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 911ccd25728..5b3969c9b9d 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -411,6 +411,16 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data) SetPvP(false); } + // updates spell bars for vehicles and set player's faction - should be called here, to overwrite faction that is set from the new template + if (IsVehicle()) + { + if (Player* owner = Creature::GetCharmerOrOwnerPlayerOrPlayerItself()) // this check comes in case we don't have a player + { + setFaction(owner->getFaction()); // vehicles should have same as owner faction + owner->VehicleSpellInitialize(); + } + } + // trigger creature is always not selectable and can not be attacked if (isTrigger()) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -423,27 +433,26 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data) ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true); } - //! 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. + // Set the movement flags if the creature is in that mode. (Only fly if actually in air, only swim if in water, etc) + float ground = GetPositionZ(); + GetMap()->GetWaterOrGroundLevel(GetPositionX(), GetPositionY(), GetPositionZ(), &ground); - else if (GetByteValue(UNIT_FIELD_BYTES_1, 3) & UNIT_BYTE_1_FLAG_HOVER) - SetHover(true); + bool isInAir = G3D::fuzzyGt(GetPositionZ(), ground + 0.05f) || G3D::fuzzyLt(GetPositionZ(), ground - 0.05f); // Can be underground too, prevent the falling - */ + if (cInfo->InhabitType & INHABIT_AIR && cInfo->InhabitType & INHABIT_GROUND && isInAir) + SetCanFly(true); + else if (cInfo->InhabitType & INHABIT_AIR && isInAir) + SetDisableGravity(true); + else + { + SetCanFly(false); + SetDisableGravity(false); + } - // TODO: Shouldn't we check whether or not the creature is in water first? - if (cInfo->InhabitType & INHABIT_WATER) - AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); + if (cInfo->InhabitType & INHABIT_WATER && IsInWater()) + AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); + else + RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING); return true; } @@ -469,6 +478,23 @@ void Creature::Update(uint32 diff) RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING); } + // Set the movement flags if the creature is in that mode. (Only fly if actually in air, only swim if in water, etc) + float ground = GetPositionZ(); + GetMap()->GetWaterOrGroundLevel(GetPositionX(), GetPositionY(), GetPositionZ(), &ground); + + bool isInAir = G3D::fuzzyGt(GetPositionZ(), ground + 0.05f) || G3D::fuzzyLt(GetPositionZ(), ground - 0.05f); // Can be underground too, prevent the falling + CreatureTemplate const* cinfo = GetCreatureTemplate(); + + if (cinfo->InhabitType & INHABIT_AIR && cinfo->InhabitType & INHABIT_GROUND && isInAir) + SetCanFly(true); + else if (cinfo->InhabitType & INHABIT_AIR && isInAir) + SetDisableGravity(true); + else + { + SetCanFly(false); + SetDisableGravity(false); + } + switch (m_deathState) { case JUST_RESPAWNED: @@ -882,7 +908,7 @@ bool Creature::isCanTrainingOf(Player* player, bool msg) const if (msg) { player->PlayerTalkClass->ClearMenus(); - switch (GetCreatureTemplate()->trainer_class) + switch (GetCreatureTemplate()->trainer_race) { case RACE_DWARF: player->PlayerTalkClass->SendGossipMenu(5865, GetGUID()); break; case RACE_GNOME: player->PlayerTalkClass->SendGossipMenu(4881, GetGUID()); break; @@ -1543,12 +1569,28 @@ void Creature::setDeathState(DeathState s) ResetPlayerDamageReq(); CreatureTemplate const* cinfo = GetCreatureTemplate(); SetWalk(true); - if (cinfo->InhabitType & INHABIT_AIR && cinfo->InhabitType & INHABIT_GROUND) + + // Set the movement flags if the creature is in that mode. (Only fly if actually in air, only swim if in water, etc) + float ground = GetPositionZ(); + GetMap()->GetWaterOrGroundLevel(GetPositionX(), GetPositionY(), GetPositionZ(), &ground); + + bool isInAir = G3D::fuzzyGt(GetPositionZ(), ground + 0.05f) || G3D::fuzzyLt(GetPositionZ(), ground - 0.05f); // Can be underground too, prevent the falling + + if (cinfo->InhabitType & INHABIT_AIR && cinfo->InhabitType & INHABIT_GROUND && isInAir) SetCanFly(true); - else if (cinfo->InhabitType & INHABIT_AIR) + else if (cinfo->InhabitType & INHABIT_AIR && isInAir) SetDisableGravity(true); - if (cinfo->InhabitType & INHABIT_WATER) + else + { + SetCanFly(false); + SetDisableGravity(false); + } + + if (cinfo->InhabitType & INHABIT_WATER && IsInWater()) AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); + else + RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING); + SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); ClearUnitState(uint32(UNIT_STATE_ALL_STATE)); SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool)); @@ -2515,3 +2557,69 @@ bool Creature::SetHover(bool enable) SendMessageToSet(&data, false); return true; } + +float Creature::GetAggroRange(Unit const* target) const +{ + // Determines the aggro range for creatures (usually pets), used mainly for aggressive pet target selection. + // Based on data from wowwiki due to lack of 3.3.5a data + + if (target && this->isPet()) + { + uint32 targetLevel = 0; + + if (target->GetTypeId() == TYPEID_PLAYER) + targetLevel = target->getLevelForTarget(this); + else if (target->GetTypeId() == TYPEID_UNIT) + targetLevel = target->ToCreature()->getLevelForTarget(this); + + uint32 myLevel = getLevelForTarget(target); + int32 levelDiff = int32(targetLevel) - int32(myLevel); + + // The maximum Aggro Radius is capped at 45 yards (25 level difference) + if (levelDiff < -25) + levelDiff = -25; + + // The base aggro radius for mob of same level + float aggroRadius = 20; + + // Aggro Radius varies with level difference at a rate of roughly 1 yard/level + aggroRadius -= (float)levelDiff; + + // detect range auras + aggroRadius += GetTotalAuraModifier(SPELL_AURA_MOD_DETECT_RANGE); + + // detected range auras + aggroRadius += target->GetTotalAuraModifier(SPELL_AURA_MOD_DETECTED_RANGE); + + // Just in case, we don't want pets running all over the map + if (aggroRadius > MAX_AGGRO_RADIUS) + aggroRadius = MAX_AGGRO_RADIUS; + + // Minimum Aggro Radius for a mob seems to be combat range (5 yards) + // hunter pets seem to ignore minimum aggro radius so we'll default it a little higher + if (aggroRadius < 10) + aggroRadius = 10; + + return (aggroRadius); + } + + // Default + return 0.0f; +} + +Unit* Creature::SelectNearestHostileUnitInAggroRange(bool useLOS) const +{ + // Selects nearest hostile target within creature's aggro range. Used primarily by + // pets set to aggressive. Will not return neutral or friendly targets. + + Unit* target = NULL; + + { + Trinity::NearestHostileUnitInAggroRangeCheck u_check(this, useLOS); + Trinity::UnitSearcher<Trinity::NearestHostileUnitInAggroRangeCheck> searcher(this, target, u_check); + + VisitNearbyGridObject(MAX_AGGRO_RADIUS, searcher); + } + + return target; +} diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index f9b682383f1..efc4e44798f 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -64,13 +64,6 @@ enum CreatureFlagsExtra CREATURE_FLAG_EXTRA_NO_SKILLGAIN | CREATURE_FLAG_EXTRA_TAUNT_DIMINISH | CREATURE_FLAG_EXTRA_ALL_DIMINISH | \ CREATURE_FLAG_EXTRA_GUARD) -// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform -#if defined(__GNUC__) -#pragma pack(1) -#else -#pragma pack(push, 1) -#endif - #define MAX_KILL_CREDIT 2 #define CREATURE_REGEN_INTERVAL 2 * IN_MILLISECONDS @@ -180,6 +173,13 @@ typedef UNORDERED_MAP<uint32, CreatureTemplate> CreatureTemplateContainer; // TODO: Add MAX_EXPANSION constant. #define MAX_CREATURE_BASE_HP 3 +// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform +#if defined(__GNUC__) +#pragma pack(1) +#else +#pragma pack(push, 1) +#endif + // Defines base stats for creatures (used to calculate HP/mana/armor). struct CreatureBaseStats { @@ -241,7 +241,7 @@ typedef UNORDERED_MAP<uint16, EquipmentInfo> EquipmentInfoContainer; // from `creature` table struct CreatureData { - explicit CreatureData() : dbData(true) {} + CreatureData() : dbData(true) {} uint32 id; // entry in creature_template uint16 mapid; uint16 phaseMask; @@ -264,19 +264,6 @@ struct CreatureData bool dbData; }; -// `creature_addon` table -struct CreatureAddon -{ - uint32 path_id; - uint32 mount; - uint32 bytes1; - uint32 bytes2; - uint32 emote; - std::vector<uint32> auras; -}; - -typedef UNORDERED_MAP<uint32, CreatureAddon> CreatureAddonContainer; - struct CreatureModelInfo { float bounding_radius; @@ -316,6 +303,19 @@ enum ChatType #pragma pack(pop) #endif +// `creature_addon` table +struct CreatureAddon +{ + uint32 path_id; + uint32 mount; + uint32 bytes1; + uint32 bytes2; + uint32 emote; + std::vector<uint32> auras; +}; + +typedef UNORDERED_MAP<uint32, CreatureAddon> CreatureAddonContainer; + // Vendors struct VendorItem { @@ -621,12 +621,14 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature bool canStartAttack(Unit const* u, bool force) const; float GetAttackDistance(Unit const* player) const; + float GetAggroRange(Unit const* target) const; void SendAIReaction(AiReaction reactionType); Unit* SelectNearestTarget(float dist = 0) const; Unit* SelectNearestTargetInAttackDistance(float dist = 0) const; Player* SelectNearestPlayer(float distance = 0) const; + Unit* SelectNearestHostileUnitInAggroRange(bool useLOS = false) const; void DoFleeToGetAssistance(); void CallForHelp(float fRadius); diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index c9d1944af09..7930044d45a 100644 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Creature/CreatureGroups.h b/src/server/game/Entities/Creature/CreatureGroups.h index e5b8771ee40..fb5b823fbe9 100644 --- a/src/server/game/Entities/Creature/CreatureGroups.h +++ b/src/server/game/Entities/Creature/CreatureGroups.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 17a8711379a..f5877a3b927 100644 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Creature/GossipDef.h b/src/server/game/Entities/Creature/GossipDef.h index 15766bbcd59..6c5f465bbf0 100644 --- a/src/server/game/Entities/Creature/GossipDef.h +++ b/src/server/game/Entities/Creature/GossipDef.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp index a6b51a4d395..2f691f68c99 100644 --- a/src/server/game/Entities/Creature/TemporarySummon.cpp +++ b/src/server/game/Entities/Creature/TemporarySummon.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Creature/TemporarySummon.h b/src/server/game/Entities/Creature/TemporarySummon.h index b60197ff613..a96d9ab33d0 100644 --- a/src/server/game/Entities/Creature/TemporarySummon.h +++ b/src/server/game/Entities/Creature/TemporarySummon.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp index cd4a9443867..059bc22e35d 100644 --- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp +++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.h b/src/server/game/Entities/DynamicObject/DynamicObject.h index 68da99ac668..0522bc67aff 100644 --- a/src/server/game/Entities/DynamicObject/DynamicObject.h +++ b/src/server/game/Entities/DynamicObject/DynamicObject.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index f72e36e2d30..bf0fbb4199d 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -270,7 +270,7 @@ void GameObject::Update(uint32 diff) } else AI()->UpdateAI(diff); - if (IS_MO_TRANSPORT(GetGUID())) + if (IS_MO_TRANSPORT_GUID(GetGUID())) { //((Transport*)this)->Update(p_time); return; @@ -1098,11 +1098,7 @@ void GameObject::Use(Unit* user) case GAMEOBJECT_TYPE_BUTTON: //1 //doors/buttons never really despawn, only reset to default state/flags UseDoorOrButton(0, false, user); - - // activate script - GetMap()->ScriptsStart(sGameObjectScripts, GetDBTableGUIDLow(), spellCaster, this); return; - case GAMEOBJECT_TYPE_QUESTGIVER: //2 { if (user->GetTypeId() != TYPEID_PLAYER) diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 32d73579f51..7b1ccbc9015 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -28,13 +28,6 @@ class GameObjectAI; -// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform -#if defined(__GNUC__) -#pragma pack(1) -#else -#pragma pack(push, 1) -#endif - #define MAX_GAMEOBJECT_QUEST_ITEMS 6 // from `gameobject_template` @@ -549,13 +542,6 @@ union GameObjectValue } Building; }; -// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform -#if defined(__GNUC__) -#pragma pack() -#else -#pragma pack(pop) -#endif - struct GameObjectLocale { StringVector Name; diff --git a/src/server/game/Entities/Item/Container/Bag.cpp b/src/server/game/Entities/Item/Container/Bag.cpp index 73b38c1da83..c04490bb235 100644 --- a/src/server/game/Entities/Item/Container/Bag.cpp +++ b/src/server/game/Entities/Item/Container/Bag.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Item/Container/Bag.h b/src/server/game/Entities/Item/Container/Bag.h index 5a533d9cf57..259d22d1682 100644 --- a/src/server/game/Entities/Item/Container/Bag.h +++ b/src/server/game/Entities/Item/Container/Bag.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index bdaf11ad9b8..5dd726044ee 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -378,6 +378,10 @@ void Item::SaveToDB(SQLTransaction& trans) if (!isInTransaction) CharacterDatabase.CommitTransaction(trans); + // Delete the items if this is a container + if (!loot.isLooted()) + ItemContainerDeleteLootMoneyAndLootItemsFromDB(); + delete this; return; } @@ -483,6 +487,10 @@ void Item::DeleteFromDB(SQLTransaction& trans, uint32 itemGuid) void Item::DeleteFromDB(SQLTransaction& trans) { DeleteFromDB(trans, GetGUIDLow()); + + // Delete the items if this is a container + if (!loot.isLooted()) + ItemContainerDeleteLootMoneyAndLootItemsFromDB(); } /*static*/ @@ -1198,3 +1206,183 @@ bool Item::CheckSoulboundTradeExpire() return false; } + +void Item::ItemContainerSaveLootToDB() +{ + // Saves the money and item loot associated with an openable item to the DB + if (loot.isLooted()) // no money and no loot + return; + + uint32 container_id = GetGUIDLow(); + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + + loot.containerID = container_id; // Save this for when a LootItem is removed + + // Save money + if (loot.gold > 0) + { + PreparedStatement* stmt_money = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY); + stmt_money->setUInt32(0, container_id); + trans->Append(stmt_money); + + stmt_money = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEMCONTAINER_MONEY); + stmt_money->setUInt32(0, container_id); + stmt_money->setUInt32(1, loot.gold); + trans->Append(stmt_money); + } + + // Save items + if (!loot.isLooted()) + { + PreparedStatement* stmt_items = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS); + stmt_items->setUInt32(0, container_id); + trans->Append(stmt_items); + + // Now insert the items + for (LootItemList::const_iterator _li = loot.items.begin(); _li != loot.items.end(); _li++) + { + // When an item is looted, it doesn't get removed from the items collection + // but we don't want to resave it. + if (!_li->canSave) + continue; + + stmt_items = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEMCONTAINER_ITEMS); + + // container_id, item_id, item_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_prop, rnd_suffix + stmt_items->setUInt32(0, container_id); + stmt_items->setUInt32(1, _li->itemid); + stmt_items->setUInt32(2, _li->count); + stmt_items->setBool(3, _li->follow_loot_rules); + stmt_items->setBool(4, _li->freeforall); + stmt_items->setBool(5, _li->is_blocked); + stmt_items->setBool(6, _li->is_counted); + stmt_items->setBool(7, _li->is_underthreshold); + stmt_items->setBool(8, _li->needs_quest); + stmt_items->setUInt32(9, _li->randomPropertyId); + stmt_items->setUInt32(10, _li->randomSuffix); + trans->Append(stmt_items); + } + } + + CharacterDatabase.CommitTransaction(trans); +} + +bool Item::ItemContainerLoadLootFromDB() +{ + // Loads the money and item loot associated with an openable item from the DB + // Default. If there are no records for this item then it will be rolled for in Player::SendLoot() + m_lootGenerated = false; + + uint32 container_id = GetGUIDLow(); + + // Save this for later use + loot.containerID = container_id; + + // First, see if there was any money loot. This gets added directly to the container. + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEMCONTAINER_MONEY); + stmt->setUInt32(0, container_id); + PreparedQueryResult money_result = CharacterDatabase.Query(stmt); + + if (money_result) + { + Field* fields = money_result->Fetch(); + loot.gold = fields[0].GetUInt32(); + } + + // Next, load any items that were saved + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEMCONTAINER_ITEMS); + stmt->setUInt32(0, container_id); + PreparedQueryResult item_result = CharacterDatabase.Query(stmt); + + if (item_result) + { + // Get a LootTemplate for the container item. This is where + // the saved loot was originally rolled from, we will copy conditions from it + LootTemplate const* lt = LootTemplates_Item.GetLootFor(GetEntry()); + if (lt) + { + do + { + // Create an empty LootItem + LootItem loot_item = LootItem(); + + // Fill in the rest of the LootItem from the DB + Field* fields = item_result->Fetch(); + + // item_id, itm_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_prop, rnd_suffix + loot_item.itemid = fields[0].GetUInt32(); + loot_item.count = fields[1].GetUInt32(); + loot_item.follow_loot_rules = fields[2].GetBool(); + loot_item.freeforall = fields[3].GetBool(); + loot_item.is_blocked = fields[4].GetBool(); + loot_item.is_counted = fields[5].GetBool(); + loot_item.canSave = true; + loot_item.is_underthreshold = fields[6].GetBool(); + loot_item.needs_quest = fields[7].GetBool(); + loot_item.randomPropertyId = fields[8].GetUInt32(); + loot_item.randomSuffix = fields[9].GetUInt32(); + + // Copy the extra loot conditions from the item in the loot template + lt->CopyConditions(&loot_item); + + // If container item is in a bag, add that player as an allowed looter + if (GetBagSlot()) + loot_item.allowedGUIDs.insert(GetOwner()->GetGUIDLow()); + + // Finally add the LootItem to the container + loot.items.push_back(loot_item); + + // Increment unlooted count + loot.unlootedCount++; + + } + while (item_result->NextRow()); + } + } + + // Mark the item if it has loot so it won't be generated again on open + m_lootGenerated = !loot.isLooted(); + + return m_lootGenerated; +} + +void Item::ItemContainerDeleteLootItemsFromDB() +{ + // Deletes items associated with an openable item from the DB + uint32 containerId = GetGUIDLow(); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS); + stmt->setUInt32(0, containerId); + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); +} + +void Item::ItemContainerDeleteLootItemFromDB(uint32 itemID) +{ + // Deletes a single item associated with an openable item from the DB + uint32 containerId = GetGUIDLow(); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEM); + stmt->setUInt32(0, containerId); + stmt->setUInt32(1, itemID); + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); +} + +void Item::ItemContainerDeleteLootMoneyFromDB() +{ + // Deletes the money loot associated with an openable item from the DB + uint32 containerId = GetGUIDLow(); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY); + stmt->setUInt32(0, containerId); + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); +} + +void Item::ItemContainerDeleteLootMoneyAndLootItemsFromDB() +{ + // Deletes money and items associated with an openable item from the DB + ItemContainerDeleteLootMoneyFromDB(); + ItemContainerDeleteLootItemsFromDB(); +} diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index a5f9ed5c008..2f5ba02739d 100644 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -231,6 +231,15 @@ class Item : public Object static void DeleteFromDB(SQLTransaction& trans, uint32 itemGuid); virtual void DeleteFromDB(SQLTransaction& trans); static void DeleteFromInventoryDB(SQLTransaction& trans, uint32 itemGuid); + + // Lootable items and their contents + void ItemContainerSaveLootToDB(); + bool ItemContainerLoadLootFromDB(); + void ItemContainerDeleteLootItemsFromDB(); + void ItemContainerDeleteLootItemFromDB(uint32 itemID); + void ItemContainerDeleteLootMoneyFromDB(); + void ItemContainerDeleteLootMoneyAndLootItemsFromDB(); + void DeleteFromInventoryDB(SQLTransaction& trans); void SaveRefundDataToDB(); void DeleteRefundDataFromDB(SQLTransaction* trans); diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp index cfb8c880479..2b887672ec4 100644 --- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp +++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.h b/src/server/game/Entities/Item/ItemEnchantmentMgr.h index fe4dca40d24..c55537426db 100644 --- a/src/server/game/Entities/Item/ItemEnchantmentMgr.h +++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index f2f41d6a8b9..f68923706ff 100644 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -578,6 +578,13 @@ struct _Socket uint32 Content; }; +// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform +#if defined(__GNUC__) +#pragma pack() +#else +#pragma pack(pop) +#endif + #define MAX_ITEM_PROTO_DAMAGES 2 // changed in 3.1.0 #define MAX_ITEM_PROTO_SOCKETS 3 #define MAX_ITEM_PROTO_SPELLS 5 @@ -589,7 +596,7 @@ struct ItemTemplate uint32 Class; // id from ItemClass.dbc uint32 SubClass; // id from ItemSubClass.dbc int32 SoundOverrideSubclass; // < 0: id from ItemSubClass.dbc, used to override weapon sound from actual SubClass - std::string Name1; + std::string Name1; uint32 DisplayInfoID; // id from ItemDisplayInfo.dbc uint32 Quality; uint32 Flags; @@ -761,10 +768,4 @@ struct ItemSetNameLocale StringVector Name; }; -// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform -#if defined(__GNUC__) -#pragma pack() -#else -#pragma pack(pop) -#endif #endif diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 7818cdc6942..1cd36aec78f 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -302,6 +302,19 @@ void Object::DestroyForPlayer(Player* target, bool onDeath) const { ASSERT(target); + if (isType(TYPEMASK_UNIT) || isType(TYPEMASK_PLAYER)) + { + if (Battleground* bg = target->GetBattleground()) + { + if (bg->isArena()) + { + WorldPacket data(SMSG_ARENA_UNIT_DESTROYED, 8); + data << uint64(GetGUID()); + target->GetSession()->SendPacket(&data); + } + } + } + WorldPacket data(SMSG_DESTROY_OBJECT, 8 + 1); data << uint64(GetGUID()); //! If the following bool is true, the client will call "void CGUnit_C::OnDeath()" for this object. @@ -2254,6 +2267,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert mask = UNIT_MASK_GUARDIAN; break; case SUMMON_TYPE_TOTEM: + case SUMMON_TYPE_LIGHTWELL: mask = UNIT_MASK_TOTEM; break; case SUMMON_TYPE_VEHICLE: @@ -2336,12 +2350,7 @@ void WorldObject::SetZoneScript() if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())) m_zoneScript = bf; else - { - if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())) - m_zoneScript = bf; - else - m_zoneScript = sOutdoorPvPMgr->GetZoneScript(GetZoneId()); - } + m_zoneScript = sOutdoorPvPMgr->GetZoneScript(GetZoneId()); } } } @@ -2371,6 +2380,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float sLog->outError(LOG_FILTER_SQL, "Gameobject template %u not found in database!", entry); return NULL; } + Map* map = GetMap(); GameObject* go = new GameObject(); if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, map, GetPhaseMask(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY)) @@ -2378,13 +2388,14 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float delete go; return NULL; } + go->SetRespawnTime(respawnTime); if (GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT) //not sure how to handle this - ((Unit*)this)->AddGameObject(go); + ToUnit()->AddGameObject(go); else go->SetSpawnedByDefault(false); - map->AddToMap(go); + map->AddToMap(go); return go; } diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 0bb4214de32..a9afd074c67 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Object/ObjectDefines.h b/src/server/game/Entities/Object/ObjectDefines.h index 03fa44da08a..d0b9819b0a3 100644 --- a/src/server/game/Entities/Object/ObjectDefines.h +++ b/src/server/game/Entities/Object/ObjectDefines.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -21,64 +21,195 @@ #include "Define.h" -// used for creating values for respawn for example -#define MAKE_PAIR64(l, h) uint64(uint32(l) | (uint64(h) << 32)) -#define PAIR64_HIPART(x) (uint32)((uint64(x) >> 32) & UI64LIT(0x00000000FFFFFFFF)) -#define PAIR64_LOPART(x) (uint32)(uint64(x) & UI64LIT(0x00000000FFFFFFFF)) - -#define MAKE_PAIR16(l, h) uint16(uint8(l) | (uint16(h) << 8)) -#define MAKE_PAIR32(l, h) uint32(uint16(l) | (uint32(h) << 16)) -#define PAIR32_HIPART(x) (uint16)((uint32(x) >> 16) & 0x0000FFFF) -#define PAIR32_LOPART(x) (uint16)(uint32(x) & 0x0000FFFF) - enum HighGuid { - HIGHGUID_ITEM = 0x4000, // blizz 4000 - HIGHGUID_CONTAINER = 0x4000, // blizz 4000 - HIGHGUID_PLAYER = 0x0000, // blizz 0000 - HIGHGUID_GAMEOBJECT = 0xF110, // blizz F110 - HIGHGUID_TRANSPORT = 0xF120, // blizz F120 (for GAMEOBJECT_TYPE_TRANSPORT) - HIGHGUID_UNIT = 0xF130, // blizz F130 - HIGHGUID_PET = 0xF140, // blizz F140 - HIGHGUID_VEHICLE = 0xF150, // blizz F550 - HIGHGUID_DYNAMICOBJECT = 0xF100, // blizz F100 - HIGHGUID_CORPSE = 0xF101, // blizz F100 - HIGHGUID_MO_TRANSPORT = 0x1FC0, // blizz 1FC0 (for GAMEOBJECT_TYPE_MO_TRANSPORT) + HIGHGUID_ITEM = 0x4000, // blizz 4000 + HIGHGUID_CONTAINER = 0x4000, // blizz 4000 + HIGHGUID_PLAYER = 0x0000, // blizz 0000 + HIGHGUID_GAMEOBJECT = 0xF110, // blizz F110 + HIGHGUID_TRANSPORT = 0xF120, // blizz F120 (for GAMEOBJECT_TYPE_TRANSPORT) + HIGHGUID_UNIT = 0xF130, // blizz F130 + HIGHGUID_PET = 0xF140, // blizz F140 + HIGHGUID_VEHICLE = 0xF150, // blizz F550 + HIGHGUID_DYNAMICOBJECT = 0xF100, // blizz F100 + HIGHGUID_CORPSE = 0xF101, // blizz F100 + HIGHGUID_MO_TRANSPORT = 0x1FC0, // blizz 1FC0 (for GAMEOBJECT_TYPE_MO_TRANSPORT) HIGHGUID_GROUP = 0x1F50 }; -#define IS_EMPTY_GUID(Guid) (Guid == 0) - -#define IS_CREATURE_GUID(Guid) (GUID_HIPART(Guid) == HIGHGUID_UNIT) -#define IS_PET_GUID(Guid) (GUID_HIPART(Guid) == HIGHGUID_PET) -#define IS_VEHICLE_GUID(Guid) (GUID_HIPART(Guid) == HIGHGUID_VEHICLE) -#define IS_CRE_OR_VEH_GUID(Guid) (IS_CREATURE_GUID(Guid) || IS_VEHICLE_GUID(Guid)) -#define IS_CRE_OR_VEH_OR_PET_GUID(Guid)(IS_CRE_OR_VEH_GUID(Guid) || IS_PET_GUID(Guid)) -#define IS_PLAYER_GUID(Guid) (GUID_HIPART(Guid) == HIGHGUID_PLAYER && Guid != 0) -#define IS_UNIT_GUID(Guid) (IS_CRE_OR_VEH_OR_PET_GUID(Guid) || IS_PLAYER_GUID(Guid)) - // special case for empty guid need check -#define IS_ITEM_GUID(Guid) (GUID_HIPART(Guid) == HIGHGUID_ITEM) -#define IS_GAMEOBJECT_GUID(Guid) (GUID_HIPART(Guid) == HIGHGUID_GAMEOBJECT) -#define IS_DYNAMICOBJECT_GUID(Guid) (GUID_HIPART(Guid) == HIGHGUID_DYNAMICOBJECT) -#define IS_CORPSE_GUID(Guid) (GUID_HIPART(Guid) == HIGHGUID_CORPSE) -#define IS_TRANSPORT(Guid) (GUID_HIPART(Guid) == HIGHGUID_TRANSPORT) -#define IS_MO_TRANSPORT(Guid) (GUID_HIPART(Guid) == HIGHGUID_MO_TRANSPORT) -#define IS_GROUP(Guid) (GUID_HIPART(Guid) == HIGHGUID_GROUP) +// used for creating values for respawn for example +inline uint64 MAKE_PAIR64(uint32 l, uint32 h); +inline uint32 PAIR64_HIPART(uint64 x); +inline uint32 PAIR64_LOPART(uint64 x); +inline uint16 MAKE_PAIR16(uint8 l, uint8 h); +inline uint32 MAKE_PAIR32(uint16 l, uint16 h); +inline uint16 PAIR32_HIPART(uint32 x); +inline uint16 PAIR32_LOPART(uint32 x); + +inline bool IS_EMPTY_GUID(uint64 guid); +inline bool IS_CREATURE_GUID(uint64 guid); +inline bool IS_PET_GUID(uint64 guid); +inline bool IS_VEHICLE_GUID(uint64 guid); +inline bool IS_CRE_OR_VEH_GUID(uint64 guid); +inline bool IS_CRE_OR_VEH_OR_PET_GUID(uint64 guid); +inline bool IS_PLAYER_GUID(uint64 guid); +inline bool IS_UNIT_GUID(uint64 guid); +inline bool IS_ITEM_GUID(uint64 guid); +inline bool IS_GAMEOBJECT_GUID(uint64 guid); +inline bool IS_DYNAMICOBJECT_GUID(uint64 guid); +inline bool IS_CORPSE_GUID(uint64 guid); +inline bool IS_TRANSPORT_GUID(uint64 guid); +inline bool IS_MO_TRANSPORT_GUID(uint64 guid); +inline bool IS_GROUP_GUID(uint64 guid); // l - OBJECT_FIELD_GUID // e - OBJECT_FIELD_ENTRY for GO (except GAMEOBJECT_TYPE_MO_TRANSPORT) and creatures or UNIT_FIELD_PETNUMBER for pets // h - OBJECT_FIELD_GUID + 1 -#define MAKE_NEW_GUID(l, e, h) uint64(uint64(l) | (uint64(e) << 24) | (uint64(h) << 48)) +inline uint64 MAKE_NEW_GUID(uint32 l, uint32 e, uint32 h); + +//#define GUID_HIPART(x) (uint32)((uint64(x) >> 52)) & 0x0000FFFF) +inline uint32 GUID_HIPART(uint64 guid); +inline uint32 GUID_ENPART(uint64 x); +inline uint32 GUID_LOPART(uint64 x); + +inline bool IsGuidHaveEnPart(uint64 guid); +inline char const* GetLogNameForGuid(uint64 guid); + +uint64 MAKE_PAIR64(uint32 l, uint32 h) +{ + return uint64(l | (uint64(h) << 32)); +} + +uint32 PAIR64_HIPART(uint64 x) +{ + return (uint32)((x >> 32) & UI64LIT(0x00000000FFFFFFFF)); +} -#define GUID_HIPART(x) (uint32)((uint64(x) >> 48) & 0x0000FFFF) +uint32 PAIR64_LOPART(uint64 x) +{ + return (uint32)(x & UI64LIT(0x00000000FFFFFFFF)); +} -// We have different low and middle part size for different guid types -#define _GUID_ENPART_2(x) 0 -#define _GUID_ENPART_3(x) (uint32)((uint64(x) >> 24) & UI64LIT(0x0000000000FFFFFF)) -#define _GUID_LOPART_2(x) (uint32)(uint64(x) & UI64LIT(0x00000000FFFFFFFF)) -#define _GUID_LOPART_3(x) (uint32)(uint64(x) & UI64LIT(0x0000000000FFFFFF)) +uint16 MAKE_PAIR16(uint8 l, uint8 h) +{ + return uint16(l | (uint16(h) << 8)); +} -inline bool IsGuidHaveEnPart(uint64 guid) +uint32 MAKE_PAIR32(uint16 l, uint16 h) +{ + return uint32(l | (uint32(h) << 16)); +} + +uint16 PAIR32_HIPART(uint32 x) +{ + return (uint16)((x >> 16) & 0x0000FFFF); +} + +uint16 PAIR32_LOPART(uint32 x) +{ + return (uint16)(x & 0x0000FFFF); +} + +bool IS_EMPTY_GUID(uint64 guid) +{ + return guid == 0; +} + +bool IS_CREATURE_GUID(uint64 guid) +{ + return GUID_HIPART(guid) == HIGHGUID_UNIT; +} + +bool IS_PET_GUID(uint64 guid) +{ + return GUID_HIPART(guid) == HIGHGUID_PET; +} + +bool IS_VEHICLE_GUID(uint64 guid) +{ + return GUID_HIPART(guid) == HIGHGUID_VEHICLE; +} + +bool IS_CRE_OR_VEH_GUID(uint64 guid) +{ + return IS_CREATURE_GUID(guid) || IS_VEHICLE_GUID(guid); +} + +bool IS_CRE_OR_VEH_OR_PET_GUID(uint64 guid) +{ + return IS_CRE_OR_VEH_GUID(guid) || IS_PET_GUID(guid); +} + +bool IS_PLAYER_GUID(uint64 guid) +{ + return guid != 0 && GUID_HIPART(guid) == HIGHGUID_PLAYER; +} + +bool IS_UNIT_GUID(uint64 guid) +{ + return IS_CRE_OR_VEH_OR_PET_GUID(guid) || IS_PLAYER_GUID(guid); +} + +bool IS_ITEM_GUID(uint64 guid) +{ + return GUID_HIPART(guid) == HIGHGUID_ITEM; +} + +bool IS_GAMEOBJECT_GUID(uint64 guid) +{ + return GUID_HIPART(guid) == HIGHGUID_GAMEOBJECT; +} + +bool IS_DYNAMICOBJECT_GUID(uint64 guid) +{ + return GUID_HIPART(guid) == HIGHGUID_DYNAMICOBJECT; +} + +bool IS_CORPSE_GUID(uint64 guid) +{ + return GUID_HIPART(guid) == HIGHGUID_CORPSE; +} + +bool IS_TRANSPORT_GUID(uint64 guid) +{ + return GUID_HIPART(guid) == HIGHGUID_TRANSPORT; +} + +bool IS_MO_TRANSPORT_GUID(uint64 guid) +{ + return GUID_HIPART(guid) == HIGHGUID_MO_TRANSPORT; +} + +bool IS_GROUP_GUID(uint64 guid) +{ + return GUID_HIPART(guid) == HIGHGUID_GROUP; +} + +uint64 MAKE_NEW_GUID(uint32 l, uint32 e, uint32 h) +{ + return uint64(uint64(l) | (uint64(e) << 24) | (uint64(h) << 48)); +} + +uint32 GUID_HIPART(uint64 guid) +{ + return (uint32)((uint64(guid) >> 48) & 0x0000FFFF); +} + +uint32 GUID_ENPART(uint64 x) +{ + return IsGuidHaveEnPart(x) + ? (uint32)((x >> 24) & UI64LIT(0x0000000000FFFFFF)) + : 0; +} + +uint32 GUID_LOPART(uint64 x) +{ + return IsGuidHaveEnPart(x) + ? (uint32)(x & UI64LIT(0x0000000000FFFFFF)) + : (uint32)(x & UI64LIT(0x00000000FFFFFFFF)); +} + +bool IsGuidHaveEnPart(uint64 guid) { switch (GUID_HIPART(guid)) { @@ -99,10 +230,7 @@ inline bool IsGuidHaveEnPart(uint64 guid) } } -#define GUID_ENPART(x) (IsGuidHaveEnPart(x) ? _GUID_ENPART_3(x) : _GUID_ENPART_2(x)) -#define GUID_LOPART(x) (IsGuidHaveEnPart(x) ? _GUID_LOPART_3(x) : _GUID_LOPART_2(x)) - -inline char const* GetLogNameForGuid(uint64 guid) +char const* GetLogNameForGuid(uint64 guid) { switch (GUID_HIPART(guid)) { @@ -121,4 +249,5 @@ inline char const* GetLogNameForGuid(uint64 guid) return "<unknown>"; } } + #endif diff --git a/src/server/game/Entities/Object/ObjectPosSelector.cpp b/src/server/game/Entities/Object/ObjectPosSelector.cpp index f5c36f5a3c9..5ad3086c2b6 100644 --- a/src/server/game/Entities/Object/ObjectPosSelector.cpp +++ b/src/server/game/Entities/Object/ObjectPosSelector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Object/ObjectPosSelector.h b/src/server/game/Entities/Object/ObjectPosSelector.h index b30694672df..d381fb5627e 100644 --- a/src/server/game/Entities/Object/ObjectPosSelector.h +++ b/src/server/game/Entities/Object/ObjectPosSelector.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Object/Updates/UpdateData.cpp b/src/server/game/Entities/Object/Updates/UpdateData.cpp index 45464f19083..58cc04dd61f 100644 --- a/src/server/game/Entities/Object/Updates/UpdateData.cpp +++ b/src/server/game/Entities/Object/Updates/UpdateData.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Object/Updates/UpdateData.h b/src/server/game/Entities/Object/Updates/UpdateData.h index ff649b7cb2f..fb4ec930c41 100644 --- a/src/server/game/Entities/Object/Updates/UpdateData.h +++ b/src/server/game/Entities/Object/Updates/UpdateData.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Object/Updates/UpdateFieldFlags.cpp b/src/server/game/Entities/Object/Updates/UpdateFieldFlags.cpp index 95bdaef221b..64b5037048b 100644 --- a/src/server/game/Entities/Object/Updates/UpdateFieldFlags.cpp +++ b/src/server/game/Entities/Object/Updates/UpdateFieldFlags.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Entities/Object/Updates/UpdateFieldFlags.h b/src/server/game/Entities/Object/Updates/UpdateFieldFlags.h index 2cd303d5fc5..6053b361905 100644 --- a/src/server/game/Entities/Object/Updates/UpdateFieldFlags.h +++ b/src/server/game/Entities/Object/Updates/UpdateFieldFlags.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Entities/Object/Updates/UpdateFields.h b/src/server/game/Entities/Object/Updates/UpdateFields.h index 7e4aa9aaab8..9e659c0f581 100644 --- a/src/server/game/Entities/Object/Updates/UpdateFields.h +++ b/src/server/game/Entities/Object/Updates/UpdateFields.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Object/Updates/UpdateMask.h b/src/server/game/Entities/Object/Updates/UpdateMask.h index ad70936b81d..784c4eba96f 100644 --- a/src/server/game/Entities/Object/Updates/UpdateMask.h +++ b/src/server/game/Entities/Object/Updates/UpdateMask.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index b6417681f4a..d11f6d94734 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -74,6 +74,7 @@ void Pet::AddToWorld() if (GetCharmInfo() && GetCharmInfo()->HasCommandState(COMMAND_FOLLOW)) { GetCharmInfo()->SetIsCommandAttack(false); + GetCharmInfo()->SetIsCommandFollow(false); GetCharmInfo()->SetIsAtStay(false); GetCharmInfo()->SetIsFollowing(false); GetCharmInfo()->SetIsReturning(false); @@ -267,7 +268,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c { SQLTransaction trans = CharacterDatabase.BeginTransaction(); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_PET_SLOT_BY_SLOT_EXCLUDE_ID); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_PET_SLOT_BY_SLOT_EXCLUDE_ID); stmt->setUInt8(0, uint8(PET_SAVE_NOT_IN_SLOT)); stmt->setUInt32(1, ownerid); stmt->setUInt8(2, uint8(PET_SAVE_AS_CURRENT)); @@ -332,7 +333,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c if (getPetType() == HUNTER_PET) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_DECLINED_NAME); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_DECLINED_NAME); stmt->setUInt32(0, owner->GetGUIDLow()); stmt->setUInt32(1, GetCharmInfo()->GetPetNumber()); PreparedQueryResult result = CharacterDatabase.Query(stmt); @@ -428,7 +429,7 @@ void Pet::SavePetToDB(PetSaveMode mode) // prevent existence another hunter pet in PET_SAVE_AS_CURRENT and PET_SAVE_NOT_IN_SLOT if (getPetType() == HUNTER_PET && (mode == PET_SAVE_AS_CURRENT || mode > PET_SAVE_LAST_STABLE_SLOT)) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_BY_SLOT); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_BY_SLOT); stmt->setUInt32(0, ownerLowGUID); stmt->setUInt8(1, uint8(PET_SAVE_AS_CURRENT)); stmt->setUInt8(2, uint8(PET_SAVE_LAST_STABLE_SLOT)); @@ -1349,7 +1350,7 @@ void Pet::_SaveAuras(SQLTransaction& trans) uint8 index = 0; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PET_AURA); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PET_AURA); stmt->setUInt32(index++, m_charmInfo->GetPetNumber()); stmt->setUInt64(index++, casterGUID); stmt->setUInt32(index++, itr->second->GetId()); @@ -1774,8 +1775,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/) ss << id; need_comma = true; - } - while (resultPets->NextRow()); + } while (resultPets->NextRow()); ss << ") AND spell IN ("; diff --git a/src/server/game/Entities/Pet/Pet.h b/src/server/game/Entities/Pet/Pet.h index a1dd57a26cc..1231cf87fba 100644 --- a/src/server/game/Entities/Pet/Pet.h +++ b/src/server/game/Entities/Pet/Pet.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Pet/PetDefines.h b/src/server/game/Entities/Pet/PetDefines.h index 76de2647c8c..34cde3af33a 100644 --- a/src/server/game/Entities/Pet/PetDefines.h +++ b/src/server/game/Entities/Pet/PetDefines.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 41c46cf55d2..e501471b688 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -1753,7 +1753,8 @@ void Player::Update(uint32 p_time) { if (p_time >= m_nextSave) { - // m_nextSave reseted in SaveToDB call + // m_nextSave reset in SaveToDB call + sScriptMgr->OnPlayerSave(this); SaveToDB(); sLog->outDebug(LOG_FILTER_PLAYER, "Player '%s' (GUID: %u) saved", GetName().c_str(), GetGUIDLow()); } @@ -2031,24 +2032,18 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data) return true; } -bool Player::ToggleAFK() +void Player::ToggleAFK() { ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK); - bool state = HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK); - // afk player not allowed in battleground - if (state && InBattleground() && !InArena()) + if (isAFK() && InBattleground() && !InArena()) LeaveBattleground(); - - return state; } -bool Player::ToggleDND() +void Player::ToggleDND() { ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_DND); - - return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DND); } uint8 Player::GetChatTag() const @@ -2067,15 +2062,6 @@ uint8 Player::GetChatTag() const return tag; } -void Player::SendTeleportPacket(Position &oldPos) -{ - WorldPacket data2(MSG_MOVE_TELEPORT, 38); - data2.append(GetPackGUID()); - BuildMovementPacket(&data2); - Relocate(&oldPos); - SendMessageToSet(&data2, false); -} - void Player::SendTeleportAckPacket() { WorldPacket data(MSG_MOVE_TELEPORT_ACK, 41); @@ -4750,7 +4736,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC // We can return mail now // So firstly delete the old one - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_BY_ID); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_BY_ID); stmt->setUInt32(0, mail_id); trans->Append(stmt); @@ -4759,7 +4745,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC { if (has_items) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM_BY_ID); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM_BY_ID); stmt->setUInt32(0, mail_id); trans->Append(stmt); } @@ -4773,7 +4759,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC if (has_items) { // Data needs to be at first place for Item::LoadFromDB - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAILITEMS); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAILITEMS); stmt->setUInt32(0, mail_id); PreparedQueryResult resultItems = CharacterDatabase.Query(stmt); if (resultItems) @@ -4988,7 +4974,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC // The character gets unlinked from the account, the name gets freed up and appears as deleted ingame case CHAR_DELETE_UNLINK: { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_DELETE_INFO); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_DELETE_INFO); stmt->setUInt32(0, guid); @@ -5725,7 +5711,7 @@ void Player::HandleBaseModValue(BaseModGroup modGroup, BaseModType modType, floa float Player::GetBaseModValue(BaseModGroup modGroup, BaseModType modType) const { - if (modGroup >= BASEMOD_END || modType > MOD_END) + if (modGroup >= BASEMOD_END || modType >= MOD_END) { sLog->outError(LOG_FILTER_SPELLS_AURAS, "trial to access non existed BaseModGroup or wrong BaseModType!"); return 0.0f; @@ -6993,7 +6979,10 @@ int32 Player::CalculateReputationGain(ReputationSource source, uint32 creatureOr percent *= repRate; } - return int32(rep * percent / 100.0f); + if (source != REPUTATION_SOURCE_SPELL && GetsRecruitAFriendBonus(false)) + percent *= 1.0f + sWorld->getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS); + + return CalculatePct(rep, percent); } // Calculates how many reputation points player gains in victim's enemy factions @@ -7016,43 +7005,20 @@ void Player::RewardReputation(Unit* victim, float rate) // support for: Championing - http://www.wowwiki.com/Championing Map const* map = GetMap(); - if (map && map->IsDungeon()) + if (map && map->IsNonRaidDungeon()) { - InstanceTemplate const* instance = sObjectMgr->GetInstanceTemplate(map->GetId()); - if (instance) - { - AccessRequirement const* pAccessRequirement = sObjectMgr->GetAccessRequirement(map->GetId(), ((InstanceMap*)map)->GetDifficulty()); - if (pAccessRequirement) - { - if (!map->IsRaid() && pAccessRequirement->levelMin == 80) - ChampioningFaction = GetChampioningFaction(); - } - } + if (AccessRequirement const* accessRequirement = sObjectMgr->GetAccessRequirement(map->GetId(), map->GetDifficulty())) + if (accessRequirement->levelMin == 80) + ChampioningFaction = GetChampioningFaction(); } } - // Favored reputation increase START - uint32 zone = GetZoneId(); uint32 team = GetTeam(); - float favored_rep_mult = 0; - - if ((HasAura(32096) || HasAura(32098)) && (zone == 3483 || zone == 3562 || zone == 3836 || zone == 3713 || zone == 3714)) - favored_rep_mult = 0.25; // Thrallmar's Favor and Honor Hold's Favor - else if (HasAura(30754) && (Rep->RepFaction1 == 609 || Rep->RepFaction2 == 609) && !ChampioningFaction) - favored_rep_mult = 0.25; // Cenarion Favor - - if (favored_rep_mult > 0) favored_rep_mult *= 2; // Multiplied by 2 because the reputation is divided by 2 for some reason (See "donerep1 / 2" and "donerep2 / 2") -- if you know why this is done, please update/explain :) - // Favored reputation increase END - - bool recruitAFriend = GetsRecruitAFriendBonus(false); if (Rep->RepFaction1 && (!Rep->TeamDependent || team == ALLIANCE)) { - int32 donerep1 = CalculateReputationGain(REPUTATION_SOURCE_KILL, victim->getLevel(), Rep->RepValue1, ChampioningFaction ? ChampioningFaction : Rep->RepFaction1, false); - donerep1 = int32(donerep1*(rate + favored_rep_mult)); - - if (recruitAFriend) - donerep1 = int32(donerep1 * (1 + sWorld->getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS))); + int32 donerep1 = CalculateReputationGain(REPUTATION_SOURCE_KILL, victim->getLevel(), Rep->RepValue1, ChampioningFaction ? ChampioningFaction : Rep->RepFaction1); + donerep1 = int32(donerep1 * rate); FactionEntry const* factionEntry1 = sFactionStore.LookupEntry(ChampioningFaction ? ChampioningFaction : Rep->RepFaction1); uint32 current_reputation_rank1 = GetReputationMgr().GetRank(factionEntry1); @@ -7062,11 +7028,8 @@ void Player::RewardReputation(Unit* victim, float rate) if (Rep->RepFaction2 && (!Rep->TeamDependent || team == HORDE)) { - int32 donerep2 = CalculateReputationGain(REPUTATION_SOURCE_KILL, victim->getLevel(), Rep->RepValue2, ChampioningFaction ? ChampioningFaction : Rep->RepFaction2, false); - donerep2 = int32(donerep2*(rate + favored_rep_mult)); - - if (recruitAFriend) - donerep2 = int32(donerep2 * (1 + sWorld->getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS))); + int32 donerep2 = CalculateReputationGain(REPUTATION_SOURCE_KILL, victim->getLevel(), Rep->RepValue2, ChampioningFaction ? ChampioningFaction : Rep->RepFaction2); + donerep2 = int32(donerep2 * rate); FactionEntry const* factionEntry2 = sFactionStore.LookupEntry(ChampioningFaction ? ChampioningFaction : Rep->RepFaction2); uint32 current_reputation_rank2 = GetReputationMgr().GetRank(factionEntry2); @@ -7078,59 +7041,43 @@ void Player::RewardReputation(Unit* victim, float rate) // Calculate how many reputation points player gain with the quest void Player::RewardReputation(Quest const* quest) { - bool recruitAFriend = GetsRecruitAFriendBonus(false); - - // quest reputation reward/loss for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) { if (!quest->RewardFactionId[i]) continue; - if (quest->RewardFactionValueIdOverride[i]) - { - int32 rep = 0; - if (quest->IsDaily()) - rep = CalculateReputationGain(REPUTATION_SOURCE_DAILY_QUEST, GetQuestLevel(quest), quest->RewardFactionValueIdOverride[i]/100, quest->RewardFactionId[i], true); - else if (quest->IsWeekly()) - rep = CalculateReputationGain(REPUTATION_SOURCE_WEEKLY_QUEST, GetQuestLevel(quest), quest->RewardFactionValueIdOverride[i]/100, quest->RewardFactionId[i], true); - else if (quest->IsMonthly()) - rep = CalculateReputationGain(REPUTATION_SOURCE_MONTHLY_QUEST, GetQuestLevel(quest), quest->RewardFactionValueIdOverride[i]/100, quest->RewardFactionId[i], true); - else - rep = CalculateReputationGain(REPUTATION_SOURCE_QUEST, GetQuestLevel(quest), quest->RewardFactionValueIdOverride[i]/100, quest->RewardFactionId[i], true); - - if (recruitAFriend) - rep = int32(rep * (1 + sWorld->getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS))); + int32 rep = 0; + bool noQuestBonus = false; - if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(quest->RewardFactionId[i])) - GetReputationMgr().ModifyReputation(factionEntry, rep); + if (quest->RewardFactionValueIdOverride[i]) + { + rep = quest->RewardFactionValueIdOverride[i] / 100; + noQuestBonus = true; } else { uint32 row = ((quest->RewardFactionValueId[i] < 0) ? 1 : 0) + 1; - uint32 field = abs(quest->RewardFactionValueId[i]); - - if (const QuestFactionRewEntry* pRow = sQuestFactionRewardStore.LookupEntry(row)) + if (QuestFactionRewEntry const* questFactionRewEntry = sQuestFactionRewardStore.LookupEntry(row)) { - int32 repPoints = pRow->QuestRewFactionValue[field]; - if (!repPoints) - continue; + uint32 field = abs(quest->RewardFactionValueId[i]); + rep = questFactionRewEntry->QuestRewFactionValue[field]; + } + } - if (quest->IsDaily()) - repPoints = CalculateReputationGain(REPUTATION_SOURCE_DAILY_QUEST, GetQuestLevel(quest), repPoints, quest->RewardFactionId[i], true); - else if (quest->IsWeekly()) - repPoints = CalculateReputationGain(REPUTATION_SOURCE_WEEKLY_QUEST, GetQuestLevel(quest), repPoints, quest->RewardFactionId[i], true); - else if (quest->IsMonthly()) - repPoints = CalculateReputationGain(REPUTATION_SOURCE_MONTHLY_QUEST, GetQuestLevel(quest), repPoints, quest->RewardFactionId[i], true); - else - repPoints = CalculateReputationGain(REPUTATION_SOURCE_QUEST, GetQuestLevel(quest), repPoints, quest->RewardFactionId[i], true); + if (!rep) + continue; - if (recruitAFriend) - repPoints = int32(repPoints * (1 + sWorld->getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS))); + if (quest->IsDaily()) + rep = CalculateReputationGain(REPUTATION_SOURCE_DAILY_QUEST, GetQuestLevel(quest), rep, quest->RewardFactionId[i], noQuestBonus); + else if (quest->IsWeekly()) + rep = CalculateReputationGain(REPUTATION_SOURCE_WEEKLY_QUEST, GetQuestLevel(quest), rep, quest->RewardFactionId[i], noQuestBonus); + else if (quest->IsMonthly()) + rep = CalculateReputationGain(REPUTATION_SOURCE_MONTHLY_QUEST, GetQuestLevel(quest), rep, quest->RewardFactionId[i], noQuestBonus); + else + rep = CalculateReputationGain(REPUTATION_SOURCE_QUEST, GetQuestLevel(quest), rep, quest->RewardFactionId[i], noQuestBonus); - if (const FactionEntry* factionEntry = sFactionStore.LookupEntry(quest->RewardFactionId[i])) - GetReputationMgr().ModifyReputation(factionEntry, repPoints); - } - } + if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(quest->RewardFactionId[i])) + GetReputationMgr().ModifyReputation(factionEntry, rep); } } @@ -7431,7 +7378,7 @@ uint32 Player::GetZoneIdFromDB(uint64 guid) if (!zone) { // stored zone is zero, use generic and slow zone detection - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_POSITION_XYZ); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_POSITION_XYZ); stmt->setUInt32(0, guidLow); PreparedQueryResult result = CharacterDatabase.Query(stmt); @@ -7447,7 +7394,7 @@ uint32 Player::GetZoneIdFromDB(uint64 guid) if (zone > 0) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ZONE); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ZONE); stmt->setUInt16(0, uint16(zone)); stmt->setUInt32(1, guidLow); @@ -8011,8 +7958,12 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply // If set ScalingStatValue armor get it or use item armor uint32 armor = proto->Armor; if (ssv) + { if (uint32 ssvarmor = ssv->getArmorMod(proto->ScalingStatValue)) armor = ssvarmor; + } + else if (armor && proto->ArmorDamageModifier) + armor -= uint32(proto->ArmorDamageModifier); if (armor) { @@ -8270,8 +8221,8 @@ void Player::ApplyEquipSpell(SpellInfo const* spellInfo, Item* item, bool apply, if (form_change) // check aura active state from other form { - AuraApplicationMap const& auras = GetAppliedAuras(); - for (AuraApplicationMap::const_iterator itr = auras.lower_bound(spellInfo->Id); itr != auras.upper_bound(spellInfo->Id); ++itr) + AuraApplicationMapBounds range = GetAppliedAuras().equal_range(spellInfo->Id); + for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr) if (!item || itr->second->GetBase()->GetCastItemGUID() == item->GetGUID()) return; } @@ -8290,7 +8241,7 @@ void Player::ApplyEquipSpell(SpellInfo const* spellInfo, Item* item, bool apply, } if (item) - RemoveAurasDueToItemSpell(item, spellInfo->Id); // un-apply all spells, not only at-equipped + RemoveAurasDueToItemSpell(spellInfo->Id, item->GetGUID()); // un-apply all spells, not only at-equipped else RemoveAurasDueToSpell(spellInfo->Id); // un-apply spell (item set case) } @@ -8394,25 +8345,11 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 if (spellData.SpellPPMRate) { - if (spellData.SpellId == 52781) // Persuasive Strike - { - switch (target->GetEntry()) - { - default: - return; - case 28939: - case 28940: - case 28610: - break; - } - } uint32 WeaponSpeed = GetAttackTime(attType); chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate, spellInfo); } else if (chance > 100.0f) - { chance = GetWeaponProcChance(); - } if (roll_chance_f(chance)) CastSpell(target, spellInfo->Id, true, item); @@ -8903,7 +8840,9 @@ void Player::SendLoot(uint64 guid, LootType loot_type) loot = &item->loot; - if (!item->m_lootGenerated) + // If item doesn't already have loot, attempt to load it. If that + // fails then this is first time opening, generate loot + if (!item->m_lootGenerated && !item->ItemContainerLoadLootFromDB()) { item->m_lootGenerated = true; loot->clear(); @@ -8922,6 +8861,12 @@ void Player::SendLoot(uint64 guid, LootType loot_type) default: loot->generateMoneyLoot(item->GetTemplate()->MinMoneyLoot, item->GetTemplate()->MaxMoneyLoot); loot->FillLoot(item->GetEntry(), LootTemplates_Item, this, true, loot->gold != 0); + + // Force save the loot and money items that were just rolled + // Also saves the container item ID in Loot struct (not to DB) + if (loot->gold > 0 || loot->unlootedCount > 0) + item->ItemContainerSaveLootToDB(); + break; } } @@ -9683,8 +9628,8 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) instance->FillInitialWorldStates(data); else { - data << uint32(4132) << uint32(0); // 9 WORLDSTATE_SHOW_CRATES - data << uint32(4131) << uint32(0); // 10 WORLDSTATE_CRATES_REVEALED + data << uint32(4132) << uint32(0); // 9 WORLDSTATE_ALGALON_TIMER_ENABLED + data << uint32(4131) << uint32(0); // 10 WORLDSTATE_ALGALON_DESPAWN_TIMER } break; // Wintergrasp @@ -9826,11 +9771,10 @@ void Player::SetSheath(SheathState sheathed) SetVirtualItemSlot(2, NULL); break; case SHEATH_STATE_MELEE: // prepared melee weapon - { SetVirtualItemSlot(0, GetWeaponForAttack(BASE_ATTACK, true)); SetVirtualItemSlot(1, GetWeaponForAttack(OFF_ATTACK, true)); SetVirtualItemSlot(2, NULL); - }; break; + break; case SHEATH_STATE_RANGED: // prepared ranged weapon SetVirtualItemSlot(0, NULL); SetVirtualItemSlot(1, NULL); @@ -11968,7 +11912,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje Map const* map = lootedObject->GetMap(); if (uint32 dungeonId = sLFGMgr->GetDungeon(GetGroup()->GetGUID(), true)) if (LFGDungeonData const* dungeon = sLFGMgr->GetLFGDungeon(dungeonId)) - if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == uint32(map->GetDifficulty())) + if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty()) lootedObjectInDungeon = true; if (!lootedObjectInDungeon) @@ -12366,12 +12310,12 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update) switch (slot) { - case EQUIPMENT_SLOT_MAINHAND: - case EQUIPMENT_SLOT_OFFHAND: - case EQUIPMENT_SLOT_RANGED: - RecalculateRating(CR_ARMOR_PENETRATION); - default: - break; + case EQUIPMENT_SLOT_MAINHAND: + case EQUIPMENT_SLOT_OFFHAND: + case EQUIPMENT_SLOT_RANGED: + RecalculateRating(CR_ARMOR_PENETRATION); + default: + break; } } else @@ -12675,6 +12619,12 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) else if (Bag* pBag = GetBagByPos(bag)) pBag->RemoveItem(slot, update); + // Delete rolled money / loot from db. + // MUST be done before RemoveFromWorld() or GetTemplate() fails + if (ItemTemplate const* pTmp = pItem->GetTemplate()) + if (pTmp->Flags & ITEM_PROTO_FLAG_OPENABLE) + pItem->ItemContainerDeleteLootMoneyAndLootItemsFromDB(); + if (IsInWorld() && update) { pItem->RemoveFromWorld(); @@ -12688,22 +12638,22 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) } } -void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequip_check) +void Player::DestroyItemCount(uint32 itemEntry, uint32 count, bool update, bool unequip_check) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item = %u, count = %u", item, count); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item = %u, count = %u", itemEntry, count); uint32 remcount = 0; // 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() == itemEntry && !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) @@ -12711,11 +12661,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; } } @@ -12724,14 +12674,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() == itemEntry && !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) @@ -12739,11 +12689,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; } } @@ -12753,18 +12703,18 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ // in inventory bags for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - if (Bag* pBag = GetBagByPos(i)) + if (Bag* bag = GetBagByPos(i)) { - for (uint32 j = 0; j < pBag->GetBagSize(); j++) + for (uint32 j = 0; j < bag->GetBagSize(); j++) { - if (Item* pItem = pBag->GetItemByPos(j)) + if (Item* item = bag->GetItemByPos(j)) { - if (pItem->GetEntry() == item && !pItem->IsInTrade()) + if (item->GetEntry() == itemEntry && !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) @@ -12772,11 +12722,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; } } @@ -12788,15 +12738,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() == itemEntry && !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) @@ -12805,16 +12755,78 @@ 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) + item->SendUpdateToPlayer(this); + item->SetState(ITEM_CHANGED, this); + return; + } + } + } + } + + // in bank + for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; i++) + { + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + { + if (item->GetEntry() == itemEntry && !item->IsInTrade()) + { + if (item->GetCount() + remcount <= count) + { + remcount += item->GetCount(); + DestroyItem(INVENTORY_SLOT_BAG_0, i, update); + if (remcount >= count) + return; + } + else + { + 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; } } } } + + // in bank bags + for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) + { + if (Bag* bag = GetBagByPos(i)) + { + for (uint32 j = 0; j < bag->GetBagSize(); j++) + { + if (Item* item = bag->GetItemByPos(j)) + { + if (item->GetEntry() == itemEntry && !item->IsInTrade()) + { + // all items in bags can be unequipped + if (item->GetCount() + remcount <= count) + { + remcount += item->GetCount(); + DestroyItem(i, j, update); + + if (remcount >= count) + return; + } + else + { + ItemRemovedQuestCheck(item->GetEntry(), count - remcount); + item->SetCount(item->GetCount() - count + remcount); + if (IsInWorld() && update) + item->SendUpdateToPlayer(this); + item->SetState(ITEM_CHANGED, this); + return; + } + } + } + } + } + } } void Player::DestroyZoneLimitedItem(bool update, uint32 new_zone) @@ -13840,7 +13852,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool CastSpell(this, enchant_spell_id, true, item); } else - RemoveAurasDueToItemSpell(item, enchant_spell_id); + RemoveAurasDueToItemSpell(enchant_spell_id, item->GetGUID()); } break; case ITEM_ENCHANTMENT_TYPE_RESISTANCE: @@ -15219,7 +15231,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, _SaveQuestStatus(trans); if (announce) - SendQuestReward(quest, XP, questGiver); + SendQuestReward(quest, XP); // cast spells after mark quest complete (some spells have quest completed state requirements in spell_area data) if (quest->GetRewSpellCast() > 0) @@ -15349,14 +15361,14 @@ bool Player::SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg) // each-from-all exclusive group (< 0) // can be start if only all quests in prev quest exclusive group completed and rewarded - ObjectMgr::ExclusiveQuestGroups::iterator iter2 = sObjectMgr->mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup()); - ObjectMgr::ExclusiveQuestGroups::iterator end = sObjectMgr->mExclusiveQuestGroups.upper_bound(qPrevInfo->GetExclusiveGroup()); + ObjectMgr::ExclusiveQuestGroupsBounds range(sObjectMgr->mExclusiveQuestGroups.equal_range(qPrevInfo->GetExclusiveGroup())); - ASSERT(iter2 != end); // always must be found if qPrevInfo->ExclusiveGroup != 0 + // always must be found if qPrevInfo->ExclusiveGroup != 0 + ASSERT(range.first != range.second); - for (; iter2 != end; ++iter2) + for (; range.first != range.second; ++range.first) { - uint32 exclude_Id = iter2->second; + uint32 exclude_Id = range.first->second; // skip checked quest id, only state of other quests in group is interesting if (exclude_Id == prevId) @@ -15382,14 +15394,14 @@ bool Player::SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg) // each-from-all exclusive group (< 0) // can be start if only all quests in prev quest exclusive group active - ObjectMgr::ExclusiveQuestGroups::iterator iter2 = sObjectMgr->mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup()); - ObjectMgr::ExclusiveQuestGroups::iterator end = sObjectMgr->mExclusiveQuestGroups.upper_bound(qPrevInfo->GetExclusiveGroup()); + ObjectMgr::ExclusiveQuestGroupsBounds range(sObjectMgr->mExclusiveQuestGroups.equal_range(qPrevInfo->GetExclusiveGroup())); - ASSERT(iter2 != end); // always must be found if qPrevInfo->ExclusiveGroup != 0 + // always must be found if qPrevInfo->ExclusiveGroup != 0 + ASSERT(range.first != range.second); - for (; iter2 != end; ++iter2) + for (; range.first != range.second; ++range.first) { - uint32 exclude_Id = iter2->second; + uint32 exclude_Id = range.first->second; // skip checked quest id, only state of other quests in group is interesting if (exclude_Id == prevId) @@ -15520,14 +15532,14 @@ bool Player::SatisfyQuestExclusiveGroup(Quest const* qInfo, bool msg) if (qInfo->GetExclusiveGroup() <= 0) return true; - ObjectMgr::ExclusiveQuestGroups::iterator iter = sObjectMgr->mExclusiveQuestGroups.lower_bound(qInfo->GetExclusiveGroup()); - ObjectMgr::ExclusiveQuestGroups::iterator end = sObjectMgr->mExclusiveQuestGroups.upper_bound(qInfo->GetExclusiveGroup()); + ObjectMgr::ExclusiveQuestGroupsBounds range(sObjectMgr->mExclusiveQuestGroups.equal_range(qInfo->GetExclusiveGroup())); - ASSERT(iter != end); // always must be found if qInfo->ExclusiveGroup != 0 + // always must be found if qInfo->ExclusiveGroup != 0 + ASSERT(range.first != range.second); - for (; iter != end; ++iter) + for (; range.first != range.second; ++range.first) { - uint32 exclude_Id = iter->second; + uint32 exclude_Id = range.first->second; // skip checked quest id, only state of other quests in group is interesting if (exclude_Id == qInfo->GetQuestId()) @@ -15535,7 +15547,7 @@ bool Player::SatisfyQuestExclusiveGroup(Quest const* qInfo, bool msg) // not allow have daily quest if daily quest from exclusive group already recently completed Quest const* Nquest = sObjectMgr->GetQuestTemplate(exclude_Id); - if (!SatisfyQuestDay(Nquest, false) || !SatisfyQuestWeek(Nquest, false) || !SatisfyQuestSeasonal(Nquest,false)) + if (!SatisfyQuestDay(Nquest, false) || !SatisfyQuestWeek(Nquest, false) || !SatisfyQuestSeasonal(Nquest, false)) { if (msg) SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ); @@ -15996,6 +16008,8 @@ void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count) void Player::KilledMonster(CreatureTemplate const* cInfo, uint64 guid) { + ASSERT(cInfo); + if (cInfo->Entry) KilledMonsterCredit(cInfo->Entry, guid); @@ -16029,7 +16043,7 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid) continue; // just if !ingroup || !noraidgroup || raidgroup QuestStatusData& q_status = m_QuestStatus[questid]; - if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid())) + if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid(GetMap()->GetDifficulty()))) { if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST)) { @@ -16084,7 +16098,7 @@ void Player::KilledPlayerCredit() continue; // just if !ingroup || !noraidgroup || raidgroup QuestStatusData& q_status = m_QuestStatus[questid]; - if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid())) + if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid(GetMap()->GetDifficulty()))) { if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL)) { @@ -16148,6 +16162,12 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id) if (reqTarget != entry) // if entry doesn't match, check for killcredits referenced in template { CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry); + if (!cinfo) + { + sLog->outError(LOG_FILTER_PLAYER, "Player::CastedCreatureOrGO: GetCreatureTemplate failed for entry %u. Skipping.", entry); + continue; + } + for (uint8 k = 0; k < MAX_KILL_CREDIT; ++k) if (cinfo->KillCredit[k] == reqTarget) entry = cinfo->KillCredit[k]; @@ -16352,7 +16372,7 @@ bool Player::HasQuestForItem(uint32 itemid) const continue; // hide quest if player is in raid-group and quest is no raid quest - if (GetGroup() && GetGroup()->isRaidGroup() && !qinfo->IsAllowedInRaid()) + if (GetGroup() && GetGroup()->isRaidGroup() && !qinfo->IsAllowedInRaid(GetMap()->GetDifficulty())) if (!InBattleground()) //there are two ways.. we can make every bg-quest a raidquest, or add this code here.. i don't know if this can be exploited by other quests, but i think all other quests depend on a specific area.. but keep this in mind, if something strange happens later continue; @@ -16400,7 +16420,7 @@ void Player::SendQuestComplete(uint32 quest_id) } } -void Player::SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver) +void Player::SendQuestReward(Quest const* quest, uint32 XP) { uint32 questid = quest->GetQuestId(); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid); @@ -16423,9 +16443,6 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver) data << uint32(quest->GetBonusTalents()); // bonus talents data << uint32(quest->GetRewArenaPoints()); GetSession()->SendPacket(&data); - - if (quest->GetQuestCompleteScript() != 0) - GetMap()->ScriptsStart(sQuestEndScripts, quest->GetQuestCompleteScript(), questGiver, this); } void Player::SendQuestFailed(uint32 questId, InventoryResult reason) @@ -16677,13 +16694,11 @@ bool Player::LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, flo return true; } -void Player::SetHomebind(WorldLocation const& /*loc*/, uint32 /*area_id*/) +void Player::SetHomebind(WorldLocation const& loc, uint32 areaId) { - m_homebindMapId = GetMapId(); - m_homebindAreaId = GetAreaId(); - m_homebindX = GetPositionX(); - m_homebindY = GetPositionY(); - m_homebindZ = GetPositionZ(); + loc.GetPosition(m_homebindX, m_homebindY, m_homebindZ); + m_homebindMapId = loc.GetMapId(); + m_homebindAreaId = areaId; // update sql homebind PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PLAYER_HOMEBIND); @@ -17726,7 +17741,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F } else { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEM_REFUNDS); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEM_REFUNDS); stmt->setUInt32(0, item->GetGUIDLow()); stmt->setUInt32(1, GetGUIDLow()); if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) @@ -17746,7 +17761,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F } else if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE)) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEM_BOP_TRADE); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEM_BOP_TRADE); stmt->setUInt32(0, item->GetGUIDLow()); if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) { @@ -18350,11 +18365,12 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, b if (save) { InstancePlayerBind& bind = m_boundInstances[save->GetDifficulty()][save->GetMapId()]; - if (bind.save) + if (!load) { - // update the save when the group kills a boss - if (permanent != bind.perm || save != bind.save) - if (!load) + if (bind.save) + { + // update the save when the group kills a boss + if (permanent != bind.perm || save != bind.save) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_INSTANCE); @@ -18365,9 +18381,8 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, b CharacterDatabase.Execute(stmt); } - } - else - if (!load) + } + else { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_INSTANCE); @@ -18377,6 +18392,7 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, b CharacterDatabase.Execute(stmt); } + } if (bind.save != save) { @@ -18395,8 +18411,8 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, b sScriptMgr->OnPlayerBindToInstance(this, save->GetDifficulty(), save->GetMapId(), permanent); return &bind; } - else - return NULL; + + return NULL; } void Player::BindToInstance() @@ -19084,7 +19100,7 @@ void Player::_SaveInventory(SQLTransaction& trans) if (!item || item->GetState() == ITEM_NEW) continue; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_ITEM); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_ITEM); stmt->setUInt32(0, item->GetGUIDLow()); trans->Append(stmt); @@ -19169,7 +19185,6 @@ void Player::_SaveInventory(SQLTransaction& trans) } } - PreparedStatement* stmt = NULL; switch (item->GetState()) { case ITEM_NEW: @@ -19206,7 +19221,7 @@ void Player::_SaveMail(SQLTransaction& trans) Mail* m = (*itr); if (m->state == MAIL_STATE_CHANGED) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_MAIL); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_MAIL); stmt->setUInt8(0, uint8(m->HasItems() ? 1 : 0)); stmt->setUInt32(1, uint32(m->expire_time)); stmt->setUInt32(2, uint32(m->deliver_time)); @@ -19233,7 +19248,6 @@ void Player::_SaveMail(SQLTransaction& trans) { if (m->HasItems()) { - PreparedStatement* stmt = NULL; for (MailItemInfoVec::iterator itr2 = m->items.begin(); itr2 != m->items.end(); ++itr2) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE); @@ -20079,42 +20093,29 @@ void Player::Whisper(const std::string& text, uint32 language, uint64 receiver) std::string _text(text); sScriptMgr->OnPlayerChat(this, CHAT_MSG_WHISPER, language, _text, rPlayer); - // when player you are whispering to is dnd, he cannot receive your message, unless you are in gm mode - if (!rPlayer->isDND() || isGameMaster()) - { - WorldPacket data(SMSG_MESSAGECHAT, 200); - BuildPlayerChat(&data, CHAT_MSG_WHISPER, _text, language); - rPlayer->GetSession()->SendPacket(&data); - - // not send confirmation for addon messages - if (!isAddonMessage) - { - data.Initialize(SMSG_MESSAGECHAT, 200); - rPlayer->BuildPlayerChat(&data, CHAT_MSG_WHISPER_INFORM, _text, language); - GetSession()->SendPacket(&data); - } - } - else if (!isAddonMessage) - // announce to player that player he is whispering to is dnd and cannot receive his message - ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_DND, rPlayer->GetName().c_str(), rPlayer->dndMsg.c_str()); + WorldPacket data(SMSG_MESSAGECHAT, 200); + BuildPlayerChat(&data, CHAT_MSG_WHISPER, _text, language); + rPlayer->GetSession()->SendPacket(&data); // rest stuff shouldn't happen in case of addon message if (isAddonMessage) return; + data.Initialize(SMSG_MESSAGECHAT, 200); + rPlayer->BuildPlayerChat(&data, CHAT_MSG_WHISPER_INFORM, _text, language); + GetSession()->SendPacket(&data); + if (!isAcceptWhispers() && !isGameMaster() && !rPlayer->isGameMaster()) { SetAcceptWhispers(true); ChatHandler(GetSession()).SendSysMessage(LANG_COMMAND_WHISPERON); } - // announce to player that player he is whispering to is afk + // announce afk or dnd message if (rPlayer->isAFK()) - ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_AFK, rPlayer->GetName().c_str(), rPlayer->afkMsg.c_str()); - - // if player whisper someone, auto turn of dnd to be able to receive an answer - if (isDND() && !rPlayer->isGameMaster()) - ToggleDND(); + ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_AFK, rPlayer->GetName().c_str(), rPlayer->autoReplyMsg.c_str()); + else if (rPlayer->isDND()) + ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_DND, rPlayer->GetName().c_str(), rPlayer->autoReplyMsg.c_str()); } void Player::PetSpellInitialize() @@ -20588,7 +20589,7 @@ void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type) if (type == 10) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_PETITION_SIGNATURES); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_PETITION_SIGNATURES); stmt->setUInt32(0, GUID_LOPART(guid)); @@ -20596,7 +20597,7 @@ void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type) } else { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_SIGNATURE); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_SIGNATURE); stmt->setUInt32(0, GUID_LOPART(guid)); stmt->setUInt8(1, uint8(type)); @@ -20654,7 +20655,7 @@ void Player::LeaveAllArenaTeams(uint64 guid) while (result->NextRow()); } -void Player::SetRestBonus (float rest_bonus_new) +void Player::SetRestBonus(float rest_bonus_new) { // Prevent resting on max level if (getLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) @@ -22776,7 +22777,7 @@ bool Player::HasQuestForGO(int32 GOId) const if (!qinfo) continue; - if (GetGroup() && GetGroup()->isRaidGroup() && !qinfo->IsAllowedInRaid()) + if (GetGroup() && GetGroup()->isRaidGroup() && !qinfo->IsAllowedInRaid(GetMap()->GetDifficulty())) continue; for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) @@ -23523,7 +23524,10 @@ 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, true); + { + if (!HasAura(liquid->SpellId)) + CastSpell(this, liquid->SpellId, true); + } else RemoveAurasDueToSpell(liquid->SpellId); } @@ -24057,6 +24061,11 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot) UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item->itemid, item->count); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, loot->loot_type, item->count); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, item->itemid, item->count); + + // LootItem is being removed (looted) from the container, delete it from the DB. + if (loot->containerID > 0) + loot->DeleteLootItemFromContainerItemDB(item->itemid); + } else SendEquipError(msg, NULL, NULL, item->itemid); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 7d5b0487f4d..fa82ac6f8c6 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -1108,13 +1108,12 @@ class Player : public Unit, public GridObject<Player> Creature* GetNPCIfCanInteractWith(uint64 guid, uint32 npcflagmask); GameObject* GetGameObjectIfCanInteractWith(uint64 guid, GameobjectTypes type) const; - bool ToggleAFK(); - bool ToggleDND(); + void ToggleAFK(); + void ToggleDND(); bool isAFK() const { return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK); } bool isDND() const { return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DND); } uint8 GetChatTag() const; - std::string afkMsg; - std::string dndMsg; + std::string autoReplyMsg; uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, BarberShopStyleEntry const* newSkin=NULL); @@ -1480,7 +1479,7 @@ class Player : public Unit, public GridObject<Player> bool CanShareQuest(uint32 quest_id) const; void SendQuestComplete(uint32 quest_id); - void SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver); + void SendQuestReward(Quest const* quest, uint32 XP); void SendQuestFailed(uint32 questId, InventoryResult reason = EQUIP_ERR_OK); void SendQuestTimerFailed(uint32 quest_id); void SendCanTakeQuestResponse(uint32 msg) const; @@ -1947,7 +1946,6 @@ class Player : public Unit, public GridObject<Player> void SendMessageToSetInRange(WorldPacket* data, float dist, bool self, bool own_team_only); void SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr); - void SendTeleportPacket(Position &oldPos); void SendTeleportAckPacket(); Corpse* GetCorpse() const; @@ -2312,7 +2310,7 @@ class Player : public Unit, public GridObject<Player> float m_recallO; void SaveRecallPosition(); - void SetHomebind(WorldLocation const& loc, uint32 area_id); + void SetHomebind(WorldLocation const& loc, uint32 areaId); // Homebind coordinates uint32 m_homebindMapId; diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp index bc16a7f42a2..e5bbac59e00 100644 --- a/src/server/game/Entities/Player/SocialMgr.cpp +++ b/src/server/game/Entities/Player/SocialMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Player/SocialMgr.h b/src/server/game/Entities/Player/SocialMgr.h index 85daf369f69..0e73af8f809 100644 --- a/src/server/game/Entities/Player/SocialMgr.h +++ b/src/server/game/Entities/Player/SocialMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Totem/Totem.cpp b/src/server/game/Entities/Totem/Totem.cpp index 4d726181c4f..c2dec9086ca 100644 --- a/src/server/game/Entities/Totem/Totem.cpp +++ b/src/server/game/Entities/Totem/Totem.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Totem/Totem.h b/src/server/game/Entities/Totem/Totem.h index 6271253498d..565d13cd0d0 100644 --- a/src/server/game/Entities/Totem/Totem.h +++ b/src/server/game/Entities/Totem/Totem.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 6de359c67dd..3ce23a973ca 100644 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Transport/Transport.h b/src/server/game/Entities/Transport/Transport.h index 8fd12b50695..d3bc3732b08 100644 --- a/src/server/game/Entities/Transport/Transport.h +++ b/src/server/game/Entities/Transport/Transport.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 2a17367e7a8..5cf0550905c 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -200,10 +200,9 @@ void Player::UpdateResistances(uint32 school) void Player::UpdateArmor() { - float value = 0.0f; UnitMods unitMod = UNIT_MOD_ARMOR; - value = GetModifierValue(unitMod, BASE_VALUE); // base armor (from items) + float value = GetModifierValue(unitMod, BASE_VALUE); // base armor (from items) value *= GetModifierValue(unitMod, BASE_PCT); // armor percent from items value += GetStat(STAT_AGILITY) * 2.0f; // armor bonus from stats value += GetModifierValue(unitMod, TOTAL_VALUE); @@ -1091,10 +1090,9 @@ bool Guardian::UpdateStats(Stats stat) case STAT_STRENGTH: mod = 0.7f; break; // Default Owner's Strength scale default: break; } - // Ravenous Dead - AuraEffect const* aurEff = NULL; + // Check just if owner has Ravenous Dead since it's effect is not an aura - aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0); + AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0); if (aurEff) { SpellInfo const* spellInfo = aurEff->GetSpellInfo(); // Then get the SpellProto and add the dummy effect value diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2569a8ccddf..3381369b743 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -551,18 +551,22 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam if (IsAIEnabled) GetAI()->DamageDealt(victim, damage, damagetype); - if (victim->GetTypeId() == TYPEID_PLAYER) + if (victim->GetTypeId() == TYPEID_PLAYER && this != victim) { - if (victim->ToPlayer()->GetCommandStatus(CHEAT_GOD)) - return 0; - // Signal to pets that their owner was attacked Pet* pet = victim->ToPlayer()->GetPet(); if (pet && pet->isAlive()) - pet->AI()->OwnerDamagedBy(this); + pet->AI()->OwnerAttackedBy(this); + + if (victim->ToPlayer()->GetCommandStatus(CHEAT_GOD)) + return 0; } + // Signal the pet it was attacked so the AI can respond if needed + if (victim->GetTypeId() == TYPEID_UNIT && this != victim && victim->isPet() && victim->isAlive()) + victim->ToPet()->AI()->AttackedBy(this); + if (damagetype != NODAMAGE) { // interrupting auras with AURA_INTERRUPT_FLAG_DAMAGE before checking !damage (absorbed damage breaks that type of auras) @@ -647,7 +651,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam sLog->outDebug(LOG_FILTER_UNITS, "DealDamageStart"); uint32 health = victim->GetHealth(); - sLog->outInfo(LOG_FILTER_UNITS, "deal dmg:%d to health:%d ", damage, health); + sLog->outDebug(LOG_FILTER_UNITS, "Unit " UI64FMTD " dealt %u damage to unit " UI64FMTD, GetGUID(), damage, victim->GetGUID()); // duel ends when player has 1 or less hp bool duel_hasEnded = false; @@ -1034,6 +1038,9 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama break; } + // Script Hook For CalculateSpellDamageTaken -- Allow scripts to change the Damage post class mitigation calculations + sScriptMgr->ModifySpellDamageTaken(damageInfo->target, damageInfo->attacker, damage); + // Calculate absorb resist if (damage > 0) { @@ -1130,6 +1137,9 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam damage = MeleeDamageBonusDone(damageInfo->target, damage, damageInfo->attackType); damage = damageInfo->target->MeleeDamageBonusTaken(this, damage, damageInfo->attackType); + // Script Hook For CalculateMeleeDamage -- Allow scripts to change the Damage pre class mitigation calculations + sScriptMgr->ModifyMeleeDamage(damageInfo->target, damageInfo->attacker, damage); + // Calculate armor reduction if (IsDamageReducedByArmor((SpellSchoolMask)(damageInfo->damageSchoolMask))) { @@ -3110,7 +3120,10 @@ void Unit::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, true); + { + if (!HasAura(liquid->SpellId)) + CastSpell(this, liquid->SpellId, true); + } else RemoveAurasDueToSpell(liquid->SpellId); } @@ -3388,8 +3401,11 @@ void Unit::_UnapplyAura(AuraApplication * aurApp, AuraRemoveMode removeMode) { // aura can be removed from unit only if it's applied on it, shouldn't happen ASSERT(aurApp->GetBase()->GetApplicationOfTarget(GetGUID()) == aurApp); + uint32 spellId = aurApp->GetBase()->GetId(); - for (AuraApplicationMap::iterator iter = m_appliedAuras.lower_bound(spellId); iter != m_appliedAuras.upper_bound(spellId);) + AuraApplicationMapBoundsNonConst range = m_appliedAuras.equal_range(spellId); + + for (AuraApplicationMap::iterator iter = range.first; iter != range.second;) { if (iter->second == aurApp) { @@ -3479,20 +3495,33 @@ void Unit::RemoveOwnedAura(Aura* aura, AuraRemoveMode removeMode) ASSERT(aura->GetOwner() == this); uint32 spellId = aura->GetId(); - for (AuraMap::iterator itr = m_ownedAuras.lower_bound(spellId); itr != m_ownedAuras.upper_bound(spellId); ++itr) + AuraMapBoundsNonConst range = m_ownedAuras.equal_range(spellId); + + for (AuraMap::iterator itr = range.first; itr != range.second; ++itr) + { if (itr->second == aura) { RemoveOwnedAura(itr, removeMode); return; } + } + ASSERT(false); } Aura* Unit::GetOwnedAura(uint32 spellId, uint64 casterGUID, uint64 itemCasterGUID, uint8 reqEffMask, Aura* except) const { - for (AuraMap::const_iterator itr = m_ownedAuras.lower_bound(spellId); itr != m_ownedAuras.upper_bound(spellId); ++itr) - if (((itr->second->GetEffectMask() & reqEffMask) == reqEffMask) && (!casterGUID || itr->second->GetCasterGUID() == casterGUID) && (!itemCasterGUID || itr->second->GetCastItemGUID() == itemCasterGUID) && (!except || except != itr->second)) + AuraMapBounds range = m_ownedAuras.equal_range(spellId); + for (AuraMap::const_iterator itr = range.first; itr != range.second; ++itr) + { + if (((itr->second->GetEffectMask() & reqEffMask) == reqEffMask) + && (!casterGUID || itr->second->GetCasterGUID() == casterGUID) + && (!itemCasterGUID || itr->second->GetCastItemGUID() == itemCasterGUID) + && (!except || except != itr->second)) + { return itr->second; + } + } return NULL; } @@ -3511,11 +3540,12 @@ void Unit::RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode) void Unit::RemoveAura(uint32 spellId, uint64 caster, uint8 reqEffMask, AuraRemoveMode removeMode) { - for (AuraApplicationMap::iterator iter = m_appliedAuras.lower_bound(spellId); iter != m_appliedAuras.upper_bound(spellId);) + AuraApplicationMapBoundsNonConst range = m_appliedAuras.equal_range(spellId); + for (AuraApplicationMap::iterator iter = range.first; iter != range.second;) { Aura const* aura = iter->second->GetBase(); if (((aura->GetEffectMask() & reqEffMask) == reqEffMask) - && (!caster || aura->GetCasterGUID() == caster)) + && (!caster || aura->GetCasterGUID() == caster)) { RemoveAura(iter, removeMode); return; @@ -3544,8 +3574,11 @@ void Unit::RemoveAura(AuraApplication * aurApp, AuraRemoveMode mode) // no need to remove if (aurApp->GetBase()->GetApplicationOfTarget(GetGUID()) != aurApp || aurApp->GetBase()->IsRemoved()) return; + uint32 spellId = aurApp->GetBase()->GetId(); - for (AuraApplicationMap::iterator iter = m_appliedAuras.lower_bound(spellId); iter != m_appliedAuras.upper_bound(spellId);) + AuraApplicationMapBoundsNonConst range = m_appliedAuras.equal_range(spellId); + + for (AuraApplicationMap::iterator iter = range.first; iter != range.second;) { if (aurApp == iter->second) { @@ -3583,11 +3616,12 @@ void Unit::RemoveAurasDueToSpell(uint32 spellId, uint64 casterGUID, uint8 reqEff void Unit::RemoveAuraFromStack(uint32 spellId, uint64 casterGUID, AuraRemoveMode removeMode) { - for (AuraMap::iterator iter = m_ownedAuras.lower_bound(spellId); iter != m_ownedAuras.upper_bound(spellId);) + AuraMapBoundsNonConst range = m_ownedAuras.equal_range(spellId); + for (AuraMap::iterator iter = range.first; iter != range.second;) { Aura* aura = iter->second; if ((aura->GetType() == UNIT_AURA_TYPE) - && (!casterGUID || aura->GetCasterGUID() == casterGUID)) + && (!casterGUID || aura->GetCasterGUID() == casterGUID)) { aura->ModStackAmount(-1, removeMode); return; @@ -3599,7 +3633,8 @@ void Unit::RemoveAuraFromStack(uint32 spellId, uint64 casterGUID, AuraRemoveMode void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId, uint64 casterGUID, Unit* dispeller, uint8 chargesRemoved/*= 1*/) { - for (AuraMap::iterator iter = m_ownedAuras.lower_bound(spellId); iter != m_ownedAuras.upper_bound(spellId);) + AuraMapBoundsNonConst range = m_ownedAuras.equal_range(spellId); + for (AuraMap::iterator iter = range.first; iter != range.second;) { Aura* aura = iter->second; if (aura->GetCasterGUID() == casterGUID) @@ -3626,7 +3661,8 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit* stealer) { - for (AuraMap::iterator iter = m_ownedAuras.lower_bound(spellId); iter != m_ownedAuras.upper_bound(spellId);) + AuraMapBoundsNonConst range = m_ownedAuras.equal_range(spellId); + for (AuraMap::iterator iter = range.first; iter != range.second;) { Aura* aura = iter->second; if (aura->GetCasterGUID() == casterGUID) @@ -3699,14 +3735,14 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit* } } -void Unit::RemoveAurasDueToItemSpell(Item* castItem, uint32 spellId) +void Unit::RemoveAurasDueToItemSpell(uint32 spellId, uint64 castItemGuid) { for (AuraApplicationMap::iterator iter = m_appliedAuras.lower_bound(spellId); iter != m_appliedAuras.upper_bound(spellId);) { - if (!castItem || iter->second->GetBase()->GetCastItemGUID() == castItem->GetGUID()) + if (iter->second->GetBase()->GetCastItemGUID() == castItemGuid) { RemoveAura(iter); - iter = m_appliedAuras.upper_bound(spellId); // overwrite by more appropriate + iter = m_appliedAuras.lower_bound(spellId); } else ++iter; @@ -3986,9 +4022,10 @@ void Unit::RemoveAllAurasExceptType(AuraType type) void Unit::DelayOwnedAuras(uint32 spellId, uint64 caster, int32 delaytime) { - for (AuraMap::iterator iter = m_ownedAuras.lower_bound(spellId); iter != m_ownedAuras.upper_bound(spellId);++iter) + AuraMapBoundsNonConst range = m_ownedAuras.equal_range(spellId); + for (; range.first != range.second; ++range.first) { - Aura* aura = iter->second; + Aura* aura = range.first->second; if (!caster || aura->GetCasterGUID() == caster) { if (aura->GetDuration() < delaytime) @@ -4017,9 +4054,15 @@ void Unit::_ApplyAllAuraStatMods() AuraEffect* Unit::GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster) const { - for (AuraApplicationMap::const_iterator itr = m_appliedAuras.lower_bound(spellId); itr != m_appliedAuras.upper_bound(spellId); ++itr) - if (itr->second->HasEffect(effIndex) && (!caster || itr->second->GetBase()->GetCasterGUID() == caster)) + AuraApplicationMapBounds range = m_appliedAuras.equal_range(spellId); + for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr) + { + if (itr->second->HasEffect(effIndex) + && (!caster || itr->second->GetBase()->GetCasterGUID() == caster)) + { return itr->second->GetBase()->GetEffect(effIndex); + } + } return NULL; } @@ -4067,11 +4110,19 @@ AuraEffect* Unit::GetAuraEffect(AuraType type, SpellFamilyNames family, uint32 f AuraApplication * Unit::GetAuraApplication(uint32 spellId, uint64 casterGUID, uint64 itemCasterGUID, uint8 reqEffMask, AuraApplication * except) const { - for (AuraApplicationMap::const_iterator itr = m_appliedAuras.lower_bound(spellId); itr != m_appliedAuras.upper_bound(spellId); ++itr) + AuraApplicationMapBounds range = m_appliedAuras.equal_range(spellId); + for (; range.first != range.second; ++range.first) { - Aura const* aura = itr->second->GetBase(); - if (((aura->GetEffectMask() & reqEffMask) == reqEffMask) && (!casterGUID || aura->GetCasterGUID() == casterGUID) && (!itemCasterGUID || aura->GetCastItemGUID() == itemCasterGUID) && (!except || except != itr->second)) - return itr->second; + AuraApplication* app = range.first->second; + Aura const* aura = app->GetBase(); + + if (((aura->GetEffectMask() & reqEffMask) == reqEffMask) + && (!casterGUID || aura->GetCasterGUID() == casterGUID) + && (!itemCasterGUID || aura->GetCastItemGUID() == itemCasterGUID) + && (!except || except != app)) + { + return app; + } } return NULL; } @@ -4141,22 +4192,31 @@ void Unit::GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelCharges bool Unit::HasAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster) const { - for (AuraApplicationMap::const_iterator itr = m_appliedAuras.lower_bound(spellId); itr != m_appliedAuras.upper_bound(spellId); ++itr) - if (itr->second->HasEffect(effIndex) && (!caster || itr->second->GetBase()->GetCasterGUID() == caster)) + AuraApplicationMapBounds range = m_appliedAuras.equal_range(spellId); + for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr) + { + if (itr->second->HasEffect(effIndex) + && (!caster || itr->second->GetBase()->GetCasterGUID() == caster)) + { return true; + } + } return false; } uint32 Unit::GetAuraCount(uint32 spellId) const { uint32 count = 0; - for (AuraApplicationMap::const_iterator itr = m_appliedAuras.lower_bound(spellId); itr != m_appliedAuras.upper_bound(spellId); ++itr) + AuraApplicationMapBounds range = m_appliedAuras.equal_range(spellId); + + for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr) { - if (!itr->second->GetBase()->GetStackAmount()) - count++; + if (itr->second->GetBase()->GetStackAmount() == 0) + ++count; else count += (uint32)itr->second->GetBase()->GetStackAmount(); } + return count; } @@ -5562,37 +5622,14 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Shadow's Fate (Shadowmourne questline) case 71169: { - target = triggeredByAura->GetCaster(); - if (!target) - return false; - Player* player = target->ToPlayer(); - if (!player) - return false; - // not checking Infusion auras because its in targetAuraSpell of credit spell - if (player->GetQuestStatus(24749) == QUEST_STATUS_INCOMPLETE) // Unholy Infusion - { - if (GetEntry() != 36678) // Professor Putricide - return false; - CastSpell(target, 71518, true); // Quest Credit - return true; - } - else if (player->GetQuestStatus(24756) == QUEST_STATUS_INCOMPLETE) // Blood Infusion - { - if (GetEntry() != 37955) // Blood-Queen Lana'thel - return false; - CastSpell(target, 72934, true); // Quest Credit - return true; - } - else if (player->GetQuestStatus(24757) == QUEST_STATUS_INCOMPLETE) // Frost Infusion + Unit* caster = triggeredByAura->GetCaster(); + if (caster && caster->GetTypeId() == TYPEID_PLAYER && caster->ToPlayer()->GetQuestStatus(24547) == QUEST_STATUS_INCOMPLETE) { - if (GetEntry() != 36853) // Sindragosa - return false; - CastSpell(target, 72289, true); // Quest Credit + CastSpell(caster, 71203, true); return true; } - else if (player->GetQuestStatus(24547) == QUEST_STATUS_INCOMPLETE) // A Feast of Souls - triggered_spell_id = 71203; - break; + else + return false; } // Essence of the Blood Queen case 70871: @@ -9037,34 +9074,44 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg // Shadow's Fate (Shadowmourne questline) case 71169: { - if (GetTypeId() != TYPEID_PLAYER) + // Victim needs more checks so bugs, rats or summons can not be affected by the proc. + if (GetTypeId() != TYPEID_PLAYER || !victim || victim->GetTypeId() != TYPEID_UNIT || victim->GetCreatureType() == CREATURE_TYPE_CRITTER) return false; Player* player = ToPlayer(); - if (player->GetQuestStatus(24749) == QUEST_STATUS_INCOMPLETE) // Unholy Infusion + if (player->GetQuestStatus(24547) == QUEST_STATUS_INCOMPLETE) { - if (!player->HasAura(71516) || victim->GetEntry() != 36678) // Shadow Infusion && Professor Putricide - return false; - } - else if (player->GetQuestStatus(24756) == QUEST_STATUS_INCOMPLETE) // Blood Infusion - { - if (!player->HasAura(72154) || victim->GetEntry() != 37955) // Thirst Quenched && Blood-Queen Lana'thel - return false; + break; } - else if (player->GetQuestStatus(24757) == QUEST_STATUS_INCOMPLETE) // Frost Infusion + else if (player->GetDifficulty(true) == RAID_DIFFICULTY_25MAN_NORMAL || player->GetDifficulty(true) == RAID_DIFFICULTY_25MAN_HEROIC) { - if (!player->HasAura(72290) || victim->GetEntry() != 36853) // Frost-Imbued Blade && Sindragosa + uint32 spellId = 0; + uint32 questId = 0; + switch (victim->GetEntry()) + { + case 36678: // NPC: Professor Putricide + questId = 24749; // Quest: Unholy Infusion + spellId = 71516; // Spell: Shadow Infusion + break; + case 37955: // NPC: Blood-Queen Lana'thel + questId = 24756; // Quest: Blood Infusion + spellId = 72154; // Spell: Thirst Quenched + break; + case 36853: // NPC: Sindragosa + questId = 24757; // Quest: Frost Infusion + spellId = 72290; // Spell: Frost-Imbued Blade + break; + default: + return false; + } + + if (player->GetQuestStatus(questId) != QUEST_STATUS_INCOMPLETE || !player->HasAura(spellId)) return false; - } - else if (player->GetQuestStatus(24547) != QUEST_STATUS_INCOMPLETE) // A Feast of Souls - return false; - if (victim->GetTypeId() != TYPEID_UNIT) - return false; - // critters are not allowed - if (victim->GetCreatureType() == CREATURE_TYPE_CRITTER) + break; + } + else return false; - break; } } @@ -9682,7 +9729,8 @@ bool Unit::HasAuraState(AuraStateType flag, SpellInfo const* spellProto, Unit co // If aura with aurastate by caster not found return false if ((1<<(flag-1)) & PER_CASTER_AURA_STATE_MASK) { - for (AuraStateAurasMap::const_iterator itr = m_auraStateAuras.lower_bound(flag); itr != m_auraStateAuras.upper_bound(flag); ++itr) + AuraStateAurasMapBounds range = m_auraStateAuras.equal_range(flag); + for (AuraStateAurasMap::const_iterator itr = range.first; itr != range.second; ++itr) if (itr->second->GetBase()->GetCasterGUID() == Caster->GetGUID()) return true; return false; @@ -12109,7 +12157,10 @@ void Unit::CombatStart(Unit* target, bool initialAggro) if (!target->isInCombat() && target->GetTypeId() != TYPEID_PLAYER && !target->ToCreature()->HasReactState(REACT_PASSIVE) && target->ToCreature()->IsAIEnabled) { - target->ToCreature()->AI()->AttackStart(this); + if (target->isPet()) + target->ToCreature()->AI()->AttackedBy(this); // PetAI has special handler before AttackStart() + else + target->ToCreature()->AI()->AttackStart(this); } SetInCombatWith(target); @@ -12661,9 +12712,27 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced) case MOVE_SWIM: case MOVE_FLIGHT: { - // Set creature speed rate from CreatureInfo + // Set creature speed rate if (GetTypeId() == TYPEID_UNIT) - speed *= ToCreature()->GetCreatureTemplate()->speed_run; // at this point, MOVE_WALK is never reached + { + Unit* pOwner = GetCharmerOrOwner(); + if ((isPet() || isGuardian()) && !isInCombat() && pOwner) // Must check for owner or crash on "Tame Beast" + { + // For every yard over 5, increase speed by 0.01 + // to help prevent pet from lagging behind and despawning + float dist = GetDistance(pOwner); + float base_rate = 1.00f; // base speed is 100% of owner speed + + if (dist < 5) + dist = 5; + + float mult = base_rate + ((dist - 5) * 0.01f); + + speed *= pOwner->GetSpeedRate(mtype) * mult; // pets derive speed from owner when not in combat + } + else + speed *= ToCreature()->GetCreatureTemplate()->speed_run; // at this point, MOVE_WALK is never reached + } // Normalize speed by 191 aura SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED if need // TODO: possible affect only on MOVE_RUN @@ -13948,17 +14017,17 @@ void Unit::DeleteCharmInfo() } CharmInfo::CharmInfo(Unit* unit) -: m_unit(unit), m_CommandState(COMMAND_FOLLOW), m_petnumber(0), m_barInit(false), - m_isCommandAttack(false), m_isAtStay(false), m_isFollowing(false), m_isReturning(false), - m_stayX(0.0f), m_stayY(0.0f), m_stayZ(0.0f) +: _unit(unit), _CommandState(COMMAND_FOLLOW), _petnumber(0), _barInit(false), + _isCommandAttack(false), _isAtStay(false), _isFollowing(false), _isReturning(false), + _stayX(0.0f), _stayY(0.0f), _stayZ(0.0f) { for (uint8 i = 0; i < MAX_SPELL_CHARM; ++i) - m_charmspells[i].SetActionAndType(0, ACT_DISABLED); + _charmspells[i].SetActionAndType(0, ACT_DISABLED); - if (m_unit->GetTypeId() == TYPEID_UNIT) + if (_unit->GetTypeId() == TYPEID_UNIT) { - m_oldReactState = m_unit->ToCreature()->GetReactState(); - m_unit->ToCreature()->SetReactState(REACT_PASSIVE); + _oldReactState = _unit->ToCreature()->GetReactState(); + _unit->ToCreature()->SetReactState(REACT_PASSIVE); } } @@ -13968,9 +14037,9 @@ CharmInfo::~CharmInfo() void CharmInfo::RestoreState() { - if (m_unit->GetTypeId() == TYPEID_UNIT) - if (Creature* creature = m_unit->ToCreature()) - creature->SetReactState(m_oldReactState); + if (_unit->GetTypeId() == TYPEID_UNIT) + if (Creature* creature = _unit->ToCreature()) + creature->SetReactState(_oldReactState); } void CharmInfo::InitPetActionBar() @@ -14001,16 +14070,16 @@ void CharmInfo::InitEmptyActionBar(bool withAttack) void CharmInfo::InitPossessCreateSpells() { InitEmptyActionBar(); - if (m_unit->GetTypeId() == TYPEID_UNIT) + if (_unit->GetTypeId() == TYPEID_UNIT) { for (uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i) { - uint32 spellId = m_unit->ToCreature()->m_spells[i]; + uint32 spellId = _unit->ToCreature()->m_spells[i]; SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (spellInfo && !(spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_DEAD)) { if (spellInfo->IsPassive()) - m_unit->CastSpell(m_unit, spellInfo, true); + _unit->CastSpell(_unit, spellInfo, true); else AddSpellToActionBar(spellInfo, ACT_PASSIVE); } @@ -14020,7 +14089,7 @@ void CharmInfo::InitPossessCreateSpells() void CharmInfo::InitCharmCreateSpells() { - if (m_unit->GetTypeId() == TYPEID_PLAYER) // charmed players don't have spells + if (_unit->GetTypeId() == TYPEID_PLAYER) // charmed players don't have spells { InitEmptyActionBar(); return; @@ -14030,23 +14099,23 @@ void CharmInfo::InitCharmCreateSpells() for (uint32 x = 0; x < MAX_SPELL_CHARM; ++x) { - uint32 spellId = m_unit->ToCreature()->m_spells[x]; + uint32 spellId = _unit->ToCreature()->m_spells[x]; SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (!spellInfo || spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_DEAD) { - m_charmspells[x].SetActionAndType(spellId, ACT_DISABLED); + _charmspells[x].SetActionAndType(spellId, ACT_DISABLED); continue; } if (spellInfo->IsPassive()) { - m_unit->CastSpell(m_unit, spellInfo, true); - m_charmspells[x].SetActionAndType(spellId, ACT_PASSIVE); + _unit->CastSpell(_unit, spellInfo, true); + _charmspells[x].SetActionAndType(spellId, ACT_PASSIVE); } else { - m_charmspells[x].SetActionAndType(spellId, ACT_DISABLED); + _charmspells[x].SetActionAndType(spellId, ACT_DISABLED); ActiveStates newstate = ACT_PASSIVE; @@ -14123,17 +14192,17 @@ void CharmInfo::ToggleCreatureAutocast(SpellInfo const* spellInfo, bool apply) return; for (uint32 x = 0; x < MAX_SPELL_CHARM; ++x) - if (spellInfo->Id == m_charmspells[x].GetAction()) - m_charmspells[x].SetType(apply ? ACT_ENABLED : ACT_DISABLED); + if (spellInfo->Id == _charmspells[x].GetAction()) + _charmspells[x].SetType(apply ? ACT_ENABLED : ACT_DISABLED); } void CharmInfo::SetPetNumber(uint32 petnumber, bool statwindow) { - m_petnumber = petnumber; + _petnumber = petnumber; if (statwindow) - m_unit->SetUInt32Value(UNIT_FIELD_PETNUMBER, m_petnumber); + _unit->SetUInt32Value(UNIT_FIELD_PETNUMBER, _petnumber); else - m_unit->SetUInt32Value(UNIT_FIELD_PETNUMBER, 0); + _unit->SetUInt32Value(UNIT_FIELD_PETNUMBER, 0); } void CharmInfo::LoadPetActionBar(const std::string& data) @@ -14379,6 +14448,12 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u } } + Unit* actor = isVictim ? target : this; + Unit* actionTarget = !isVictim ? target : this; + + DamageInfo damageInfo = DamageInfo(actor, actionTarget, damage, procSpell, procSpell ? SpellSchoolMask(procSpell->SchoolMask) : SPELL_SCHOOL_MASK_NORMAL, SPELL_DIRECT_DAMAGE); + ProcEventInfo eventInfo = ProcEventInfo(actor, actionTarget, target, procFlag, 0, 0, procExtra, NULL, &damageInfo, NULL /*HealInfo*/); + ProcTriggeredList procTriggered; // Fill procTriggered list for (AuraApplicationMap::const_iterator itr = GetAppliedAuras().begin(); itr!= GetAppliedAuras().end(); ++itr) @@ -14402,6 +14477,12 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u if (!IsTriggeredAtSpellProcEvent(target, triggerData.aura, procSpell, procFlag, procExtra, attType, isVictim, active, triggerData.spellProcEvent)) continue; + // do checks using conditions table + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_PROC, spellProto->Id); + ConditionSourceInfo condInfo = ConditionSourceInfo(eventInfo.GetActor(), eventInfo.GetActionTarget()); + if (!sConditionMgr->IsObjectMeetToConditions(condInfo, conditions)) + continue; + // Triggered spells not triggering additional spells bool triggered = !(spellProto->AttributesEx3 & SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED) ? (procExtra & PROC_EX_INTERNAL_TRIGGERED && !(procFlag & PROC_FLAG_DONE_TRAP_ACTIVATION)) : false; @@ -17064,11 +17145,15 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) } if (IsInMap(caster)) - caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId+1, target, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE, NULL, NULL, origCasterGUID); + caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId + 1, target, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE, NULL, NULL, origCasterGUID); else // This can happen during Player::_LoadAuras { - int32 bp0 = seatId; - Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, &bp0, NULL, origCasterGUID); + int32 bp0[MAX_SPELL_EFFECTS]; + for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j) + bp0[j] = spellEntry->Effects[j].BasePoints; + + bp0[i] = seatId; + Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, bp0, NULL, origCasterGUID); } } else @@ -17094,7 +17179,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) void Unit::EnterVehicle(Unit* base, int8 seatId) { - CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId+1, base, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE); + CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId + 1, base, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE); } void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp) @@ -17324,11 +17409,29 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool cas ToPlayer()->TeleportTo(GetMapId(), x, y, z, orientation, TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (casting ? TELE_TO_SPELL : 0)); else { + Position pos = {x, y, z, orientation}; + SendTeleportPacket(pos); UpdatePosition(x, y, z, orientation, true); - SendMovementFlagUpdate(); + UpdateObjectVisibility(); } } +void Unit::SendTeleportPacket(Position& pos) +{ + Position oldPos = { GetPositionX(), GetPositionY(), GetPositionZMinusOffset(), GetOrientation() }; + if (GetTypeId() == TYPEID_UNIT) + Relocate(&pos); + + WorldPacket data2(MSG_MOVE_TELEPORT, 38); + data2.append(GetPackGUID()); + BuildMovementPacket(&data2); + if (GetTypeId() == TYPEID_UNIT) + Relocate(&oldPos); + if (GetTypeId() == TYPEID_PLAYER) + Relocate(&pos); + SendMessageToSet(&data2, false); +} + bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool teleport) { // prevent crash when a bad coord is sent by the client @@ -17579,58 +17682,68 @@ uint32 Unit::GetResistance(SpellSchoolMask mask) const void CharmInfo::SetIsCommandAttack(bool val) { - m_isCommandAttack = val; + _isCommandAttack = val; } bool CharmInfo::IsCommandAttack() { - return m_isCommandAttack; + return _isCommandAttack; +} + +void CharmInfo::SetIsCommandFollow(bool val) +{ + _isCommandFollow = val; +} + +bool CharmInfo::IsCommandFollow() +{ + return _isCommandFollow; } void CharmInfo::SaveStayPosition() { //! At this point a new spline destination is enabled because of Unit::StopMoving() - G3D::Vector3 const stayPos = m_unit->movespline->FinalDestination(); - m_stayX = stayPos.x; - m_stayY = stayPos.y; - m_stayZ = stayPos.z; + G3D::Vector3 const stayPos = _unit->movespline->FinalDestination(); + _stayX = stayPos.x; + _stayY = stayPos.y; + _stayZ = stayPos.z; } void CharmInfo::GetStayPosition(float &x, float &y, float &z) { - x = m_stayX; - y = m_stayY; - z = m_stayZ; + x = _stayX; + y = _stayY; + z = _stayZ; } void CharmInfo::SetIsAtStay(bool val) { - m_isAtStay = val; + _isAtStay = val; } bool CharmInfo::IsAtStay() { - return m_isAtStay; + return _isAtStay; } void CharmInfo::SetIsFollowing(bool val) { - m_isFollowing = val; + _isFollowing = val; } bool CharmInfo::IsFollowing() { - return m_isFollowing; + return _isFollowing; } void CharmInfo::SetIsReturning(bool val) { - m_isReturning = val; + _isReturning = val; } bool CharmInfo::IsReturning() { - return m_isReturning; + return _isReturning; } void Unit::SetInFront(Unit const* target) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 7b2308c2a51..c714303e8c7 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -253,6 +253,7 @@ enum UnitRename #define MAX_SPELL_CONTROL_BAR 10 #define MAX_AGGRO_RESET_TIME 10 // in seconds +#define MAX_AGGRO_RADIUS 45.0f // yards enum Swing { @@ -1094,12 +1095,12 @@ struct CharmInfo explicit CharmInfo(Unit* unit); ~CharmInfo(); void RestoreState(); - uint32 GetPetNumber() const { return m_petnumber; } + uint32 GetPetNumber() const { return _petnumber; } void SetPetNumber(uint32 petnumber, bool statwindow); - void SetCommandState(CommandStates st) { m_CommandState = st; } - CommandStates GetCommandState() const { return m_CommandState; } - bool HasCommandState(CommandStates state) const { return (m_CommandState == state); } + void SetCommandState(CommandStates st) { _CommandState = st; } + CommandStates GetCommandState() const { return _CommandState; } + bool HasCommandState(CommandStates state) const { return (_CommandState == state); } void InitPossessCreateSpells(); void InitCharmCreateSpells(); @@ -1120,12 +1121,14 @@ struct CharmInfo void ToggleCreatureAutocast(SpellInfo const* spellInfo, bool apply); - CharmSpellInfo* GetCharmSpell(uint8 index) { return &(m_charmspells[index]); } + CharmSpellInfo* GetCharmSpell(uint8 index) { return &(_charmspells[index]); } GlobalCooldownMgr& GetGlobalCooldownMgr() { return m_GlobalCooldownMgr; } void SetIsCommandAttack(bool val); bool IsCommandAttack(); + void SetIsCommandFollow(bool val); + bool IsCommandFollow(); void SetIsAtStay(bool val); bool IsAtStay(); void SetIsFollowing(bool val); @@ -1137,23 +1140,24 @@ struct CharmInfo private: - Unit* m_unit; + Unit* _unit; UnitActionBarEntry PetActionBar[MAX_UNIT_ACTION_BAR_INDEX]; - CharmSpellInfo m_charmspells[4]; - CommandStates m_CommandState; - uint32 m_petnumber; - bool m_barInit; + CharmSpellInfo _charmspells[4]; + CommandStates _CommandState; + uint32 _petnumber; + bool _barInit; //for restoration after charmed - ReactStates m_oldReactState; + ReactStates _oldReactState; - bool m_isCommandAttack; - bool m_isAtStay; - bool m_isFollowing; - bool m_isReturning; - float m_stayX; - float m_stayY; - float m_stayZ; + bool _isCommandAttack; + bool _isCommandFollow; + bool _isAtStay; + bool _isFollowing; + bool _isReturning; + float _stayX; + float _stayY; + float _stayZ; GlobalCooldownMgr m_GlobalCooldownMgr; }; @@ -1197,10 +1201,18 @@ class Unit : public WorldObject public: typedef std::set<Unit*> AttackerSet; typedef std::set<Unit*> ControlList; - typedef std::pair<uint32, uint8> spellEffectPair; + typedef std::multimap<uint32, Aura*> AuraMap; + typedef std::pair<AuraMap::const_iterator, AuraMap::const_iterator> AuraMapBounds; + typedef std::pair<AuraMap::iterator, AuraMap::iterator> AuraMapBoundsNonConst; + typedef std::multimap<uint32, AuraApplication*> AuraApplicationMap; + typedef std::pair<AuraApplicationMap::const_iterator, AuraApplicationMap::const_iterator> AuraApplicationMapBounds; + typedef std::pair<AuraApplicationMap::iterator, AuraApplicationMap::iterator> AuraApplicationMapBoundsNonConst; + typedef std::multimap<AuraStateType, AuraApplication*> AuraStateAurasMap; + typedef std::pair<AuraStateAurasMap::const_iterator, AuraStateAurasMap::const_iterator> AuraStateAurasMapBounds; + typedef std::list<AuraEffect*> AuraEffectList; typedef std::list<Aura*> AuraList; typedef std::list<AuraApplication *> AuraApplicationList; @@ -1588,6 +1600,7 @@ class Unit : public WorldObject void SendSpellDamageImmune(Unit* target, uint32 spellId); void NearTeleportTo(float x, float y, float z, float orientation, bool casting = false); + void SendTeleportPacket(Position& pos); virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport = false); // returns true if unit's position really changed bool UpdatePosition(const Position &pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); } @@ -1759,7 +1772,7 @@ class Unit : public WorldObject void RemoveAuraFromStack(uint32 spellId, uint64 casterGUID = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT); void RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId, uint64 casterGUID, Unit* dispeller, uint8 chargesRemoved = 1); void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit* stealer); - void RemoveAurasDueToItemSpell(Item* castItem, uint32 spellId); + void RemoveAurasDueToItemSpell(uint32 spellId, uint64 castItemGuid); void RemoveAurasByType(AuraType auraType, uint64 casterGUID = 0, Aura* except = NULL, bool negative = true, bool positive = true); void RemoveNotOwnSingleTargetAuras(uint32 newPhase = 0x0); void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = 0); diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index c81f9af82ca..a3be443d014 100644 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -31,7 +31,8 @@ #include "MoveSplineInit.h" #include "TemporarySummon.h" -Vehicle::Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry) : _me(unit), _vehicleInfo(vehInfo), _usableSeatNum(0), _creatureEntry(creatureEntry) +Vehicle::Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry) : +_me(unit), _vehicleInfo(vehInfo), _usableSeatNum(0), _creatureEntry(creatureEntry), _status(STATUS_NONE) { for (uint32 i = 0; i < MAX_VEHICLE_SEATS; ++i) { @@ -49,6 +50,8 @@ Vehicle::Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry) Vehicle::~Vehicle() { + /// @Uninstall must be called before this. + ASSERT(_status == STATUS_UNINSTALLING); for (SeatMap::const_iterator itr = Seats.begin(); itr != Seats.end(); ++itr) ASSERT(!itr->second.Passenger); } @@ -92,6 +95,7 @@ void Vehicle::Install() } } + _status = STATUS_INSTALLED; if (GetBase()->GetTypeId() == TYPEID_UNIT) sScriptMgr->OnInstall(this); } @@ -112,6 +116,14 @@ void Vehicle::InstallAllAccessories(bool evading) void Vehicle::Uninstall() { + /// @Prevent recursive uninstall call. (Bad script in OnUninstall/OnRemovePassenger/PassengerBoarded hook.) + if (_status == STATUS_UNINSTALLING) + { + sLog->outError(LOG_FILTER_VEHICLES, "Vehicle GuidLow: %u, Entry: %u attempts to uninstall, but already has STATUS_UNINSTALLING! " + "Check Uninstall/PassengerBoarded script hooks for errors.", _me->GetGUIDLow(), _me->GetEntry()); + return; + } + _status = STATUS_UNINSTALLING; sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Uninstall Entry: %u, GuidLow: %u", _creatureEntry, _me->GetGUIDLow()); RemoveAllPassengers(); @@ -250,6 +262,14 @@ int8 Vehicle::GetNextEmptySeat(int8 seatId, bool next) const void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 type, uint32 summonTime) { + /// @Prevent adding accessories when vehicle is uninstalling. (Bad script in OnUninstall/OnRemovePassenger/PassengerBoarded hook.) + if (_status == STATUS_UNINSTALLING) + { + sLog->outError(LOG_FILTER_VEHICLES, "Vehicle GuidLow: %u, Entry: %u attempts to install accessory Entry: %u on seat %d with STATUS_UNINSTALLING! " + "Check Uninstall/PassengerBoarded script hooks for errors.", _me->GetGUIDLow(), _me->GetEntry(), entry, (int32)seatId); + return; + } + sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle: Installing accessory entry %u on vehicle entry %u (seat:%i)", entry, GetCreatureEntry(), seatId); if (Unit* passenger = GetPassenger(seatId)) { @@ -279,14 +299,6 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 typ return; } - // this cannot be checked instantly like this - // spellsystem is delaying everything to next update tick - //if (!accessory->IsOnVehicle(me)) - //{ - // accessory->UnSummon(); - // return; // Something went wrong in the spellsystem - //} - if (GetBase()->GetTypeId() == TYPEID_UNIT) sScriptMgr->OnInstallAccessory(this, accessory); } @@ -294,6 +306,14 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 typ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) { + /// @Prevent adding passengers when vehicle is uninstalling. (Bad script in OnUninstall/OnRemovePassenger/PassengerBoarded hook.) + if (_status == STATUS_UNINSTALLING) + { + sLog->outError(LOG_FILTER_VEHICLES, "Passenger GuidLow: %u, Entry: %u, attempting to board vehicle GuidLow: %u, Entry: %u during uninstall! SeatId: %i", + unit->GetGUIDLow(), unit->GetEntry(), _me->GetGUIDLow(), _me->GetEntry(), (int32)seatId); + return false; + } + if (unit->GetVehicle() != this) return false; @@ -353,13 +373,9 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) unit->m_movementInfo.t_seat = seat->first; unit->m_movementInfo.t_guid = _me->GetGUID(); - if (_me->GetTypeId() == TYPEID_UNIT - && unit->GetTypeId() == TYPEID_PLAYER - && seat->first == 0 && seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL) - { - if (!_me->SetCharmedBy(unit, CHARM_TYPE_VEHICLE)) - ASSERT(false); - } + if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && + seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL) + ASSERT(_me->SetCharmedBy(unit, CHARM_TYPE_VEHICLE)) if (_me->IsInWorld()) { @@ -415,7 +431,7 @@ void Vehicle::RemovePassenger(Unit* unit) unit->ClearUnitState(UNIT_STATE_ONVEHICLE); - if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->first == 0 && seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL) + if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL) _me->RemoveCharmedBy(unit); if (_me->IsInWorld()) @@ -426,13 +442,13 @@ void Vehicle::RemovePassenger(Unit* unit) unit->m_movementInfo.t_seat = 0; } - if (_me->GetTypeId() == TYPEID_UNIT && _me->ToCreature()->IsAIEnabled) - _me->ToCreature()->AI()->PassengerBoarded(unit, seat->first, false); - // only for flyable vehicles if (unit->IsFlying()) _me->CastSpell(unit, VEHICLE_SPELL_PARACHUTE, true); + if (_me->GetTypeId() == TYPEID_UNIT && _me->ToCreature()->IsAIEnabled) + _me->ToCreature()->AI()->PassengerBoarded(unit, seat->first, false); + if (GetBase()->GetTypeId() == TYPEID_UNIT) sScriptMgr->OnRemovePassenger(this, unit); } diff --git a/src/server/game/Entities/Vehicle/Vehicle.h b/src/server/game/Entities/Vehicle/Vehicle.h index 3f1567c74ee..823fb72b8a8 100644 --- a/src/server/game/Entities/Vehicle/Vehicle.h +++ b/src/server/game/Entities/Vehicle/Vehicle.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -22,6 +22,7 @@ #include "ObjectDefines.h" #include "Object.h" #include "VehicleDefines.h" +#include "Unit.h" struct VehicleEntry; @@ -32,9 +33,6 @@ typedef std::set<uint64> GuidSet; class Vehicle : public TransportBase { public: - explicit Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry); - virtual ~Vehicle(); - void Install(); void Uninstall(); void Reset(bool evading = false); @@ -67,7 +65,20 @@ class Vehicle : public TransportBase VehicleSeatEntry const* GetSeatForPassenger(Unit* passenger); + protected: + friend bool Unit::CreateVehicleKit(uint32 id, uint32 creatureEntry); + Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry); + friend void Unit::RemoveVehicleKit(); + ~Vehicle(); + private: + enum Status + { + STATUS_NONE, + STATUS_INSTALLED, + STATUS_UNINSTALLING, + }; + SeatMap::iterator GetSeatIteratorForPassenger(Unit* passenger); void InitMovementInfoForBase(); @@ -82,7 +93,7 @@ class Vehicle : public TransportBase GuidSet vehiclePlayers; uint32 _usableSeatNum; // Number of seats that match VehicleSeatEntry::UsableByPlayer, used for proper display flags uint32 _creatureEntry; // Can be different than me->GetBase()->GetEntry() in case of players - + Status _status; Position m_lastShootPos; }; #endif diff --git a/src/server/game/Entities/Vehicle/VehicleDefines.h b/src/server/game/Entities/Vehicle/VehicleDefines.h index cb8a6628b80..3d3b43e832c 100644 --- a/src/server/game/Entities/Vehicle/VehicleDefines.h +++ b/src/server/game/Entities/Vehicle/VehicleDefines.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 256864d6a77..a499347356b 100644 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Events/GameEventMgr.h b/src/server/game/Events/GameEventMgr.h index dbc2c7ead10..d15b3e48dc9 100644 --- a/src/server/game/Events/GameEventMgr.h +++ b/src/server/game/Events/GameEventMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp index cedb20eccf1..75b8413c934 100644 --- a/src/server/game/Globals/ObjectAccessor.cpp +++ b/src/server/game/Globals/ObjectAccessor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Globals/ObjectAccessor.h b/src/server/game/Globals/ObjectAccessor.h index d2b532c9f94..113ef1dec83 100644 --- a/src/server/game/Globals/ObjectAccessor.h +++ b/src/server/game/Globals/ObjectAccessor.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 74423e2b362..b41b61904e6 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -49,9 +49,7 @@ #include "WaypointManager.h" #include "World.h" -ScriptMapMap sQuestEndScripts; ScriptMapMap sSpellScripts; -ScriptMapMap sGameObjectScripts; ScriptMapMap sEventScripts; ScriptMapMap sWaypointScripts; @@ -60,9 +58,7 @@ std::string GetScriptsTableNameByType(ScriptsType type) std::string res = ""; switch (type) { - case SCRIPTS_QUEST_END: res = "quest_end_scripts"; break; case SCRIPTS_SPELL: res = "spell_scripts"; break; - case SCRIPTS_GAMEOBJECT: res = "gameobject_scripts"; break; case SCRIPTS_EVENT: res = "event_scripts"; break; case SCRIPTS_WAYPOINT: res = "waypoint_scripts"; break; default: break; @@ -75,9 +71,7 @@ ScriptMapMap* GetScriptsMapByType(ScriptsType type) ScriptMapMap* res = NULL; switch (type) { - case SCRIPTS_QUEST_END: res = &sQuestEndScripts; break; case SCRIPTS_SPELL: res = &sSpellScripts; break; - case SCRIPTS_GAMEOBJECT: res = &sGameObjectScripts; break; case SCRIPTS_EVENT: res = &sEventScripts; break; case SCRIPTS_WAYPOINT: res = &sWaypointScripts; break; default: break; @@ -121,7 +115,7 @@ std::string GetScriptCommandName(ScriptCommands command) default: { char sz[32]; - sprintf(sz, "Unknown command: %u", command); + sprintf(sz, "Unknown command: %d", command); res = sz; break; } @@ -1658,7 +1652,7 @@ bool ObjectMgr::MoveCreData(uint32 guid, uint32 mapId, Position pos) Creature* creature = new Creature; if (!creature->LoadCreatureFromDB(guid, map)) { - sLog->outError(LOG_FILTER_GENERAL, "AddCreature: cannot add creature entry %u to map", guid); + sLog->outError(LOG_FILTER_GENERAL, "MoveCreData: Cannot add creature guid %u to map", guid); delete creature; return false; } @@ -1710,7 +1704,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float Creature* creature = new Creature; if (!creature->LoadCreatureFromDB(guid, map)) { - sLog->outError(LOG_FILTER_GENERAL, "AddCreature: cannot add creature entry %u to map", entry); + sLog->outError(LOG_FILTER_GENERAL, "AddCreature: Cannot add creature entry %u to map", entry); delete creature; return 0; } @@ -1736,7 +1730,6 @@ void ObjectMgr::LoadGameobjects() if (!result) { sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gameobjects. DB table `gameobject` is empty."); - return; } @@ -3659,13 +3652,12 @@ void ObjectMgr::LoadQuests() "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, EmoteOnIncomplete, EmoteOnComplete, " // 136 137 138 139 140 141 142 143 "OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, " - // 144 145 - "CompleteScript, WDBVerified" + // 144 + "WDBVerified" " FROM quest_template"); if (!result) { sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 quests definitions. DB table `quest_template` is empty."); - return; } @@ -4311,7 +4303,7 @@ void ObjectMgr::LoadQuestLocales() _questLocaleStore.clear(); // need for reload case - QueryResult result = WorldDatabase.Query("SELECT entry, " + QueryResult result = WorldDatabase.Query("SELECT Id, " "Title_loc1, Details_loc1, Objectives_loc1, OfferRewardText_loc1, RequestItemsText_loc1, EndText_loc1, CompletedText_loc1, ObjectiveText1_loc1, ObjectiveText2_loc1, ObjectiveText3_loc1, ObjectiveText4_loc1, " "Title_loc2, Details_loc2, Objectives_loc2, OfferRewardText_loc2, RequestItemsText_loc2, EndText_loc2, CompletedText_loc2, ObjectiveText1_loc2, ObjectiveText2_loc2, ObjectiveText3_loc2, ObjectiveText4_loc2, " "Title_loc3, Details_loc3, Objectives_loc3, OfferRewardText_loc3, RequestItemsText_loc3, EndText_loc3, CompletedText_loc3, ObjectiveText1_loc3, ObjectiveText2_loc3, ObjectiveText3_loc3, ObjectiveText4_loc3, " @@ -4672,30 +4664,6 @@ void ObjectMgr::LoadScripts(ScriptsType type) sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u script definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } -void ObjectMgr::LoadGameObjectScripts() -{ - LoadScripts(SCRIPTS_GAMEOBJECT); - - // check ids - for (ScriptMapMap::const_iterator itr = sGameObjectScripts.begin(); itr != sGameObjectScripts.end(); ++itr) - { - if (!GetGOData(itr->first)) - sLog->outError(LOG_FILTER_SQL, "Table `gameobject_scripts` has not existing gameobject (GUID: %u) as script id", itr->first); - } -} - -void ObjectMgr::LoadQuestEndScripts() -{ - LoadScripts(SCRIPTS_QUEST_END); - - // check ids - for (ScriptMapMap::const_iterator itr = sQuestEndScripts.begin(); itr != sQuestEndScripts.end(); ++itr) - { - if (!GetQuestTemplate(itr->first)) - sLog->outError(LOG_FILTER_SQL, "Table `quest_end_scripts` has not existing quest (Id: %u) as script id", itr->first); - } -} - void ObjectMgr::LoadSpellScripts() { LoadScripts(SCRIPTS_SPELL); @@ -5178,7 +5146,7 @@ void ObjectMgr::LoadNpcTextLocales() _npcTextLocaleStore.clear(); // need for reload case - QueryResult result = WorldDatabase.Query("SELECT entry, " + QueryResult result = WorldDatabase.Query("SELECT ID, " "Text0_0_loc1, Text0_1_loc1, Text1_0_loc1, Text1_1_loc1, Text2_0_loc1, Text2_1_loc1, Text3_0_loc1, Text3_1_loc1, Text4_0_loc1, Text4_1_loc1, Text5_0_loc1, Text5_1_loc1, Text6_0_loc1, Text6_1_loc1, Text7_0_loc1, Text7_1_loc1, " "Text0_0_loc2, Text0_1_loc2, Text1_0_loc2, Text1_1_loc2, Text2_0_loc2, Text2_1_loc2, Text3_0_loc2, Text3_1_loc1, Text4_0_loc2, Text4_1_loc2, Text5_0_loc2, Text5_1_loc2, Text6_0_loc2, Text6_1_loc2, Text7_0_loc2, Text7_1_loc2, " "Text0_0_loc3, Text0_1_loc3, Text1_0_loc3, Text1_1_loc3, Text2_0_loc3, Text2_1_loc3, Text3_0_loc3, Text3_1_loc1, Text4_0_loc3, Text4_1_loc3, Text5_0_loc3, Text5_1_loc3, Text6_0_loc3, Text6_1_loc3, Text7_0_loc3, Text7_1_loc3, " @@ -5672,12 +5640,11 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float // then check faction // if mapId != graveyard.mapId (ghost in instance) and search any graveyard associated // then check faction - GraveYardContainer::const_iterator graveLow = GraveYardStore.lower_bound(zoneId); - GraveYardContainer::const_iterator graveUp = GraveYardStore.upper_bound(zoneId); + GraveYardMapBounds range = GraveYardStore.equal_range(zoneId); MapEntry const* map = sMapStore.LookupEntry(MapId); - // not need to check validity of map object; MapId _MUST_ be valid here - if (graveLow == graveUp && !map->IsBattleArena()) + // not need to check validity of map object; MapId _MUST_ be valid here + if (range.first == range.second && !map->IsBattleArena()) { sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team); return GetDefaultGraveYard(team); @@ -5698,9 +5665,9 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float MapEntry const* mapEntry = sMapStore.LookupEntry(MapId); - for (GraveYardContainer::const_iterator itr = graveLow; itr != graveUp; ++itr) + for (; range.first != range.second; ++range.first) { - GraveYardData const& data = itr->second; + GraveYardData const& data = range.first->second; WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(data.safeLocId); if (!entry) @@ -5778,15 +5745,13 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float GraveYardData const* ObjectMgr::FindGraveYardData(uint32 id, uint32 zoneId) { - GraveYardContainer::const_iterator graveLow = GraveYardStore.lower_bound(zoneId); - GraveYardContainer::const_iterator graveUp = GraveYardStore.upper_bound(zoneId); - - for (GraveYardContainer::const_iterator itr = graveLow; itr != graveUp; ++itr) + GraveYardMapBounds range = GraveYardStore.equal_range(zoneId); + for (; range.first != range.second; ++range.first) { - if (itr->second.safeLocId == id) - return &itr->second; + GraveYardData const& data = range.first->second; + if (data.safeLocId == id) + return &data; } - return NULL; } @@ -5819,9 +5784,8 @@ bool ObjectMgr::AddGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool per void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool persist /*= false*/) { - GraveYardContainer::iterator graveLow = GraveYardStore.lower_bound(zoneId); - GraveYardContainer::iterator graveUp = GraveYardStore.upper_bound(zoneId); - if (graveLow == graveUp) + GraveYardMapBoundsNonConst range = GraveYardStore.equal_range(zoneId); + if (range.first == range.second) { //sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team); return; @@ -5829,11 +5793,10 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool bool found = false; - GraveYardContainer::iterator itr; - for (itr = graveLow; itr != graveUp; ++itr) + for (; range.first != range.second; ++range.first) { - GraveYardData & data = itr->second; + GraveYardData & data = range.first->second; // skip not matching safezone id if (data.safeLocId != id) @@ -5853,7 +5816,7 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool return; // remove from links - GraveYardStore.erase(itr); + GraveYardStore.erase(range.first); // remove link from DB if (persist) @@ -8220,7 +8183,7 @@ void ObjectMgr::AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 if (persist) { - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_NPC_VENODR); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_NPC_VENDOR); stmt->setUInt32(0, entry); stmt->setUInt32(1, item); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index e1df03b97b0..9339684964c 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -127,9 +127,7 @@ enum ScriptsType { SCRIPTS_FIRST = 1, - SCRIPTS_QUEST_END = SCRIPTS_FIRST, - SCRIPTS_SPELL, - SCRIPTS_GAMEOBJECT, + SCRIPTS_SPELL = SCRIPTS_FIRST, SCRIPTS_EVENT, SCRIPTS_WAYPOINT, @@ -361,9 +359,7 @@ typedef std::multimap<uint32, ScriptInfo> ScriptMap; typedef std::map<uint32, ScriptMap > ScriptMapMap; typedef std::multimap<uint32, uint32> SpellScriptsContainer; typedef std::pair<SpellScriptsContainer::iterator, SpellScriptsContainer::iterator> SpellScriptsBounds; -extern ScriptMapMap sQuestEndScripts; extern ScriptMapMap sSpellScripts; -extern ScriptMapMap sGameObjectScripts; extern ScriptMapMap sEventScripts; extern ScriptMapMap sWaypointScripts; @@ -566,6 +562,8 @@ struct GraveYardData }; typedef std::multimap<uint32, GraveYardData> GraveYardContainer; +typedef std::pair<GraveYardContainer::const_iterator, GraveYardContainer::const_iterator> GraveYardMapBounds; +typedef std::pair<GraveYardContainer::iterator, GraveYardContainer::iterator> GraveYardMapBoundsNonConst; typedef UNORDERED_MAP<uint32, VendorItemData> CacheVendorItemContainer; typedef UNORDERED_MAP<uint32, TrainerSpellData> CacheTrainerSpellContainer; @@ -863,8 +861,6 @@ class ObjectMgr return _creatureQuestInvolvedRelations.equal_range(creature_entry); } - void LoadGameObjectScripts(); - void LoadQuestEndScripts(); void LoadEventScripts(); void LoadSpellScripts(); void LoadWaypointScripts(); @@ -963,6 +959,8 @@ class ObjectMgr uint32 GeneratePetNumber(); typedef std::multimap<int32, uint32> ExclusiveQuestGroups; + typedef std::pair<ExclusiveQuestGroups::const_iterator, ExclusiveQuestGroups::const_iterator> ExclusiveQuestGroupsBounds; + ExclusiveQuestGroups mExclusiveQuestGroups; MailLevelReward const* GetMailLevelReward(uint32 level, uint32 raceMask) @@ -1117,7 +1115,7 @@ class ObjectMgr VendorItemData const* GetNpcVendorItemList(uint32 entry) const { - CacheVendorItemContainer::const_iterator iter = _cacheVendorItemStore.find(entry); + CacheVendorItemContainer::const_iterator iter = _cacheVendorItemStore.find(entry); if (iter == _cacheVendorItemStore.end()) return NULL; @@ -1134,26 +1132,26 @@ class ObjectMgr SpellClickInfoMapBounds GetSpellClickInfoMapBounds(uint32 creature_id) const { - return SpellClickInfoMapBounds(_spellClickInfoStore.lower_bound(creature_id), _spellClickInfoStore.upper_bound(creature_id)); + return _spellClickInfoStore.equal_range(creature_id); } GossipMenusMapBounds GetGossipMenusMapBounds(uint32 uiMenuId) const { - return GossipMenusMapBounds(_gossipMenusStore.lower_bound(uiMenuId), _gossipMenusStore.upper_bound(uiMenuId)); + return _gossipMenusStore.equal_range(uiMenuId); } GossipMenusMapBoundsNonConst GetGossipMenusMapBoundsNonConst(uint32 uiMenuId) { - return GossipMenusMapBoundsNonConst(_gossipMenusStore.lower_bound(uiMenuId), _gossipMenusStore.upper_bound(uiMenuId)); + return _gossipMenusStore.equal_range(uiMenuId); } GossipMenuItemsMapBounds GetGossipMenuItemsMapBounds(uint32 uiMenuId) const { - return GossipMenuItemsMapBounds(_gossipMenuItemsStore.lower_bound(uiMenuId), _gossipMenuItemsStore.upper_bound(uiMenuId)); + return _gossipMenuItemsStore.equal_range(uiMenuId); } GossipMenuItemsMapBoundsNonConst GetGossipMenuItemsMapBoundsNonConst(uint32 uiMenuId) { - return GossipMenuItemsMapBoundsNonConst(_gossipMenuItemsStore.lower_bound(uiMenuId), _gossipMenuItemsStore.upper_bound(uiMenuId)); + return _gossipMenuItemsStore.equal_range(uiMenuId); } // for wintergrasp only diff --git a/src/server/game/Grids/Cells/Cell.h b/src/server/game/Grids/Cells/Cell.h index 67b862845b9..33a26c62ce0 100644 --- a/src/server/game/Grids/Cells/Cell.h +++ b/src/server/game/Grids/Cells/Cell.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Grids/Cells/CellImpl.h b/src/server/game/Grids/Cells/CellImpl.h index b224b3865e0..b399155b476 100644 --- a/src/server/game/Grids/Cells/CellImpl.h +++ b/src/server/game/Grids/Cells/CellImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Grids/Grid.h b/src/server/game/Grids/Grid.h index d9350e9e897..0a5e84b8ded 100644 --- a/src/server/game/Grids/Grid.h +++ b/src/server/game/Grids/Grid.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Grids/GridDefines.h b/src/server/game/Grids/GridDefines.h index 7bd0da34a46..14c0588c3b4 100644 --- a/src/server/game/Grids/GridDefines.h +++ b/src/server/game/Grids/GridDefines.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Grids/GridLoader.h b/src/server/game/Grids/GridLoader.h index 85393872eb9..2c10118fcad 100644 --- a/src/server/game/Grids/GridLoader.h +++ b/src/server/game/Grids/GridLoader.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Grids/GridRefManager.h b/src/server/game/Grids/GridRefManager.h index 66b6313c997..61f476577e0 100644 --- a/src/server/game/Grids/GridRefManager.h +++ b/src/server/game/Grids/GridRefManager.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Grids/GridReference.h b/src/server/game/Grids/GridReference.h index 107bddf04eb..3d662684060 100644 --- a/src/server/game/Grids/GridReference.h +++ b/src/server/game/Grids/GridReference.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Grids/GridStates.cpp b/src/server/game/Grids/GridStates.cpp index c2f66bc3e8a..e4f995cd8d2 100644 --- a/src/server/game/Grids/GridStates.cpp +++ b/src/server/game/Grids/GridStates.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Grids/GridStates.h b/src/server/game/Grids/GridStates.h index ad888b26dd3..54fe0d62378 100644 --- a/src/server/game/Grids/GridStates.h +++ b/src/server/game/Grids/GridStates.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Grids/NGrid.h b/src/server/game/Grids/NGrid.h index 0ef885703be..f64c54c8c43 100644 --- a/src/server/game/Grids/NGrid.h +++ b/src/server/game/Grids/NGrid.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp index 1cd442e48f9..24f8cbda1a2 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp +++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 752c6ec068e..d2069a7f5f4 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -1087,6 +1087,35 @@ namespace Trinity NearestHostileUnitInAttackDistanceCheck(NearestHostileUnitInAttackDistanceCheck const&); }; + class NearestHostileUnitInAggroRangeCheck + { + public: + explicit NearestHostileUnitInAggroRangeCheck(Creature const* creature, bool useLOS = false) : _me(creature), _useLOS(useLOS) + { + } + bool operator()(Unit* u) + { + if (!u->IsHostileTo(_me)) + return false; + + if (!u->IsWithinDistInMap(_me, _me->GetAggroRange(u))) + return false; + + if (!_me->IsValidAttackTarget(u)) + return false; + + if (_useLOS && !u->IsWithinLOSInMap(_me)) + return false; + + return true; + } + + private: + Creature const* _me; + bool _useLOS; + NearestHostileUnitInAggroRangeCheck(NearestHostileUnitInAggroRangeCheck const&); + }; + class AnyAssistCreatureInRangeCheck { public: diff --git a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h index 2d60678d4ff..40b2df3706b 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h +++ b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Grids/ObjectGridLoader.cpp b/src/server/game/Grids/ObjectGridLoader.cpp index 3b2d59dd998..3fb74b6fdcc 100644 --- a/src/server/game/Grids/ObjectGridLoader.cpp +++ b/src/server/game/Grids/ObjectGridLoader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Grids/ObjectGridLoader.h b/src/server/game/Grids/ObjectGridLoader.h index f768bd0826b..11f91670a5f 100644 --- a/src/server/game/Grids/ObjectGridLoader.h +++ b/src/server/game/Grids/ObjectGridLoader.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 13c656a4aa3..734a1bfbaad 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -1993,28 +1993,24 @@ InstanceGroupBind* Group::GetBoundInstance(Map* aMap) { // Currently spawn numbering not different from map difficulty Difficulty difficulty = GetDifficulty(aMap->IsRaid()); - - // some instances only have one difficulty - GetDownscaledMapDifficultyData(aMap->GetId(), difficulty); - - BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(aMap->GetId()); - if (itr != m_boundInstances[difficulty].end()) - return &itr->second; - else - return NULL; + return GetBoundInstance(difficulty, aMap->GetId()); } InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry) { - if (!mapEntry) + if (!mapEntry || !mapEntry->IsDungeon()) return NULL; Difficulty difficulty = GetDifficulty(mapEntry->IsRaid()); + return GetBoundInstance(difficulty, mapEntry->MapID); +} +InstanceGroupBind* Group::GetBoundInstance(Difficulty difficulty, uint32 mapId) +{ // some instances only have one difficulty - GetDownscaledMapDifficultyData(mapEntry->MapID, difficulty); + GetDownscaledMapDifficultyData(mapId, difficulty); - BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapEntry->MapID); + BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapId); if (itr != m_boundInstances[difficulty].end()) return &itr->second; else diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index 3421e12a9a4..e81afe78513 100644 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -301,6 +301,7 @@ class Group InstanceGroupBind* GetBoundInstance(Player* player); InstanceGroupBind* GetBoundInstance(Map* aMap); InstanceGroupBind* GetBoundInstance(MapEntry const* mapEntry); + InstanceGroupBind* GetBoundInstance(Difficulty difficulty, uint32 mapId); BoundInstancesMap& GetBoundInstances(Difficulty difficulty); // FG: evil hacks diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp index 8283075a226..3892e28ac49 100644 --- a/src/server/game/Groups/GroupMgr.cpp +++ b/src/server/game/Groups/GroupMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Groups/GroupMgr.h b/src/server/game/Groups/GroupMgr.h index ba706687441..3b3371bb17e 100644 --- a/src/server/game/Groups/GroupMgr.h +++ b/src/server/game/Groups/GroupMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Groups/GroupRefManager.h b/src/server/game/Groups/GroupRefManager.h index d9fef8611de..99fdcd31cd7 100644 --- a/src/server/game/Groups/GroupRefManager.h +++ b/src/server/game/Groups/GroupRefManager.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Groups/GroupReference.cpp b/src/server/game/Groups/GroupReference.cpp index 68d85c5bce9..c2f3332f408 100644 --- a/src/server/game/Groups/GroupReference.cpp +++ b/src/server/game/Groups/GroupReference.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Groups/GroupReference.h b/src/server/game/Groups/GroupReference.h index 7960dd21035..6c68710aeb5 100644 --- a/src/server/game/Groups/GroupReference.h +++ b/src/server/game/Groups/GroupReference.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 8609e1a7735..fc80a7d7635 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 2f43245159b..6af397f6fed 100644 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index 0a1eb415ee6..41e3d29e4ac 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Guilds/GuildMgr.h b/src/server/game/Guilds/GuildMgr.h index f5fa4680039..0c99fde2ecc 100644 --- a/src/server/game/Guilds/GuildMgr.h +++ b/src/server/game/Guilds/GuildMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Handlers/AddonHandler.cpp b/src/server/game/Handlers/AddonHandler.cpp index c3ffeace3fb..7e62280f17c 100644 --- a/src/server/game/Handlers/AddonHandler.cpp +++ b/src/server/game/Handlers/AddonHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/AddonHandler.h b/src/server/game/Handlers/AddonHandler.h index 36cb19e5698..33afe989da1 100644 --- a/src/server/game/Handlers/AddonHandler.h +++ b/src/server/game/Handlers/AddonHandler.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/ArenaTeamHandler.cpp b/src/server/game/Handlers/ArenaTeamHandler.cpp index e3ccee35b47..45ea92b65c3 100644 --- a/src/server/game/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Handlers/ArenaTeamHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 3c38ff8460e..6fc88f441bb 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/AuthHandler.cpp b/src/server/game/Handlers/AuthHandler.cpp index 49027bdf497..880937c2c39 100644 --- a/src/server/game/Handlers/AuthHandler.cpp +++ b/src/server/game/Handlers/AuthHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index 12f4e6ffa82..a7df171b1c5 100644 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -499,7 +499,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) } } -void WorldSession::HandleLeaveBattlefieldOpcode(WorldPacket& recvData) +void WorldSession::HandleBattlefieldLeaveOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LEAVE_BATTLEFIELD Message"); diff --git a/src/server/game/Handlers/BattlefieldHandler.cpp b/src/server/game/Handlers/BattlefieldHandler.cpp index c4225551311..0263b64456f 100644 --- a/src/server/game/Handlers/BattlefieldHandler.cpp +++ b/src/server/game/Handlers/BattlefieldHandler.cpp @@ -1,6 +1,5 @@ /* - * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 876a0fc4463..9dbc4bec199 100644 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/ChannelHandler.cpp b/src/server/game/Handlers/ChannelHandler.cpp index 462bc7fff0b..883c9444895 100644 --- a/src/server/game/Handlers/ChannelHandler.cpp +++ b/src/server/game/Handlers/ChannelHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 0e9ad902d8f..d8e50be11f0 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -67,9 +67,8 @@ bool LoginQueryHolder::Initialize() bool res = true; uint32 lowGuid = GUID_LOPART(m_guid); - PreparedStatement* stmt = NULL; - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER); stmt->setUInt32(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_FROM, stmt); @@ -1806,7 +1805,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) if (recvData.GetOpcode() == CMSG_CHAR_FACTION_CHANGE) { // Delete all Flypaths - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_TAXI_PATH); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_TAXI_PATH); stmt->setUInt32(0, lowGuid); trans->Append(stmt); @@ -1851,7 +1850,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) taximaskstream << '0'; std::string taximask = taximaskstream.str(); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_TAXIMASK); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_TAXIMASK); stmt->setString(0, taximask); stmt->setUInt32(1, lowGuid); trans->Append(stmt); @@ -1898,7 +1897,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD)) { // Reset guild - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER); stmt->setUInt32(0, lowGuid); @@ -1911,7 +1910,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND)) { // Delete Friend List - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SOCIAL_BY_GUID); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SOCIAL_BY_GUID); stmt->setUInt32(0, lowGuid); trans->Append(stmt); @@ -1957,7 +1956,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) uint32 achiev_alliance = it->first; uint32 achiev_horde = it->second; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT); stmt->setUInt16(0, uint16(team == TEAM_ALLIANCE ? achiev_alliance : achiev_horde)); stmt->setUInt32(1, lowGuid); trans->Append(stmt); @@ -1975,7 +1974,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) uint32 item_alliance = it->first; uint32 item_horde = it->second; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_INVENTORY_FACTION_CHANGE); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_INVENTORY_FACTION_CHANGE); stmt->setUInt32(0, (team == TEAM_ALLIANCE ? item_alliance : item_horde)); stmt->setUInt32(1, (team == TEAM_ALLIANCE ? item_horde : item_alliance)); stmt->setUInt32(2, guid); @@ -1988,7 +1987,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) uint32 spell_alliance = it->first; uint32 spell_horde = it->second; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL_BY_SPELL); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL_BY_SPELL); stmt->setUInt32(0, (team == TEAM_ALLIANCE ? spell_alliance : spell_horde)); stmt->setUInt32(1, lowGuid); trans->Append(stmt); @@ -2009,7 +2008,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) uint32 oldReputation = (team == TEAM_ALLIANCE) ? reputation_horde : reputation_alliance; // select old standing set in db - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_REP_BY_FACTION); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_REP_BY_FACTION); stmt->setUInt32(0, oldReputation); stmt->setUInt32(1, lowGuid); PreparedQueryResult result = CharacterDatabase.Query(stmt); @@ -2101,7 +2100,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) for (uint32 index = 0; index < ktcount; ++index) ss << knownTitles[index] << ' '; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_TITLES_FACTION_CHANGE); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_TITLES_FACTION_CHANGE); stmt->setString(0, ss.str().c_str()); stmt->setUInt32(1, lowGuid); trans->Append(stmt); diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index e4989816998..d04d365504d 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -440,40 +440,51 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) } break; case CHAT_MSG_AFK: { - if ((msg.empty() || !_player->isAFK()) && !_player->isInCombat()) + if (!_player->isInCombat()) { - if (!_player->isAFK()) + if (_player->isAFK()) // Already AFK { if (msg.empty()) - msg = GetTrinityString(LANG_PLAYER_AFK_DEFAULT); - _player->afkMsg = msg; + _player->ToggleAFK(); // Remove AFK + else + _player->autoReplyMsg = msg; // Update message } + else // New AFK mode + { + _player->autoReplyMsg = msg.empty() ? GetTrinityString(LANG_PLAYER_AFK_DEFAULT) : msg; - sScriptMgr->OnPlayerChat(_player, type, lang, msg); + if (_player->isDND()) + _player->ToggleDND(); + + _player->ToggleAFK(); + } - _player->ToggleAFK(); - if (_player->isAFK() && _player->isDND()) - _player->ToggleDND(); + sScriptMgr->OnPlayerChat(_player, type, lang, msg); } - } break; + break; + } case CHAT_MSG_DND: { - if (msg.empty() || !_player->isDND()) + if (_player->isDND()) // Already DND { - if (!_player->isDND()) - { - if (msg.empty()) - msg = GetTrinityString(LANG_PLAYER_DND_DEFAULT); - _player->dndMsg = msg; - } + if (msg.empty()) + _player->ToggleDND(); // Remove DND + else + _player->autoReplyMsg = msg; // Update message + } + else // New DND mode + { + _player->autoReplyMsg = msg.empty() ? GetTrinityString(LANG_PLAYER_DND_DEFAULT) : msg; - sScriptMgr->OnPlayerChat(_player, type, lang, msg); + if (_player->isAFK()) + _player->ToggleAFK(); _player->ToggleDND(); - if (_player->isDND() && _player->isAFK()) - _player->ToggleAFK(); } - } break; + + sScriptMgr->OnPlayerChat(_player, type, lang, msg); + break; + } default: sLog->outError(LOG_FILTER_NETWORKIO, "CHAT: unknown message type %u, lang: %u", type, lang); break; diff --git a/src/server/game/Handlers/CombatHandler.cpp b/src/server/game/Handlers/CombatHandler.cpp index d30164b2592..bf44c8cc622 100644 --- a/src/server/game/Handlers/CombatHandler.cpp +++ b/src/server/game/Handlers/CombatHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/DuelHandler.cpp b/src/server/game/Handlers/DuelHandler.cpp index bdfb2369198..80dcf513f10 100644 --- a/src/server/game/Handlers/DuelHandler.cpp +++ b/src/server/game/Handlers/DuelHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 5b517e1d726..89f77e784b9 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 929a31938d2..f57a5ce020f 100644 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 2053f14e814..77d44dffd1b 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/LFGHandler.cpp b/src/server/game/Handlers/LFGHandler.cpp index 3f33b60329b..0654ae326f9 100644 --- a/src/server/game/Handlers/LFGHandler.cpp +++ b/src/server/game/Handlers/LFGHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -23,7 +23,7 @@ #include "WorldPacket.h" #include "WorldSession.h" -void BuildPlayerLockDungeonBlock(WorldPacket& data, const LfgLockMap& lock) +void BuildPlayerLockDungeonBlock(WorldPacket& data, LfgLockMap const& lock) { data << uint32(lock.size()); // Size of lock dungeons for (LfgLockMap::const_iterator it = lock.begin(); it != lock.end(); ++it) @@ -54,7 +54,6 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recvData) } uint8 numDungeons; - uint32 dungeon; uint32 roles; recvData >> roles; @@ -70,6 +69,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recvData) LfgDungeonSet newDungeons; for (int8 i = 0; i < numDungeons; ++i) { + uint32 dungeon; recvData >> dungeon; newDungeons.insert((dungeon & 0x00FFFFFF)); // remove the type from the dungeon entry } @@ -80,20 +80,21 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recvData) recvData >> comment; sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_JOIN %s roles: %u, Dungeons: %u, Comment: %s", GetPlayerInfo().c_str(), roles, uint8(newDungeons.size()), comment.c_str()); + sLFGMgr->JoinLfg(GetPlayer(), uint8(roles), newDungeons, comment); } void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recvData*/) { - Group* grp = GetPlayer()->GetGroup(); + Group* group = GetPlayer()->GetGroup(); uint64 guid = GetPlayer()->GetGUID(); - uint64 gguid = grp ? grp->GetGUID() : guid; + uint64 gguid = group ? group->GetGUID() : guid; sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_LEAVE %s in group: %u", - GetPlayerInfo().c_str(), grp ? 1 : 0); + GetPlayerInfo().c_str(), group ? 1 : 0); // Check cheating - only leader can leave the queue - if (!grp || grp->GetLeaderGUID() == GetPlayer()->GetGUID()) + if (!group || group->GetLeaderGUID() == GetPlayer()->GetGUID()) sLFGMgr->LeaveLfg(gguid); } @@ -114,14 +115,14 @@ void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recvData) uint8 roles; recvData >> roles; // Player Group Roles uint64 guid = GetPlayer()->GetGUID(); - Group* grp = GetPlayer()->GetGroup(); - if (!grp) + Group* group = GetPlayer()->GetGroup(); + if (!group) { sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_SET_ROLES %s Not in group", GetPlayerInfo().c_str()); return; } - uint64 gguid = grp->GetGUID(); + uint64 gguid = group->GetGUID(); sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_SET_ROLES: Group %u, Player %s, Roles: %u", GUID_LOPART(gguid), GetPlayerInfo().c_str(), roles); sLFGMgr->UpdateRoleCheck(gguid, guid, roles); @@ -131,11 +132,11 @@ void WorldSession::HandleLfgSetCommentOpcode(WorldPacket& recvData) { std::string comment; recvData >> comment; - uint64 guid = GetPlayer()->GetGUID(); + sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_SET_COMMENT %s comment: %s", GetPlayerInfo().c_str(), comment.c_str()); - sLFGMgr->SetComment(guid, comment); + sLFGMgr->SetComment(GetPlayer()->GetGUID(), comment); } void WorldSession::HandleLfgSetBootVoteOpcode(WorldPacket& recvData) @@ -193,15 +194,15 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData* data << uint32(*it); // Dungeon Entry (id + type) LfgReward const* reward = sLFGMgr->GetRandomDungeonReward(*it, level); Quest const* quest = NULL; - uint8 done = 0; + bool done = false; if (reward) { - quest = sObjectMgr->GetQuestTemplate(reward->reward[0].questId); + quest = sObjectMgr->GetQuestTemplate(reward->firstQuest); if (quest) { done = !GetPlayer()->CanRewardQuest(quest, false); if (done) - quest = sObjectMgr->GetQuestTemplate(reward->reward[1].questId); + quest = sObjectMgr->GetQuestTemplate(reward->otherQuest); } } @@ -210,8 +211,8 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData* data << uint8(done); data << uint32(quest->GetRewOrReqMoney()); data << uint32(quest->XPValue(GetPlayer())); - data << uint32(reward->reward[done].variableMoney); - data << uint32(reward->reward[done].variableXP); + data << uint32(0); + data << uint32(0); data << uint8(quest->GetRewItemsCount()); if (quest->GetRewItemsCount()) { @@ -244,13 +245,13 @@ void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recvData* uint64 guid = GetPlayer()->GetGUID(); sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_PARTY_LOCK_INFO_REQUEST %s", GetPlayerInfo().c_str()); - Group* grp = GetPlayer()->GetGroup(); - if (!grp) + Group* group = GetPlayer()->GetGroup(); + if (!group) return; // Get the locked dungeons of the other party members LfgLockPartyMap lockMap; - for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) + for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { Player* plrg = itr->getSource(); if (!plrg) @@ -312,7 +313,7 @@ void WorldSession::HandleLfgGetStatus(WorldPacket& /*recvData*/) } } -void WorldSession::SendLfgUpdatePlayer(const LfgUpdateData& updateData) +void WorldSession::SendLfgUpdatePlayer(LfgUpdateData const& updateData) { bool queued = false; uint8 size = uint8(updateData.dungeons.size()); @@ -457,7 +458,7 @@ void WorldSession::SendLfgRoleCheckUpdate(const LfgRoleCheck& roleCheck) SendPacket(&data); } -void WorldSession::SendLfgJoinResult(const LfgJoinResultData& joinData) +void WorldSession::SendLfgJoinResult(LfgJoinResultData const& joinData) { uint32 size = 0; for (LfgLockPartyMap::const_iterator it = joinData.lockmap.begin(); it != joinData.lockmap.end(); ++it) @@ -465,6 +466,7 @@ void WorldSession::SendLfgJoinResult(const LfgJoinResultData& joinData) sLog->outDebug(LOG_FILTER_LFG, "SMSG_LFG_JOIN_RESULT %s checkResult: %u checkValue: %u", GetPlayerInfo().c_str(), joinData.result, joinData.state); + WorldPacket data(SMSG_LFG_JOIN_RESULT, 4 + 4 + size); data << uint32(joinData.result); // Check Result data << uint32(joinData.state); // Check Value @@ -473,10 +475,14 @@ void WorldSession::SendLfgJoinResult(const LfgJoinResultData& joinData) SendPacket(&data); } -void WorldSession::SendLfgQueueStatus(const LfgQueueStatusData& queueData) +void WorldSession::SendLfgQueueStatus(LfgQueueStatusData const& queueData) { - sLog->outDebug(LOG_FILTER_LFG, "SMSG_LFG_QUEUE_STATUS %s dungeon: %u - waitTime: %d - avgWaitTime: %d - waitTimeTanks: %d - waitTimeHealer: %d - waitTimeDps: %d - queuedTime: %u - tanks: %u - healers: %u - dps: %u", - GetPlayerInfo().c_str(), queueData.dungeonId, queueData.waitTime, queueData.waitTimeAvg, queueData.waitTimeTank, queueData.waitTimeHealer, queueData.waitTimeDps, queueData.queuedTime, queueData.tanks, queueData.healers, queueData.dps); + sLog->outDebug(LOG_FILTER_LFG, "SMSG_LFG_QUEUE_STATUS %s dungeon: %u, waitTime: %d, " + "avgWaitTime: %d, waitTimeTanks: %d, waitTimeHealer: %d, waitTimeDps: %d, " + "queuedTime: %u, tanks: %u, healers: %u, dps: %u", + GetPlayerInfo().c_str(), queueData.dungeonId, queueData.waitTime, queueData.waitTimeAvg, + queueData.waitTimeTank, queueData.waitTimeHealer, queueData.waitTimeDps, + queueData.queuedTime, queueData.tanks, queueData.healers, queueData.dps); WorldPacket data(SMSG_LFG_QUEUE_STATUS, 4 + 4 + 4 + 4 + 4 +4 + 1 + 1 + 1 + 4); data << uint32(queueData.dungeonId); // Dungeon @@ -492,40 +498,41 @@ void WorldSession::SendLfgQueueStatus(const LfgQueueStatusData& queueData) SendPacket(&data); } -void WorldSession::SendLfgPlayerReward(uint32 rdungeonEntry, uint32 sdungeonEntry, uint8 done, const LfgReward* reward, const Quest* quest) +void WorldSession::SendLfgPlayerReward(LfgPlayerRewardData const& rewardData) { - if (!rdungeonEntry || !sdungeonEntry || !quest) + if (!rewardData.rdungeonEntry || !rewardData.sdungeonEntry || !rewardData.quest) return; - uint8 itemNum = uint8(quest ? quest->GetRewItemsCount() : 0); + sLog->outDebug(LOG_FILTER_LFG, "SMSG_LFG_PLAYER_REWARD %s rdungeonEntry: %u, sdungeonEntry: %u, done: %u", + GetPlayerInfo().c_str(), rewardData.rdungeonEntry, rewardData.sdungeonEntry, rewardData.done); + + uint8 itemNum = rewardData.quest->GetRewItemsCount(); - sLog->outDebug(LOG_FILTER_LFG, "SMSG_LFG_PLAYER_REWARD %s rdungeonEntry: %u - sdungeonEntry: %u - done: %u", - GetPlayerInfo().c_str(), rdungeonEntry, sdungeonEntry, done); WorldPacket data(SMSG_LFG_PLAYER_REWARD, 4 + 4 + 1 + 4 + 4 + 4 + 4 + 4 + 1 + itemNum * (4 + 4 + 4)); - data << uint32(rdungeonEntry); // Random Dungeon Finished - data << uint32(sdungeonEntry); // Dungeon Finished - data << uint8(done); + data << uint32(rewardData.rdungeonEntry); // Random Dungeon Finished + data << uint32(rewardData.sdungeonEntry); // Dungeon Finished + data << uint8(rewardData.done); data << uint32(1); - data << uint32(quest->GetRewOrReqMoney()); - data << uint32(quest->XPValue(GetPlayer())); - data << uint32(reward->reward[done].variableMoney); - data << uint32(reward->reward[done].variableXP); + data << uint32(rewardData.quest->GetRewOrReqMoney()); + data << uint32(rewardData.quest->XPValue(GetPlayer())); + data << uint32(0); + data << uint32(0); data << uint8(itemNum); if (itemNum) { for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) - if (uint32 itemId = quest->RewardItemId[i]) + if (uint32 itemId = rewardData.quest->RewardItemId[i]) { ItemTemplate const* item = sObjectMgr->GetItemTemplate(itemId); data << uint32(itemId); data << uint32(item ? item->DisplayInfoID : 0); - data << uint32(quest->RewardItemIdCount[i]); + data << uint32(rewardData.quest->RewardItemIdCount[i]); } } SendPacket(&data); } -void WorldSession::SendLfgBootProposalUpdate(const LfgPlayerBoot& boot) +void WorldSession::SendLfgBootProposalUpdate(LfgPlayerBoot const& boot) { uint64 guid = GetPlayer()->GetGUID(); LfgAnswer playerVote = boot.votes.find(guid)->second; @@ -560,7 +567,7 @@ void WorldSession::SendLfgBootProposalUpdate(const LfgPlayerBoot& boot) SendPacket(&data); } -void WorldSession::SendLfgUpdateProposal(uint32 proposalId, LfgProposal const& proposal) +void WorldSession::SendLfgUpdateProposal(LfgProposal const& proposal) { uint64 guid = GetPlayer()->GetGUID(); uint64 gguid = proposal.players.find(guid)->second.group; @@ -569,7 +576,6 @@ void WorldSession::SendLfgUpdateProposal(uint32 proposalId, LfgProposal const& p sLog->outDebug(LOG_FILTER_LFG, "SMSG_LFG_PROPOSAL_UPDATE %s state: %u", GetPlayerInfo().c_str(), proposal.state); - WorldPacket data(SMSG_LFG_PROPOSAL_UPDATE, 4 + 1 + 4 + 4 + 1 + 1 + proposal.players.size() * (4 + 1 + 1 + 1 + 1 +1)); // show random dungeon if player selected random dungeon and it's not lfg group if (!silent) @@ -582,9 +588,10 @@ void WorldSession::SendLfgUpdateProposal(uint32 proposalId, LfgProposal const& p if (LFGDungeonData const* dungeon = sLFGMgr->GetLFGDungeon(dungeonEntry)) dungeonEntry = dungeon->Entry(); + WorldPacket data(SMSG_LFG_PROPOSAL_UPDATE, 4 + 1 + 4 + 4 + 1 + 1 + proposal.players.size() * (4 + 1 + 1 + 1 + 1 +1)); data << uint32(dungeonEntry); // Dungeon data << uint8(proposal.state); // Proposal state - data << uint32(proposalId); // Proposal ID + data << uint32(proposal.id); // Proposal ID data << uint32(proposal.encounters); // encounters done data << uint8(silent); // Show proposal window data << uint8(proposal.players.size()); // Group size diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 752eace536b..74fd18b31ed 100644 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -93,6 +93,10 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recvData) } player->StoreLootItem(lootSlot, loot); + + // If player is removing the last LootItem, delete the empty container. + if (loot->isLooted() && IS_ITEM_GUID(lguid)) + player->GetSession()->DoLootRelease(lguid); } void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recvData*/) @@ -200,6 +204,14 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recvData*/) } loot->gold = 0; + + // Delete the money loot record from the DB + if (loot->containerID > 0) + loot->DeleteLootMoneyFromContainerItemDB(); + + // Delete container if empty + if (loot->isLooted() && IS_ITEM_GUID(guid)) + player->GetSession()->DoLootRelease(guid); } } @@ -381,8 +393,10 @@ void WorldSession::DoLootRelease(uint64 lguid) 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(pItem->GetBagSlot(), pItem->GetSlot(), true); + { + if (pItem->loot.isLooted()) // Only delete item if no loot or money (unlooted loot is saved to db) + player->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true); + } return; // item can be looted only single player } else diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 6b8c83cce73..5aeb59e7383 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index aa182a16d91..3ee14ed429a 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 8c5594abab0..ee0d4f2a1f2 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index f3b26452435..138daf6d9c2 100644 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -470,22 +470,6 @@ void WorldSession::SendBindPoint(Creature* npc) uint32 bindspell = 3286; - // update sql homebind - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PLAYER_HOMEBIND); - stmt->setUInt16(0, _player->GetMapId()); - stmt->setUInt16(1, _player->GetAreaId()); - stmt->setFloat (2, _player->GetPositionX()); - stmt->setFloat (3, _player->GetPositionY()); - stmt->setFloat (4, _player->GetPositionZ()); - stmt->setUInt32(5, _player->GetGUIDLow()); - CharacterDatabase.Execute(stmt); - - _player->m_homebindMapId = _player->GetMapId(); - _player->m_homebindAreaId = _player->GetAreaId(); - _player->m_homebindX = _player->GetPositionX(); - _player->m_homebindY = _player->GetPositionY(); - _player->m_homebindZ = _player->GetPositionZ(); - // send spell for homebinding (3286) npc->CastSpell(_player, bindspell, true); diff --git a/src/server/game/Handlers/NPCHandler.h b/src/server/game/Handlers/NPCHandler.h index af84b71a74f..bc7cc93a3c7 100644 --- a/src/server/game/Handlers/NPCHandler.h +++ b/src/server/game/Handlers/NPCHandler.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 36dacaead69..98bcab81763 100644 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -162,6 +162,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid charmInfo->SetIsCommandAttack(false); charmInfo->SetIsAtStay(true); + charmInfo->SetIsCommandFollow(false); charmInfo->SetIsFollowing(false); charmInfo->SetIsReturning(false); charmInfo->SaveStayPosition(); @@ -175,6 +176,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid charmInfo->SetIsCommandAttack(false); charmInfo->SetIsAtStay(false); charmInfo->SetIsReturning(true); + charmInfo->SetIsCommandFollow(true); charmInfo->SetIsFollowing(false); break; case COMMAND_ATTACK: //spellid=1792 //ATTACK @@ -215,6 +217,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid charmInfo->SetIsCommandAttack(true); charmInfo->SetIsAtStay(false); charmInfo->SetIsFollowing(false); + charmInfo->SetIsCommandFollow(false); charmInfo->SetIsReturning(false); pet->ToCreature()->AI()->AttackStart(TargetUnit); @@ -236,6 +239,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid charmInfo->SetIsCommandAttack(true); charmInfo->SetIsAtStay(false); charmInfo->SetIsFollowing(false); + charmInfo->SetIsCommandFollow(false); charmInfo->SetIsReturning(false); pet->Attack(TargetUnit, true); diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index 1704229674e..b4510545def 100644 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp index e44fbd0d899..5a6618357e4 100644 --- a/src/server/game/Handlers/QueryHandler.cpp +++ b/src/server/game/Handlers/QueryHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -189,7 +189,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket& recvData) data << IconName; // 2.0.3, string. Icon name to use instead of default icon for go's (ex: "Attack" makes sword) data << CastBarCaption; // 2.0.3, string. Text will appear in Cast Bar when using GO (ex: "Collecting") data << info->unk1; // 2.0.3, string - data.append(info->raw.data, 24); + data.append(info->raw.data, MAX_GAMEOBJECT_DATA); data << float(info->size); // go size for (uint32 i = 0; i < MAX_GAMEOBJECT_QUEST_ITEMS; ++i) data << uint32(info->questItems[i]); // itemId[6], quest drop diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 8defb3b8761..4e5dbb306fa 100644 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket& recvData) Object* questgiver = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); if (!questgiver) { - sLog->outInfo(LOG_FILTER_NETWORKIO, "Error in CMSG_QUESTGIVER_STATUS_QUERY, called for not found questgiver (Typeid: %u GUID: %u)", GuidHigh2TypeId(GUID_HIPART(guid)), GUID_LOPART(guid)); + sLog->outInfo(LOG_FILTER_NETWORKIO, "Error in CMSG_QUESTGIVER_STATUS_QUERY, called for non-existing questgiver (Typeid: %u GUID: %u)", GuidHigh2TypeId(GUID_HIPART(guid)), GUID_LOPART(guid)); return; } @@ -289,7 +289,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData) if (reward >= QUEST_REWARD_CHOICES_COUNT) { - sLog->outError(LOG_FILTER_NETWORKIO, "Error in CMSG_QUESTGIVER_CHOOSE_REWARD: player %s (guid %d) tried to get invalid reward (%u) (probably packet hacking)", _player->GetName().c_str(), _player->GetGUIDLow(), reward); + sLog->outError(LOG_FILTER_NETWORKIO, "Error in CMSG_QUESTGIVER_CHOOSE_REWARD: player %s (guid %d) tried to get invalid reward (%u) (possible packet-hacking detected)", _player->GetName().c_str(), _player->GetGUIDLow(), reward); return; } @@ -308,7 +308,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData) if ((!_player->CanSeeStartQuest(quest) && _player->GetQuestStatus(questId) == QUEST_STATUS_NONE) || (_player->GetQuestStatus(questId) != QUEST_STATUS_COMPLETE && !quest->IsAutoComplete())) { - sLog->outError(LOG_FILTER_NETWORKIO, "HACK ALERT: Player %s (guid: %u) is trying to complete quest (id: %u) but he has no right to do it!", + sLog->outError(LOG_FILTER_NETWORKIO, "Error in QUEST_STATUS_COMPLETE: player %s (guid %u) tried to complete quest %u, but is not allowed to do so (possible packet-hacking or high latency)", _player->GetName().c_str(), _player->GetGUIDLow(), questId); return; } @@ -461,16 +461,8 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recvData) if (!pOriginalPlayer) return; - if (quest->IsRaidQuest()) - { - if (!_player->IsInSameRaidWith(pOriginalPlayer)) - return; - } - else - { - if (!_player->IsInSameGroupWith(pOriginalPlayer)) - return; - } + if (!_player->IsInSameRaidWith(pOriginalPlayer)) + return; if (_player->CanAddQuest(quest, true)) _player->AddQuest(quest, NULL); // NULL, this prevent DB script from duplicate running diff --git a/src/server/game/Handlers/ReferAFriendHandler.cpp b/src/server/game/Handlers/ReferAFriendHandler.cpp index 7822c38d390..a40e763b030 100644 --- a/src/server/game/Handlers/ReferAFriendHandler.cpp +++ b/src/server/game/Handlers/ReferAFriendHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp index f5f48b2a45b..46d3bb435d0 100644 --- a/src/server/game/Handlers/SkillHandler.cpp +++ b/src/server/game/Handlers/SkillHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 7002a55e2d1..45cb8164775 100644 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index 1df98af315d..b7155e552c7 100644 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/TicketHandler.cpp b/src/server/game/Handlers/TicketHandler.cpp index a632f956470..4463613a97b 100644 --- a/src/server/game/Handlers/TicketHandler.cpp +++ b/src/server/game/Handlers/TicketHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 08f2d61826e..2f9db8687c3 100644 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp index e16f535a757..8899889e87b 100644 --- a/src/server/game/Handlers/VehicleHandler.cpp +++ b/src/server/game/Handlers/VehicleHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Handlers/VoiceChatHandler.cpp b/src/server/game/Handlers/VoiceChatHandler.cpp index 785b4f8e5cd..0c8cc8326fa 100644 --- a/src/server/game/Handlers/VoiceChatHandler.cpp +++ b/src/server/game/Handlers/VoiceChatHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index 48ed7bdba1f..81b148d8eaf 100644 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -295,6 +295,7 @@ void InstanceSaveManager::LoadResetTimes() // index instance ids by map/difficulty pairs for fast reset warning send typedef std::multimap<uint32 /*PAIR32(map, difficulty)*/, uint32 /*instanceid*/ > ResetTimeMapDiffInstances; + typedef std::pair<ResetTimeMapDiffInstances::const_iterator, ResetTimeMapDiffInstances::const_iterator> ResetTimeMapDiffInstancesBounds; ResetTimeMapDiffInstances mapDiffResetInstances; QueryResult result = CharacterDatabase.Query("SELECT id, map, difficulty, resettime FROM instance ORDER BY id ASC"); @@ -378,8 +379,6 @@ void InstanceSaveManager::LoadResetTimes() } while (result->NextRow()); } - ResetTimeMapDiffInstances::const_iterator in_itr; - // calculate new global reset times for expired instances and those that have never been reset yet // add the global reset times to the priority queue for (MapDifficultyMap::const_iterator itr = sMapDifficultyMap.begin(); itr != sMapDifficultyMap.end(); ++itr) @@ -423,8 +422,9 @@ void InstanceSaveManager::LoadResetTimes() ScheduleReset(true, t - ResetTimeDelay[type-1], InstResetEvent(type, mapid, difficulty, 0)); - for (in_itr = mapDiffResetInstances.lower_bound(map_diff_pair); in_itr != mapDiffResetInstances.upper_bound(map_diff_pair); ++in_itr) - ScheduleReset(true, t - ResetTimeDelay[type-1], InstResetEvent(type, mapid, difficulty, in_itr->second)); + ResetTimeMapDiffInstancesBounds range = mapDiffResetInstances.equal_range(map_diff_pair); + for (; range.first != range.second; ++range.first) + ScheduleReset(true, t - ResetTimeDelay[type-1], InstResetEvent(type, mapid, difficulty, range.first->second)); } } diff --git a/src/server/game/Instances/InstanceSaveMgr.h b/src/server/game/Instances/InstanceSaveMgr.h index 83c2170255d..a99b4c66b27 100644 --- a/src/server/game/Instances/InstanceSaveMgr.h +++ b/src/server/game/Instances/InstanceSaveMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index a370cf25d97..bfd9bd62647 100644 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -20,6 +20,7 @@ #include "CreatureAI.h" #include "DatabaseEnv.h" #include "GameObject.h" +#include "Group.h" #include "InstanceScript.h" #include "LFGMgr.h" #include "Log.h" @@ -108,24 +109,24 @@ void InstanceScript::UpdateMinionState(Creature* minion, EncounterState state) void InstanceScript::UpdateDoorState(GameObject* door) { - DoorInfoMap::iterator lower = doors.lower_bound(door->GetEntry()); - DoorInfoMap::iterator upper = doors.upper_bound(door->GetEntry()); - if (lower == upper) + DoorInfoMapBounds range = doors.equal_range(door->GetEntry()); + if (range.first == range.second) return; bool open = true; - for (DoorInfoMap::iterator itr = lower; itr != upper && open; ++itr) + for (; range.first != range.second && open; ++range.first) { - switch (itr->second.type) + DoorInfo const& info = range.first->second; + switch (info.type) { case DOOR_TYPE_ROOM: - open = (itr->second.bossInfo->state != IN_PROGRESS); + open = (info.bossInfo->state != IN_PROGRESS); break; case DOOR_TYPE_PASSAGE: - open = (itr->second.bossInfo->state == DONE); + open = (info.bossInfo->state == DONE); break; case DOOR_TYPE_SPAWN_HOLE: - open = (itr->second.bossInfo->state == IN_PROGRESS); + open = (info.bossInfo->state == IN_PROGRESS); break; default: break; @@ -137,14 +138,13 @@ void InstanceScript::UpdateDoorState(GameObject* door) void InstanceScript::AddDoor(GameObject* door, bool add) { - DoorInfoMap::iterator lower = doors.lower_bound(door->GetEntry()); - DoorInfoMap::iterator upper = doors.upper_bound(door->GetEntry()); - if (lower == upper) + DoorInfoMapBounds range = doors.equal_range(door->GetEntry()); + if (range.first == range.second) return; - for (DoorInfoMap::iterator itr = lower; itr != upper; ++itr) + for (; range.first != range.second; ++range.first) { - DoorInfo const& data = itr->second; + DoorInfo const& data = range.first->second; if (add) { @@ -423,28 +423,41 @@ void InstanceScript::SendEncounterUnit(uint32 type, Unit* unit /*= NULL*/, uint8 instance->SendToPlayers(&data); } -void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 creditEntry, Unit* source) +void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 creditEntry, Unit* /*source*/) { DungeonEncounterList const* encounters = sObjectMgr->GetDungeonEncounterList(instance->GetId(), instance->GetDifficulty()); if (!encounters) return; + uint32 dungeonId = 0; + for (DungeonEncounterList::const_iterator itr = encounters->begin(); itr != encounters->end(); ++itr) { - if ((*itr)->creditType == type && (*itr)->creditEntry == creditEntry) + DungeonEncounter const* encounter = *itr; + if (encounter->creditType == type && encounter->creditEntry == creditEntry) { - completedEncounters |= 1 << (*itr)->dbcEntry->encounterIndex; - sLog->outDebug(LOG_FILTER_TSCR, "Instance %s (instanceId %u) completed encounter %s", instance->GetMapName(), instance->GetInstanceId(), (*itr)->dbcEntry->encounterName[0]); - if (uint32 dungeonId = (*itr)->lastEncounterDungeon) + completedEncounters |= 1 << encounter->dbcEntry->encounterIndex; + if (encounter->lastEncounterDungeon) { - Map::PlayerList const& players = instance->GetPlayers(); - if (!players.isEmpty()) - for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i) - if (Player* player = i->getSource()) - if (!source || player->IsAtGroupRewardDistance(source)) - sLFGMgr->RewardDungeonDoneFor(dungeonId, player); + dungeonId = encounter->lastEncounterDungeon; + sLog->outDebug(LOG_FILTER_LFG, "UpdateEncounterState: Instance %s (instanceId %u) completed encounter %s. Credit Dungeon: %u", instance->GetMapName(), instance->GetInstanceId(), encounter->dbcEntry->encounterName[0], dungeonId); + break; } - return; + } + } + + if (dungeonId) + { + Map::PlayerList const& players = instance->GetPlayers(); + for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i) + { + if (Player* player = i->getSource()) + if (Group* grp = player->GetGroup()) + if (grp->isLFGGroup()) + { + sLFGMgr->FinishDungeon(grp->GetGUID(), dungeonId); + return; + } } } } diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h index f1766833aee..609e318c82c 100644 --- a/src/server/game/Instances/InstanceScript.h +++ b/src/server/game/Instances/InstanceScript.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -126,6 +126,8 @@ struct MinionInfo }; typedef std::multimap<uint32 /*entry*/, DoorInfo> DoorInfoMap; +typedef std::pair<DoorInfoMap::const_iterator, DoorInfoMap::const_iterator> DoorInfoMapBounds; + typedef std::map<uint32 /*entry*/, MinionInfo> MinionInfoMap; class InstanceScript : public ZoneScript diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index ef3d2b9fbd6..a64e8117ce9 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -334,6 +334,7 @@ LootItem::LootItem(LootStoreItem const& li) is_blocked = 0; is_underthreshold = 0; is_counted = 0; + canSave = true; } // Basic checks for player/item compatibility - if false no chance to see the item in the loot @@ -654,6 +655,33 @@ void Loot::generateMoneyLoot(uint32 minAmount, uint32 maxAmount) } } +void Loot::DeleteLootItemFromContainerItemDB(uint32 itemID) +{ + // Deletes a single item associated with an openable item from the DB + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEM); + stmt->setUInt32(0, containerID); + stmt->setUInt32(1, itemID); + CharacterDatabase.Execute(stmt); + + // Mark the item looted to prevent resaving + for (LootItemList::iterator _itr = items.begin(); _itr != items.end(); ++_itr) + { + if (_itr->itemid != itemID) + continue; + + _itr->canSave = true; + break; + } +} + +void Loot::DeleteLootMoneyFromContainerItemDB() +{ + // Deletes money loot associated with an openable item from the DB + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY); + stmt->setUInt32(0, containerID); + CharacterDatabase.Execute(stmt); +} + LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem* *qitem, QuestItem* *ffaitem, QuestItem* *conditem) { LootItem* item = NULL; @@ -1239,6 +1267,19 @@ void LootTemplate::CopyConditions(ConditionList conditions) i->CopyConditions(conditions); } +void LootTemplate::CopyConditions(LootItem* li) const +{ + // Copies the conditions list from a template item to a LootItem + for (LootStoreItemList::const_iterator _iter = Entries.begin(); _iter != Entries.end(); ++_iter) + { + if (_iter->itemid != li->itemid) + continue; + + li->conditions = _iter->conditions; + break; + } +} + // Rolls for every item in the template and adds the rolled items the the loot void LootTemplate::Process(Loot& loot, bool rate, uint16 lootMode, uint8 groupId) const { diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h index 45fc5c7983c..759064385a5 100644 --- a/src/server/game/Loot/LootMgr.h +++ b/src/server/game/Loot/LootMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -141,14 +141,17 @@ struct LootItem bool is_counted : 1; bool needs_quest : 1; // quest drop bool follow_loot_rules : 1; + bool canSave; // Constructor, copies most fields from LootStoreItem, generates random count and random suffixes/properties // Should be called for non-reference LootStoreItem entries only (mincountOrRef > 0) explicit LootItem(LootStoreItem const& li); + // Empty constructor for creating an empty LootItem to be filled in with DB data + LootItem() : canSave(true){}; + // Basic checks for player/item compatibility - if false no chance to see the item in the loot bool AllowedForPlayer(Player const* player) const; - void AddAllowedLooter(Player const* player); const AllowedLooterSet & GetAllowedLooters() const { return allowedGUIDs; } }; @@ -223,6 +226,7 @@ class LootTemplate // Rolls for every item in the template and adds the rolled items the the loot void Process(Loot& loot, bool rate, uint16 lootMode, uint8 groupId = 0) const; void CopyConditions(ConditionList conditions); + void CopyConditions(LootItem* li) const; // True if template includes at least 1 quest drop entry bool HasQuestDrop(LootTemplateMap const& store, uint8 groupId = 0) const; @@ -287,9 +291,17 @@ struct Loot uint64 roundRobinPlayer; // GUID of the player having the Round-Robin ownership for the loot. If 0, round robin owner has released. LootType loot_type; // required for achievement system - Loot(uint32 _gold = 0) : gold(_gold), unlootedCount(0), loot_type(LOOT_CORPSE) {} + // GUIDLow of container that holds this loot (item_instance.entry) + // Only set for inventory items that can be right-click looted + uint32 containerID; + + Loot(uint32 _gold = 0) : gold(_gold), unlootedCount(0), loot_type(LOOT_CORPSE), containerID(0) {} ~Loot() { clear(); } + // For deleting items at loot removal since there is no backward interface to the Item() + void DeleteLootItemFromContainerItemDB(uint32 itemID); + void DeleteLootMoneyFromContainerItemDB(); + // if loot becomes invalid this reference is used to inform the listener void addLootValidatorRef(LootValidatorRef* pLootValidatorRef) { diff --git a/src/server/game/Mails/Mail.cpp b/src/server/game/Mails/Mail.cpp index 108856d81b6..8e7d863f3d7 100644 --- a/src/server/game/Mails/Mail.cpp +++ b/src/server/game/Mails/Mail.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Mails/Mail.h b/src/server/game/Mails/Mail.h index c2771f4b57c..6357d70e4a7 100644 --- a/src/server/game/Mails/Mail.h +++ b/src/server/game/Mails/Mail.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 831b29c2cfd..286604c10ac 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -2474,7 +2474,7 @@ bool InstanceMap::AddPlayerToMap(Player* player) if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true)) if (LFGDungeonData const* dungeon = sLFGMgr->GetLFGDungeon(dungeonId)) if (LFGDungeonData const* randomDungeon = sLFGMgr->GetLFGDungeon(*(sLFGMgr->GetSelectedDungeons(player->GetGUID()).begin()))) - if (uint32(dungeon->map) == GetId() && dungeon->difficulty == uint32(GetDifficulty()) && randomDungeon->type == uint32(LFG_TYPE_RANDOM)) + if (uint32(dungeon->map) == GetId() && dungeon->difficulty == GetDifficulty() && randomDungeon->type == LFG_TYPE_RANDOM) player->CastSpell(player, LFG_SPELL_LUCK_OF_THE_DRAW, true); } diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index a2ce227e2ea..47a26fa49e7 100644 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index 9ca8155e83b..27a1e0cc432 100644 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Maps/MapInstanced.h b/src/server/game/Maps/MapInstanced.h index 0b1a404630b..06a5f3e04a5 100644 --- a/src/server/game/Maps/MapInstanced.h +++ b/src/server/game/Maps/MapInstanced.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index 96a2a44655d..755d443091a 100644 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -179,6 +179,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) else // attempt to downscale mapDiff = GetDownscaledMapDifficultyData(entry->MapID, targetDifficulty); } + // FIXME: mapDiff is never used //Bypass checks for GMs if (player->isGameMaster()) diff --git a/src/server/game/Maps/MapManager.h b/src/server/game/Maps/MapManager.h index aa07eef2204..76876044bb7 100644 --- a/src/server/game/Maps/MapManager.h +++ b/src/server/game/Maps/MapManager.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Maps/MapRefManager.h b/src/server/game/Maps/MapRefManager.h index 3976139a18d..0ef57b5e238 100644 --- a/src/server/game/Maps/MapRefManager.h +++ b/src/server/game/Maps/MapRefManager.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Maps/MapReference.h b/src/server/game/Maps/MapReference.h index 86709fb28ab..f2f35e0955e 100644 --- a/src/server/game/Maps/MapReference.h +++ b/src/server/game/Maps/MapReference.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Maps/ZoneScript.h b/src/server/game/Maps/ZoneScript.h index 7b20b0ee676..9cea5fec518 100644 --- a/src/server/game/Maps/ZoneScript.h +++ b/src/server/game/Maps/ZoneScript.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index 4f358d7a145..b0a461d7760 100644 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index df5f45622f8..f116d695e17 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -531,7 +531,7 @@ enum TrinityStrings LANG_NPC_SETDATA = 555, //! Old ones now free: - // LANG_HOVER_DISABLED = 556, + LANG_COMMAND_NEAR_NPC_MESSAGE = 556, LANG_YOURS_LEVEL_UP = 557, LANG_YOURS_LEVEL_DOWN = 558, @@ -966,7 +966,8 @@ enum TrinityStrings LANG_COMMAND_NO_BATTLEGROUND_FOUND = 5032, LANG_COMMAND_NO_ACHIEVEMENT_CRITERIA_FOUND = 5033, LANG_COMMAND_NO_OUTDOOR_PVP_FORUND = 5034, - // Room for more Trinity strings 5035-9999 + LANG_CALL_FOR_HELP = 5035, + // Room for more Trinity strings 5036-9999 // Level requirement notifications LANG_SAY_REQ = 6604, diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index e3cf975e92f..05696694033 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -418,7 +418,7 @@ enum SpellAttr4 SPELL_ATTR4_UNK5 = 0x00000020, // 5 SPELL_ATTR4_NOT_STEALABLE = 0x00000040, // 6 although such auras might be dispellable, they cannot be stolen SPELL_ATTR4_TRIGGERED = 0x00000080, // 7 spells forced to be triggered - SPELL_ATTR4_UNK8 = 0x00000100, // 8 ignores taken percent damage mods? + SPELL_ATTR4_FIXED_DAMAGE = 0x00000100, // 8 ignores taken percent damage mods? SPELL_ATTR4_TRIGGER_ACTIVATE = 0x00000200, // 9 initially disabled / trigger activate from event (Execute, Riposte, Deep Freeze end other) SPELL_ATTR4_SPELL_VS_EXTEND_COST = 0x00000400, // 10 Rogue Shiv have this flag SPELL_ATTR4_UNK11 = 0x00000800, // 11 @@ -546,10 +546,10 @@ enum SpellAttr7 SPELL_ATTR7_UNK25 = 0x02000000, // 25 SPELL_ATTR7_UNK26 = 0x04000000, // 26 SPELL_ATTR7_UNK27 = 0x08000000, // 27 Not set - SPELL_ATTR7_UNK28 = 0x10000000, // 28 related to player positive buff + SPELL_ATTR7_BENEFIT_FROM_SPELLMOD = 0x10000000, // 28 Non-permanent, non-passive buffs that may benefit from spellmods SPELL_ATTR7_UNK29 = 0x20000000, // 29 only 69028, 71237 SPELL_ATTR7_UNK30 = 0x40000000, // 30 Burning Determination, Divine Sacrifice, Earth Shield, Prayer of Mending - SPELL_ATTR7_UNK31 = 0x80000000 // 31 only 70769 + SPELL_ATTR7_CLIENT_INDICATOR = 0x80000000 }; #define MIN_TALENT_SPEC 0 @@ -767,7 +767,7 @@ enum SpellEffects SPELL_EFFECT_SUMMON_OBJECT_SLOT3 = 106, SPELL_EFFECT_SUMMON_OBJECT_SLOT4 = 107, SPELL_EFFECT_DISPEL_MECHANIC = 108, - SPELL_EFFECT_SUMMON_DEAD_PET = 109, + SPELL_EFFECT_RESURRECT_PET = 109, SPELL_EFFECT_DESTROY_ALL_TOTEMS = 110, SPELL_EFFECT_DURABILITY_DAMAGE = 111, SPELL_EFFECT_112 = 112, @@ -789,7 +789,7 @@ enum SpellEffects SPELL_EFFECT_APPLY_AREA_AURA_FRIEND = 128, SPELL_EFFECT_APPLY_AREA_AURA_ENEMY = 129, SPELL_EFFECT_REDIRECT_THREAT = 130, - SPELL_EFFECT_131 = 131, + SPELL_EFFECT_PLAY_SOUND = 131, SPELL_EFFECT_PLAY_MUSIC = 132, SPELL_EFFECT_UNLEARN_SPECIALIZATION = 133, SPELL_EFFECT_KILL_CREDIT2 = 134, @@ -3146,10 +3146,11 @@ enum SummonType SUMMON_TYPE_MINIPET = 5, SUMMON_TYPE_GUARDIAN2 = 6, SUMMON_TYPE_WILD2 = 7, - SUMMON_TYPE_WILD3 = 8, + SUMMON_TYPE_WILD3 = 8, // Related to phases and DK prequest line (3.3.5a) SUMMON_TYPE_VEHICLE = 9, - SUMMON_TYPE_VEHICLE2 = 10, - SUMMON_TYPE_OBJECT = 11 + SUMMON_TYPE_VEHICLE2 = 10, // Oculus and Argent Tournament vehicles (3.3.5a) + SUMMON_TYPE_LIGHTWELL = 11, + SUMMON_TYPE_JEEVES = 12 }; enum EventId diff --git a/src/server/game/Movement/FollowerRefManager.h b/src/server/game/Movement/FollowerRefManager.h index 5066804d60f..2bb31d27227 100644 --- a/src/server/game/Movement/FollowerRefManager.h +++ b/src/server/game/Movement/FollowerRefManager.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/FollowerReference.cpp b/src/server/game/Movement/FollowerReference.cpp index 997d066a9f2..2ce23e214d1 100644 --- a/src/server/game/Movement/FollowerReference.cpp +++ b/src/server/game/Movement/FollowerReference.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/FollowerReference.h b/src/server/game/Movement/FollowerReference.h index 6a1a3719cb8..9e373d2527e 100644 --- a/src/server/game/Movement/FollowerReference.h +++ b/src/server/game/Movement/FollowerReference.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 488dbfc9159..ba648c72e26 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -378,14 +378,14 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED); } -void MotionMaster::MoveFall(uint32 id/*=0*/) +void MotionMaster::MoveFall(uint32 id /*=0*/) { // use larger distance for vmap height search than in most other cases float tz = _owner->GetMap()->GetHeight(_owner->GetPhaseMask(), _owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZ(), true, MAX_FALL_DISTANCE); if (tz <= INVALID_HEIGHT) { sLog->outDebug(LOG_FILTER_GENERAL, "MotionMaster::MoveFall: unable retrive a proper height at map %u (x: %f, y: %f, z: %f).", - _owner->GetMap()->GetId(), _owner->GetPositionX(), _owner->GetPositionX(), _owner->GetPositionZ()); + _owner->GetMap()->GetId(), _owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZ()); return; } diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h index 7037d1316f1..f6f58afef22 100644 --- a/src/server/game/Movement/MotionMaster.h +++ b/src/server/game/Movement/MotionMaster.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MovementGenerator.cpp b/src/server/game/Movement/MovementGenerator.cpp index 73921ea86ff..408614833bb 100644 --- a/src/server/game/Movement/MovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MovementGenerator.h b/src/server/game/Movement/MovementGenerator.h index e586d7e6ae6..1c1c38bc72f 100644 --- a/src/server/game/Movement/MovementGenerator.h +++ b/src/server/game/Movement/MovementGenerator.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MovementGeneratorImpl.h b/src/server/game/Movement/MovementGeneratorImpl.h index 725b309e3f1..2618cadc14f 100644 --- a/src/server/game/Movement/MovementGeneratorImpl.h +++ b/src/server/game/Movement/MovementGeneratorImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index f93e94fa35b..482c16997a0 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h index 34ce1e04dd2..20e84f3a97f 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp index b070e21ed5b..e89d30c56f4 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h index 5acebb54c99..8ad165c8206 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index 1e9ea3156d8..358362c9c15 100644 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner) init.Launch(); arrived = false; - owner.ClearUnitState(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE); + owner.ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE)); } bool HomeMovementGenerator<Creature>::DoUpdate(Creature &owner, const uint32 /*time_diff*/) diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h index a3d53e24510..c93241b82db 100644 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp index e237f22e8b1..c952ad9ba94 100755 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h index ad28cc185e6..bbcc2413cae 100644 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index 9bc3e09640f..59c41d841f2 100644 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h index 93516e5d354..f9a51d0c5f3 100644 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index 4d74ba20d96..f733fa3331c 100644 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h index 449b2686a2d..3e74753bc91 100644 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index 7a669642e7e..ebcb830cf61 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -66,7 +66,9 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T &owner) // We need to subtract GetObjectSize() because it gets added back further down the chain // and that makes pets too far away. Subtracting it allows pets to properly // be (GetCombatReach() + i_offset) away. - if (owner.isPet()) + // Only applies when i_target is pet's owner otherwise pets and mobs end up + // doing a "dance" while fighting + if (owner.isPet() && i_target->GetTypeId() == TYPEID_PLAYER) { dist = i_target->GetCombatReach(); size = i_target->GetCombatReach() - i_target->GetObjectSize(); diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h index 67cd8771aa7..4105668838d 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index e9c9cf6548d..4b825544bdf 100644 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h index 0bd75076a33..319a5c66a03 100644 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index df0b3e3944f..b327d0d0cd6 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -162,9 +162,11 @@ namespace Movement { if (_transformForTransport) { - float unused = 0.0f; if (TransportBase* transport = _owner.GetDirectTransport()) + { + float unused = 0.0f; // need reference transport->CalculatePassengerOffset(input.x, input.y, input.z, unused); + } } return input; diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index cae9f1321d2..8ebac4aec06 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -141,15 +141,15 @@ namespace Movement }; inline void MoveSplineInit::SetFly() { args.flags.EnableFlying(); } - inline void MoveSplineInit::SetWalk(bool enable) { args.flags.walkmode = enable;} - inline void MoveSplineInit::SetSmooth() { args.flags.EnableCatmullRom();} - inline void MoveSplineInit::SetCyclic() { args.flags.cyclic = true;} + inline void MoveSplineInit::SetWalk(bool enable) { args.flags.walkmode = enable; } + inline void MoveSplineInit::SetSmooth() { args.flags.EnableCatmullRom(); } + inline void MoveSplineInit::SetCyclic() { args.flags.cyclic = true; } inline void MoveSplineInit::SetFall() { args.flags.EnableFalling();} inline void MoveSplineInit::SetVelocity(float vel) { args.velocity = vel; args.HasVelocity = true; } inline void MoveSplineInit::SetOrientationInversed() { args.flags.orientationInversed = true;} inline void MoveSplineInit::SetTransportEnter() { args.flags.EnableTransportEnter(); } inline void MoveSplineInit::SetTransportExit() { args.flags.EnableTransportExit(); } - inline void MoveSplineInit::SetOrientationFixed(bool enable) { args.flags.orientationFixed = enable;} + inline void MoveSplineInit::SetOrientationFixed(bool enable) { args.flags.orientationFixed = enable; } inline void MoveSplineInit::MovebyPath(const PointsArray& controls, int32 path_offset) { @@ -160,8 +160,7 @@ namespace Movement inline void MoveSplineInit::MoveTo(float x, float y, float z) { - Vector3 v(x, y, z); - MoveTo(v); + MoveTo(G3D::Vector3(x, y, z)); } inline void MoveSplineInit::SetParabolic(float amplitude, float time_shift) diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index 8aef671d2d1..d747d6f69a6 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -70,7 +70,7 @@ namespace Movement // add fake Enter_Cycle flag - needed for client-side cyclic movement (client will erase first spline vertex after first cycle done) splineflags.enter_cycle = move_spline.isCyclic(); - data << uint32(splineflags & ~MoveSplineFlag::Mask_No_Monster_Move); + data << uint32(splineflags & uint32(~MoveSplineFlag::Mask_No_Monster_Move)); if (splineflags.animation) { diff --git a/src/server/game/Movement/Waypoints/Path.h b/src/server/game/Movement/Waypoints/Path.h index b6ddaa9d726..3f78a640384 100644 --- a/src/server/game/Movement/Waypoints/Path.h +++ b/src/server/game/Movement/Waypoints/Path.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp index a01e18347f6..6f9da3931af 100644 --- a/src/server/game/Movement/Waypoints/WaypointManager.cpp +++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/Waypoints/WaypointManager.h b/src/server/game/Movement/Waypoints/WaypointManager.h index df20c513c90..07f855380f9 100644 --- a/src/server/game/Movement/Waypoints/WaypointManager.h +++ b/src/server/game/Movement/Waypoints/WaypointManager.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp index 5e3d37acb71..bb7dea76461 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.h b/src/server/game/OutdoorPvP/OutdoorPvP.h index e9d5ff9dfdc..5f1607843fb 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvP.h +++ b/src/server/game/OutdoorPvP/OutdoorPvP.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp index ce987e25eed..6341b9388b8 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h index 1313e29bfb4..8a93987c878 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index 0d3d97d3996..70cbc4434cd 100644 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Pools/PoolMgr.h b/src/server/game/Pools/PoolMgr.h index be839bf1566..8a9b4a953dd 100644 --- a/src/server/game/Pools/PoolMgr.h +++ b/src/server/game/Pools/PoolMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://www.mangosproject.org/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 1238afe2ee1..8bc628b853d 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -140,9 +140,7 @@ Quest::Quest(Field* questRecord) for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) OfferRewardEmoteDelay[i] = questRecord[140+i].GetInt32(); - CompleteScript = questRecord[144].GetUInt32(); - - // int32 WDBVerified = questRecord[145].GetInt32(); + //int32 WDBVerified = questRecord[144].GetInt32(); Flags |= SpecialFlags << 20; if (Flags & QUEST_TRINITY_FLAGS_AUTO_ACCEPT) @@ -219,9 +217,26 @@ bool Quest::IsAutoComplete() const return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_COMPLETE) ? false : (Method == 0 || HasFlag(QUEST_FLAGS_AUTOCOMPLETE)); } -bool Quest::IsAllowedInRaid() const +bool Quest::IsRaidQuest(Difficulty difficulty) const +{ + switch (Type) + { + case QUEST_TYPE_RAID: + return true; + case QUEST_TYPE_RAID_10: + return !(difficulty & RAID_DIFFICULTY_MASK_25MAN); + case QUEST_TYPE_RAID_25: + return difficulty & RAID_DIFFICULTY_MASK_25MAN; + default: + break; + } + + return false; +} + +bool Quest::IsAllowedInRaid(Difficulty difficulty) const { - if (IsRaidQuest()) + if (IsRaidQuest(difficulty)) return true; return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_RAID); diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 61b3de5f327..9073c5d1441 100644 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -22,6 +22,7 @@ #include "Define.h" #include "DatabaseEnv.h" #include "SharedDefines.h" +#include "DBCEnums.h" #include <string> #include <vector> @@ -244,7 +245,6 @@ class Quest uint32 GetPointOpt() const { return PointOption; } uint32 GetIncompleteEmote() const { return EmoteOnIncomplete; } uint32 GetCompleteEmote() const { return EmoteOnComplete; } - uint32 GetQuestCompleteScript() const { return CompleteScript; } bool IsRepeatable() const { return Flags & QUEST_TRINITY_FLAGS_REPEATABLE; } bool IsAutoAccept() const; bool IsAutoComplete() const; @@ -254,8 +254,8 @@ class Quest bool IsMonthly() const { return Flags & QUEST_TRINITY_FLAGS_MONTHLY; } bool IsSeasonal() const { return (ZoneOrSort == -QUEST_SORT_SEASONAL || ZoneOrSort == -QUEST_SORT_SPECIAL || ZoneOrSort == -QUEST_SORT_LUNAR_FESTIVAL || ZoneOrSort == -QUEST_SORT_MIDSUMMER || ZoneOrSort == -QUEST_SORT_BREWFEST || ZoneOrSort == -QUEST_SORT_LOVE_IS_IN_THE_AIR || ZoneOrSort == -QUEST_SORT_NOBLEGARDEN) && !IsRepeatable(); } bool IsDailyOrWeekly() const { return Flags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); } - bool IsRaidQuest() const { return Type == QUEST_TYPE_RAID || Type == QUEST_TYPE_RAID_10 || Type == QUEST_TYPE_RAID_25; } - bool IsAllowedInRaid() const; + bool IsRaidQuest(Difficulty difficulty) const; + bool IsAllowedInRaid(Difficulty difficulty) const; bool IsDFQuest() const { return Flags & QUEST_TRINITY_FLAGS_DF_QUEST; } uint32 CalculateHonorGain(uint8 level) const; @@ -354,7 +354,6 @@ class Quest uint32 PointOption; uint32 EmoteOnIncomplete; uint32 EmoteOnComplete; - uint32 CompleteScript; }; struct QuestStatusData diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index 2294ec0d6a4..e88da9ac440 100644 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Reputation/ReputationMgr.h b/src/server/game/Reputation/ReputationMgr.h index f950cbb82c2..adc1df32f8a 100644 --- a/src/server/game/Reputation/ReputationMgr.h +++ b/src/server/game/Reputation/ReputationMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index 069ae71b7cb..6cd6a72a06a 100644 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index b794d45423b..479979f177f 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -192,6 +192,7 @@ void AddSC_boss_lorekeeperpolkelt(); void AddSC_boss_rasfrost(); void AddSC_boss_theravenian(); void AddSC_boss_vectus(); +void AddSC_boss_kirtonos_the_herald(); void AddSC_instance_scholomance(); void AddSC_shadowfang_keep(); //Shadowfang keep void AddSC_instance_shadowfang_keep(); @@ -320,6 +321,7 @@ void AddSC_boss_ayamiss(); void AddSC_boss_ossirian(); void AddSC_instance_ruins_of_ahnqiraj(); void AddSC_boss_cthun(); //Temple of ahn'qiraj +void AddSC_boss_viscidus(); void AddSC_boss_fankriss(); void AddSC_boss_huhuran(); void AddSC_bug_trio(); @@ -578,6 +580,9 @@ void AddSC_instance_arcatraz(); void AddSC_boss_high_botanist_freywinn(); //TK Botanica void AddSC_boss_laj(); void AddSC_boss_warp_splinter(); +void AddSC_boss_thorngrin_the_tender(); +void AddSC_boss_commander_sarannis(); +void AddSC_instance_the_botanica(); void AddSC_boss_alar(); //TK The Eye void AddSC_boss_kaelthas(); void AddSC_boss_void_reaver(); @@ -822,6 +827,7 @@ void AddEasternKingdomsScripts() AddSC_boss_rasfrost(); AddSC_boss_theravenian(); AddSC_boss_vectus(); + AddSC_boss_kirtonos_the_herald(); AddSC_instance_scholomance(); AddSC_shadowfang_keep(); //Shadowfang keep AddSC_instance_shadowfang_keep(); @@ -954,6 +960,7 @@ void AddKalimdorScripts() AddSC_boss_ossirian(); AddSC_instance_ruins_of_ahnqiraj(); AddSC_boss_cthun(); //Temple of ahn'qiraj + AddSC_boss_viscidus(); AddSC_boss_fankriss(); AddSC_boss_huhuran(); AddSC_bug_trio(); @@ -1056,6 +1063,9 @@ void AddOutlandScripts() AddSC_boss_high_botanist_freywinn(); //TK Botanica AddSC_boss_laj(); AddSC_boss_warp_splinter(); + AddSC_boss_thorngrin_the_tender(); + AddSC_boss_commander_sarannis(); + AddSC_instance_the_botanica(); AddSC_boss_alar(); //TK The Eye AddSC_boss_kaelthas(); AddSC_boss_void_reaver(); diff --git a/src/server/game/Scripting/ScriptLoader.h b/src/server/game/Scripting/ScriptLoader.h index 04ab3215551..ef29b54369d 100644 --- a/src/server/game/Scripting/ScriptLoader.h +++ b/src/server/game/Scripting/ScriptLoader.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 6682d3c11e3..cae8ea9d2d5 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -160,83 +160,7 @@ class ScriptRegistry if (!V) \ return R; -void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target) -{ - if (!pSource) - { - sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i, invalid Source pointer.", iTextEntry); - return; - } - - if (iTextEntry >= 0) - { - sLog->outError(LOG_FILTER_TSCR, "DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry); - return; - } - - const StringTextData* pData = sScriptSystemMgr->GetTextData(iTextEntry); - - if (!pData) - { - sLog->outError(LOG_FILTER_TSCR, "DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry); - return; - } - sLog->outDebug(LOG_FILTER_TSCR, "DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", iTextEntry, pData->uiSoundId, pData->uiType, pData->uiLanguage, pData->uiEmote); - - if (pData->uiSoundId) - { - if (sSoundEntriesStore.LookupEntry(pData->uiSoundId)) - pSource->SendPlaySound(pData->uiSoundId, false); - else - sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId); - } - - if (pData->uiEmote) - { - if (pSource->GetTypeId() == TYPEID_UNIT || pSource->GetTypeId() == TYPEID_PLAYER) - ((Unit*)pSource)->HandleEmoteCommand(pData->uiEmote); - else - sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i tried to process emote for invalid TypeId (%u).", iTextEntry, pSource->GetTypeId()); - } - - switch (pData->uiType) - { - case CHAT_TYPE_SAY: - pSource->MonsterSay(iTextEntry, pData->uiLanguage, target ? target->GetGUID() : 0); - break; - case CHAT_TYPE_YELL: - pSource->MonsterYell(iTextEntry, pData->uiLanguage, target ? target->GetGUID() : 0); - break; - case CHAT_TYPE_TEXT_EMOTE: - pSource->MonsterTextEmote(iTextEntry, target ? target->GetGUID() : 0); - break; - case CHAT_TYPE_BOSS_EMOTE: - pSource->MonsterTextEmote(iTextEntry, target ? target->GetGUID() : 0, true); - break; - case CHAT_TYPE_WHISPER: - { - if (target && target->GetTypeId() == TYPEID_PLAYER) - pSource->MonsterWhisper(iTextEntry, target->GetGUID()); - else - sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry); - - break; - } - case CHAT_TYPE_BOSS_WHISPER: - { - if (target && target->GetTypeId() == TYPEID_PLAYER) - pSource->MonsterWhisper(iTextEntry, target->GetGUID(), true); - else - sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry); - - break; - } - case CHAT_TYPE_ZONE_YELL: - pSource->MonsterYellToZone(iTextEntry, pData->uiLanguage, target ? target->GetGUID() : 0); - break; - } -} ScriptMgr::ScriptMgr() : _scriptCount(0), _scheduledScripts(0) @@ -293,14 +217,13 @@ void ScriptMgr::Unload() SCR_CLEAR(PlayerScript); SCR_CLEAR(GuildScript); SCR_CLEAR(GroupScript); + SCR_CLEAR(UnitScript); #undef SCR_CLEAR } void ScriptMgr::LoadDatabase() { - sScriptSystemMgr->LoadScriptTexts(); - sScriptSystemMgr->LoadScriptTextsCustom(); sScriptSystemMgr->LoadScriptWaypoints(); } @@ -1318,6 +1241,11 @@ void ScriptMgr::OnPlayerDelete(uint64 guid) FOREACH_SCRIPT(PlayerScript)->OnDelete(guid); } +void ScriptMgr::OnPlayerSave(Player* player) +{ + FOREACH_SCRIPT(PlayerScript)->OnSave(player); +} + void ScriptMgr::OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent) { FOREACH_SCRIPT(PlayerScript)->OnBindToInstance(player, difficulty, mapid, permanent); @@ -1416,6 +1344,22 @@ void ScriptMgr::OnGroupDisband(Group* group) FOREACH_SCRIPT(GroupScript)->OnDisband(group); } +// Unit +void ScriptMgr::ModifyPeriodicDamageAurasTick(Unit* target, Unit* attacker, uint32& damage) +{ + FOREACH_SCRIPT(UnitScript)->ModifyPeriodicDamageAurasTick(target, attacker, damage); +} + +void ScriptMgr::ModifyMeleeDamage(Unit* target, Unit* attacker, uint32& damage) +{ + FOREACH_SCRIPT(UnitScript)->ModifyMeleeDamage(target, attacker, damage); +} + +void ScriptMgr::ModifySpellDamageTaken(Unit* target, Unit* attacker, int32& damage) +{ + FOREACH_SCRIPT(UnitScript)->ModifySpellDamageTaken(target, attacker, damage); +} + SpellScriptLoader::SpellScriptLoader(const char* name) : ScriptObject(name) { @@ -1440,6 +1384,13 @@ FormulaScript::FormulaScript(const char* name) ScriptRegistry<FormulaScript>::AddScript(this); } +UnitScript::UnitScript(const char* name, bool addToScripts) + : ScriptObject(name) +{ + if (addToScripts) + ScriptRegistry<UnitScript>::AddScript(this); +} + WorldMapScript::WorldMapScript(const char* name, uint32 mapId) : ScriptObject(name), MapScript<Map>(mapId) { @@ -1474,7 +1425,7 @@ ItemScript::ItemScript(const char* name) } CreatureScript::CreatureScript(const char* name) - : ScriptObject(name) + : UnitScript(name, false) { ScriptRegistry<CreatureScript>::AddScript(this); } @@ -1552,7 +1503,7 @@ AchievementCriteriaScript::AchievementCriteriaScript(const char* name) } PlayerScript::PlayerScript(const char* name) - : ScriptObject(name) + : UnitScript(name, false) { ScriptRegistry<PlayerScript>::AddScript(this); } @@ -1598,6 +1549,7 @@ template class ScriptRegistry<AchievementCriteriaScript>; template class ScriptRegistry<PlayerScript>; template class ScriptRegistry<GuildScript>; template class ScriptRegistry<GroupScript>; +template class ScriptRegistry<UnitScript>; // Undefine utility macros. #undef GET_SCRIPT_RET diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 947be2b73fe..7f140cfffe0 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -69,8 +69,6 @@ struct OutdoorPvPData; #define VISIBLE_RANGE 166.0f //MAX visible range (size of grid) -// Generic scripting text function. -void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target = NULL); /* TODO: Add more script type classes. @@ -394,7 +392,24 @@ class ItemScript : public ScriptObject virtual bool OnExpire(Player* /*player*/, ItemTemplate const* /*proto*/) { return false; } }; -class CreatureScript : public ScriptObject, public UpdatableScript<Creature> +class UnitScript : public ScriptObject +{ + protected: + + UnitScript(const char* name, bool addToScripts = true); + + public: + // Called when DoT's Tick Damage is being Dealt + virtual void ModifyPeriodicDamageAurasTick(Unit* /*target*/, Unit* /*attacker*/, uint32& /*damage*/) { } + + // Called when Melee Damage is being Dealt + virtual void ModifyMeleeDamage(Unit* /*target*/, Unit* /*attacker*/, uint32& /*damage*/) { } + + // Called when Spell Damage is being Dealt + virtual void ModifySpellDamageTaken(Unit* /*target*/, Unit* /*attacker*/, int32& /*damage*/) { } +}; + +class CreatureScript : public UnitScript, public UpdatableScript<Creature> { protected: @@ -656,7 +671,7 @@ class AchievementCriteriaScript : public ScriptObject virtual bool OnCheck(Player* source, Unit* target) = 0; }; -class PlayerScript : public ScriptObject +class PlayerScript : public UnitScript { protected: @@ -731,6 +746,9 @@ class PlayerScript : public ScriptObject // Called when a player is deleted. virtual void OnDelete(uint64 /*guid*/) { } + // Called when a player is about to be saved. + virtual void OnSave(Player* /*player*/) { } + // Called when a player is bound to an instance virtual void OnBindToInstance(Player* /*player*/, Difficulty /*difficulty*/, uint32 /*mapId*/, bool /*permanent*/) { } @@ -1007,6 +1025,7 @@ class ScriptMgr void OnPlayerLogout(Player* player); void OnPlayerCreate(Player* player); void OnPlayerDelete(uint64 guid); + void OnPlayerSave(Player* player); void OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent); void OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newArea); @@ -1033,6 +1052,12 @@ class ScriptMgr void OnGroupChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid); void OnGroupDisband(Group* group); + public: /* UnitScript */ + + void ModifyPeriodicDamageAurasTick(Unit* target, Unit* attacker, uint32& damage); + void ModifyMeleeDamage(Unit* target, Unit* attacker, uint32& damage); + void ModifySpellDamageTaken(Unit* target, Unit* attacker, int32& damage); + public: /* Scheduled scripts */ uint32 IncreaseScheduledScriptsCount() { return ++_scheduledScripts; } diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp index 41b41b91808..97f5030b2ff 100644 --- a/src/server/game/Scripting/ScriptSystem.cpp +++ b/src/server/game/Scripting/ScriptSystem.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -23,128 +23,6 @@ ScriptPointVector const SystemMgr::_empty; -void SystemMgr::LoadScriptTexts() -{ - sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Script Texts..."); - LoadTrinityStrings("script_texts", TEXT_SOURCE_RANGE, 1+(TEXT_SOURCE_RANGE*2)); - - sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Script Texts additional data..."); - uint32 oldMSTime = getMSTime(); - - // 0 1 2 3 - QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM script_texts"); - - if (!result) - { - sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty."); - return; - } - - uint32 uiCount = 0; - - do - { - Field* pFields = result->Fetch(); - StringTextData temp; - - int32 iId = pFields[0].GetInt32(); - temp.uiSoundId = pFields[1].GetUInt32(); - temp.uiType = pFields[2].GetUInt8(); - temp.uiLanguage = pFields[3].GetUInt8(); - temp.uiEmote = pFields[4].GetUInt16(); - - if (iId >= 0) - { - sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `script_texts` is not a negative value.", iId); - continue; - } - - if (iId > TEXT_SOURCE_RANGE || iId <= TEXT_SOURCE_RANGE*2) - { - sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `script_texts` is out of accepted entry range for table.", iId); - continue; - } - - if (temp.uiSoundId) - { - if (!sSoundEntriesStore.LookupEntry(temp.uiSoundId)) - sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId); - } - - if (!GetLanguageDescByID(temp.uiLanguage)) - sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `script_texts` using Language %u but Language does not exist.", iId, temp.uiLanguage); - - if (temp.uiType > CHAT_TYPE_ZONE_YELL) - sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `script_texts` has Type %u but this Chat Type does not exist.", iId, temp.uiType); - - m_mTextDataMap[iId] = temp; - ++uiCount; - } - while (result->NextRow()); - - sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u additional Script Texts data in %u ms", uiCount, GetMSTimeDiffToNow(oldMSTime)); -} - -void SystemMgr::LoadScriptTextsCustom() -{ - sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Custom Texts..."); - LoadTrinityStrings("custom_texts", TEXT_SOURCE_RANGE*2, 1+(TEXT_SOURCE_RANGE*3)); - - sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Custom Texts additional data..."); - - QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM custom_texts"); - - if (!result) - { - sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty."); - return; - } - - uint32 uiCount = 0; - - do - { - Field* pFields = result->Fetch(); - StringTextData temp; - - int32 iId = pFields[0].GetInt32(); - temp.uiSoundId = pFields[1].GetUInt32(); - temp.uiType = pFields[2].GetUInt8(); - temp.uiLanguage = pFields[3].GetUInt8(); - temp.uiEmote = pFields[4].GetUInt16(); - - if (iId >= 0) - { - sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `custom_texts` is not a negative value.", iId); - continue; - } - - if (iId > TEXT_SOURCE_RANGE*2 || iId <= TEXT_SOURCE_RANGE*3) - { - sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `custom_texts` is out of accepted entry range for table.", iId); - continue; - } - - if (temp.uiSoundId) - { - if (!sSoundEntriesStore.LookupEntry(temp.uiSoundId)) - sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId); - } - - if (!GetLanguageDescByID(temp.uiLanguage)) - sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `custom_texts` using Language %u but Language does not exist.", iId, temp.uiLanguage); - - if (temp.uiType > CHAT_TYPE_ZONE_YELL) - sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `custom_texts` has Type %u but this Chat Type does not exist.", iId, temp.uiType); - - m_mTextDataMap[iId] = temp; - ++uiCount; - } - while (result->NextRow()); - - sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u additional Custom Texts data.", uiCount); -} - void SystemMgr::LoadScriptWaypoints() { uint32 oldMSTime = getMSTime(); diff --git a/src/server/game/Scripting/ScriptSystem.h b/src/server/game/Scripting/ScriptSystem.h index 4211a63b043..cc65d493f3e 100644 --- a/src/server/game/Scripting/ScriptSystem.h +++ b/src/server/game/Scripting/ScriptSystem.h @@ -46,14 +46,6 @@ struct ScriptPointMove typedef std::vector<ScriptPointMove> ScriptPointVector; -struct StringTextData -{ - uint32 uiSoundId; - uint8 uiType; - uint32 uiLanguage; - uint32 uiEmote; -}; - class SystemMgr { friend class ACE_Singleton<SystemMgr, ACE_Null_Mutex>; @@ -61,26 +53,11 @@ class SystemMgr ~SystemMgr() {} public: - //Maps and lists - typedef UNORDERED_MAP<int32, StringTextData> TextDataMap; typedef UNORDERED_MAP<uint32, ScriptPointVector> PointMoveMap; //Database - void LoadScriptTexts(); - void LoadScriptTextsCustom(); void LoadScriptWaypoints(); - //Retrive from storage - StringTextData const* GetTextData(int32 textId) const - { - TextDataMap::const_iterator itr = m_mTextDataMap.find(textId); - - if (itr == m_mTextDataMap.end()) - return NULL; - - return &itr->second; - } - ScriptPointVector const& GetPointMoveList(uint32 creatureEntry) const { PointMoveMap::const_iterator itr = m_mPointMoveMap.find(creatureEntry); @@ -92,7 +69,6 @@ class SystemMgr } protected: - TextDataMap m_mTextDataMap; //additional data for text strings PointMoveMap m_mPointMoveMap; //coordinates for waypoints private: diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 0821be2abb9..7237d5f74f7 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -763,7 +763,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x2DE*/ { "SMSG_FORCE_TURN_RATE_CHANGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x2DF*/ { "CMSG_FORCE_TURN_RATE_CHANGE_ACK", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck }, /*0x2E0*/ { "MSG_PVP_LOG_DATA", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePVPLogDataOpcode }, - /*0x2E1*/ { "CMSG_LEAVE_BATTLEFIELD", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveBattlefieldOpcode }, + /*0x2E1*/ { "CMSG_LEAVE_BATTLEFIELD", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldLeaveOpcode }, /*0x2E2*/ { "CMSG_AREA_SPIRIT_HEALER_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode}, /*0x2E3*/ { "CMSG_AREA_SPIRIT_HEALER_QUEUE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueueOpcode}, /*0x2E4*/ { "SMSG_AREA_SPIRIT_HEALER_TIME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, @@ -1249,7 +1249,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4C4*/ { "CMSG_GM_GRANT_ACHIEVEMENT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x4C5*/ { "CMSG_GM_REMOVE_ACHIEVEMENT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x4C6*/ { "CMSG_GM_SET_CRITERIA_FOR_PLAYER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4C7*/ { "SMSG_ARENA_OPPONENT_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, + /*0x4C7*/ { "SMSG_ARENA_UNIT_DESTROYED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x4C8*/ { "SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x4C9*/ { "CMSG_PROFILEDATA_REQUEST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x4CA*/ { "SMSG_PROFILEDATA_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 625ee88a853..30c5b1dcdf4 100644 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -1257,7 +1257,7 @@ enum Opcodes CMSG_GM_GRANT_ACHIEVEMENT = 0x4C4, CMSG_GM_REMOVE_ACHIEVEMENT = 0x4C5, CMSG_GM_SET_CRITERIA_FOR_PLAYER = 0x4C6, - SMSG_ARENA_OPPONENT_UPDATE = 0x4C7, // uint64 + SMSG_ARENA_UNIT_DESTROYED = 0x4C7, SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x4C8, // uint32 "Can't modify arena team while queued or in a match." CMSG_PROFILEDATA_REQUEST = 0x4C9, SMSG_PROFILEDATA_RESPONSE = 0x4CA, diff --git a/src/server/game/Server/Protocol/PacketLog.cpp b/src/server/game/Server/Protocol/PacketLog.cpp index cb6dcdbdb9e..649f4130c06 100644 --- a/src/server/game/Server/Protocol/PacketLog.cpp +++ b/src/server/game/Server/Protocol/PacketLog.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Server/Protocol/PacketLog.h b/src/server/game/Server/Protocol/PacketLog.h index b899daae198..2c2e0a8766c 100644 --- a/src/server/game/Server/Protocol/PacketLog.h +++ b/src/server/game/Server/Protocol/PacketLog.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 0185d4adc9f..484a382c988 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index a442bb45a69..39f5425d9df 100644 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -53,7 +53,7 @@ struct LfgLockStatus; struct LfgPlayerBoot; struct LfgProposal; struct LfgQueueStatusData; -struct LfgReward; +struct LfgPlayerRewardData; struct LfgRoleCheck; struct LfgUpdateData; struct MovementInfo; @@ -270,7 +270,7 @@ class WorldSession void SendAttackStop(Unit const* enemy); - void SendBattleGroundList(uint64 guid, BattlegroundTypeId bgTypeId); + void SendBattleGroundList(uint64 guid, BattlegroundTypeId bgTypeId = BATTLEGROUND_RB); void SendTradeStatus(TradeStatus status); void SendUpdateTrade(bool trader_data = true); @@ -327,7 +327,7 @@ class WorldSession void SendDiscoverNewTaxiNode(uint32 nodeid); // Guild/Arena Team - void SendArenaTeamCommandResult(uint32 team_action, std::string const& team, std::string const& player, uint32 error_id); + void SendArenaTeamCommandResult(uint32 team_action, std::string const& team, std::string const& player, uint32 error_id = 0); void SendNotInArenaTeamPacket(uint8 type); void SendPetitionShowList(uint64 guid); @@ -741,7 +741,7 @@ class WorldSession void HandlePVPLogDataOpcode(WorldPacket& recvData); void HandleBattleFieldPortOpcode(WorldPacket& recvData); void HandleBattlefieldListOpcode(WorldPacket& recvData); - void HandleLeaveBattlefieldOpcode(WorldPacket& recvData); + void HandleBattlefieldLeaveOpcode(WorldPacket& recvData); void HandleBattlemasterJoinArena(WorldPacket& recvData); void HandleReportPvPAFK(WorldPacket& recvData); @@ -762,14 +762,14 @@ class WorldSession void HandleInstanceLockResponse(WorldPacket& recvPacket); // Battlefield - void SendBfInvitePlayerToWar(uint32 BattleId,uint32 ZoneId,uint32 time); - void SendBfInvitePlayerToQueue(uint32 BattleId); - void SendBfQueueInviteResponse(uint32 BattleId,uint32 ZoneId, bool CanQueue = true, bool Full = false); - void SendBfEntered(uint32 BattleId); - void SendBfLeaveMessage(uint32 BattleId, BFLeaveReason reason = BF_LEAVE_REASON_EXITED); - void HandleBfQueueInviteResponse(WorldPacket &recvData); - void HandleBfEntryInviteResponse(WorldPacket &recvData); - void HandleBfExitRequest(WorldPacket &recvData); + void SendBfInvitePlayerToWar(uint32 battleId, uint32 zoneId, uint32 time); + void SendBfInvitePlayerToQueue(uint32 battleId); + void SendBfQueueInviteResponse(uint32 battleId, uint32 zoneId, bool canQueue = true, bool full = false); + void SendBfEntered(uint32 battleId); + void SendBfLeaveMessage(uint32 battleId, BFLeaveReason reason = BF_LEAVE_REASON_EXITED); + void HandleBfQueueInviteResponse(WorldPacket& recvData); + void HandleBfEntryInviteResponse(WorldPacket& recvData); + void HandleBfExitRequest(WorldPacket& recvData); // Looking for Dungeon/Raid void HandleLfgSetCommentOpcode(WorldPacket& recvData); @@ -785,16 +785,16 @@ class WorldSession void HandleLfrLeaveOpcode(WorldPacket& recvData); void HandleLfgGetStatus(WorldPacket& recvData); - void SendLfgUpdatePlayer(const LfgUpdateData& updateData); - void SendLfgUpdateParty(const LfgUpdateData& updateData); + void SendLfgUpdatePlayer(LfgUpdateData const& updateData); + void SendLfgUpdateParty(LfgUpdateData const& updateData); void SendLfgRoleChosen(uint64 guid, uint8 roles); - void SendLfgRoleCheckUpdate(const LfgRoleCheck& pRoleCheck); + void SendLfgRoleCheckUpdate(LfgRoleCheck const& pRoleCheck); void SendLfgLfrList(bool update); - void SendLfgJoinResult(const LfgJoinResultData& joinData); - void SendLfgQueueStatus(const LfgQueueStatusData& queueData); - void SendLfgPlayerReward(uint32 rdungeonEntry, uint32 sdungeonEntry, uint8 done, const LfgReward* reward, const Quest *qRew); - void SendLfgBootProposalUpdate(const LfgPlayerBoot& boot); - void SendLfgUpdateProposal(uint32 proposalId, const LfgProposal& proposal); + void SendLfgJoinResult(LfgJoinResultData const& joinData); + void SendLfgQueueStatus(LfgQueueStatusData const& queueData); + void SendLfgPlayerReward(LfgPlayerRewardData const& lfgPlayerRewardData); + void SendLfgBootProposalUpdate(LfgPlayerBoot const& boot); + void SendLfgUpdateProposal(LfgProposal const& proposal); void SendLfgDisabled(); void SendLfgOfferContinue(uint32 dungeonEntry); void SendLfgTeleportError(uint8 err); diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 8b034299ad6..b47f801ab29 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Server/WorldSocket.h b/src/server/game/Server/WorldSocket.h index b8080b128f2..6b59647bb6c 100644 --- a/src/server/game/Server/WorldSocket.h +++ b/src/server/game/Server/WorldSocket.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Server/WorldSocketAcceptor.h b/src/server/game/Server/WorldSocketAcceptor.h index d4ff7823b02..c46e2e2422a 100644 --- a/src/server/game/Server/WorldSocketAcceptor.h +++ b/src/server/game/Server/WorldSocketAcceptor.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Server/WorldSocketMgr.cpp b/src/server/game/Server/WorldSocketMgr.cpp index ed960258c41..15025bf893d 100644 --- a/src/server/game/Server/WorldSocketMgr.cpp +++ b/src/server/game/Server/WorldSocketMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -60,7 +60,7 @@ class ReactorRunnable : protected ACE_Task_Base m_Connections(0), m_ThreadId(-1) { - ACE_Reactor_Impl* imp = 0; + ACE_Reactor_Impl* imp; #if defined (ACE_HAS_EVENT_POLL) || defined (ACE_HAS_DEV_POLL) diff --git a/src/server/game/Server/WorldSocketMgr.h b/src/server/game/Server/WorldSocketMgr.h index fd7e28485cf..d7adc79bef8 100644 --- a/src/server/game/Server/WorldSocketMgr.h +++ b/src/server/game/Server/WorldSocketMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp index 3eac3d34fd2..8b5ae4863d0 100644 --- a/src/server/game/Skills/SkillDiscovery.cpp +++ b/src/server/game/Skills/SkillDiscovery.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Skills/SkillDiscovery.h b/src/server/game/Skills/SkillDiscovery.h index ba5542e0189..84c17665f45 100644 --- a/src/server/game/Skills/SkillDiscovery.h +++ b/src/server/game/Skills/SkillDiscovery.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Skills/SkillExtraItems.cpp b/src/server/game/Skills/SkillExtraItems.cpp index 9e2648dc943..090e2e8205a 100644 --- a/src/server/game/Skills/SkillExtraItems.cpp +++ b/src/server/game/Skills/SkillExtraItems.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Skills/SkillExtraItems.h b/src/server/game/Skills/SkillExtraItems.h index 0cf49021e1c..fd73cdbeab6 100644 --- a/src/server/game/Skills/SkillExtraItems.h +++ b/src/server/game/Skills/SkillExtraItems.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 11e4a28e084..3969dfbab98 100644 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index ce15b918810..12551c93346 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -3095,9 +3095,10 @@ void AuraEffect::HandleModPossess(AuraApplication const* aurApp, uint8 mode, boo target->RemoveCharmedBy(caster); } -// only one spell has this aura void AuraEffect::HandleModPossessPet(AuraApplication const* aurApp, uint8 mode, bool apply) const { + // Used by spell "Eyes of the Beast" + if (!(mode & AURA_EFFECT_HANDLE_REAL)) return; @@ -3120,6 +3121,9 @@ void AuraEffect::HandleModPossessPet(AuraApplication const* aurApp, uint8 mode, if (caster->ToPlayer()->GetPet() != pet) return; + // Must clear current motion or pet leashes back to owner after a few yards + // when under spell 'Eyes of the Beast' + pet->GetMotionMaster()->Clear(); pet->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp); } else @@ -3130,13 +3134,15 @@ void AuraEffect::HandleModPossessPet(AuraApplication const* aurApp, uint8 mode, pet->Remove(PET_SAVE_NOT_IN_SLOT, true); else { - // Reinitialize the pet bar and make the pet come back to the owner + // Reinitialize the pet bar or it will appear greyed out caster->ToPlayer()->PetSpellInitialize(); - if (!pet->getVictim()) + + // Follow owner only if not fighting or owner didn't click "stay" at new location + // This may be confusing because pet bar shows "stay" when under the spell but it retains + // the "follow" flag. Player MUST click "stay" while under the spell. + if (!pet->getVictim() && !pet->GetCharmInfo()->HasCommandState(COMMAND_STAY)) { pet->GetMotionMaster()->MoveFollow(caster, PET_FOLLOW_DIST, pet->GetFollowAngle()); - //if (target->GetCharmInfo()) - // target->GetCharmInfo()->SetCommandState(COMMAND_FOLLOW); } } } @@ -3193,6 +3199,11 @@ void AuraEffect::HandleAuraControlVehicle(AuraApplication const* aurApp, uint8 m if (apply) { + // Currently spells that have base points 0 and DieSides 0 = "0/0" exception are pushed to -1, + // however the idea of 0/0 is to ingore flag VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT and -1 checks for it, + // so this break such spells or most of them. + // Current formula about m_amount: effect base points + dieside - 1 + // TO DO: Reasearch more about 0/0 and fix it. caster->_EnterVehicle(target->GetVehicleKit(), m_amount - 1, aurApp); } else @@ -5447,7 +5458,7 @@ void AuraEffect::HandleAuraLinked(AuraApplication const* aurApp, uint8 mode, boo { Unit* target = aurApp->GetTarget(); - uint32 triggeredSpellId = m_spellInfo->Effects[m_effIndex].TriggerSpell; + uint32 triggeredSpellId = sSpellMgr->GetSpellIdForDifficulty(m_spellInfo->Effects[m_effIndex].TriggerSpell, target); SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggeredSpellId); if (!triggeredSpellInfo) return; @@ -6163,6 +6174,9 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const // ignore non positive values (can be result apply spellmods to aura damage uint32 damage = std::max(GetAmount(), 0); + // Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations + sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage); + if (GetAuraType() == SPELL_AURA_PERIODIC_DAMAGE) { damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 64079918638..7cfb1e04850 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index d0d9d417c3e..b33546ee988 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -910,8 +910,16 @@ bool Aura::CanBeSaved() const // Incanter's Absorbtion - considering the minimal duration and problems with aura stacking // we skip saving this aura - if (GetId() == 44413) - return false; + // Also for some reason other auras put as MultiSlot crash core on keeping them after restart, + // so put here only these for which you are sure they get removed + switch (GetId()) + { + case 44413: // Incanter's Absorption + case 40075: // Fel Flak Fire + case 55849: // Power Spark + return false; + break; + } // don't save auras removed by proc system if (IsUsingCharges() && !GetCharges()) @@ -1972,8 +1980,13 @@ bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventI if (!sSpellMgr->CanSpellTriggerProcOnEvent(*procEntry, eventInfo)) return false; + // do checks using conditions table + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_PROC, GetSpellInfo()->Id); + ConditionSourceInfo condInfo = ConditionSourceInfo(eventInfo.GetActor(), eventInfo.GetActionTarget()); + if (!sConditionMgr->IsObjectMeetToConditions(condInfo, conditions)) + return false; + // TODO: - // - do checks using conditions table for eventInfo->GetActor() and eventInfo->GetActionTarget() // - add DoCheckProc() AuraScript hook // to allow additional requirements for procs // this is needed because this is the last moment in which you can prevent aura charge drop on proc diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index 85c8992c597..88ebee18981 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 58f9d2856da..af6ed55ed58 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -817,11 +817,16 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar return; // choose which targets we can select at once for (uint32 j = effIndex + 1; j < MAX_SPELL_EFFECTS; ++j) - if (GetSpellInfo()->Effects[effIndex].TargetA.GetTarget() == GetSpellInfo()->Effects[j].TargetA.GetTarget() && - GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == GetSpellInfo()->Effects[j].TargetB.GetTarget() && - GetSpellInfo()->Effects[effIndex].ImplicitTargetConditions == GetSpellInfo()->Effects[j].ImplicitTargetConditions && - GetSpellInfo()->Effects[effIndex].CalcRadius(m_caster) == GetSpellInfo()->Effects[j].CalcRadius(m_caster)) + { + SpellEffectInfo const* effects = GetSpellInfo()->Effects; + if (effects[effIndex].TargetA.GetTarget() == effects[j].TargetA.GetTarget() && + effects[effIndex].TargetB.GetTarget() == effects[j].TargetB.GetTarget() && + effects[effIndex].ImplicitTargetConditions == effects[j].ImplicitTargetConditions && + effects[effIndex].CalcRadius(m_caster) == effects[j].CalcRadius(m_caster)) + { effectMask |= 1 << j; + } + } processedEffectMask |= effectMask; break; default: @@ -1392,7 +1397,7 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici if (SpellTargetPosition const* st = sSpellMgr->GetSpellTargetPosition(m_spellInfo->Id)) { // TODO: fix this check - if (m_spellInfo->HasEffect(SPELL_EFFECT_TELEPORT_UNITS)) + if (m_spellInfo->HasEffect(SPELL_EFFECT_TELEPORT_UNITS) || m_spellInfo->HasEffect(SPELL_EFFECT_BIND)) m_targets.SetDst(st->target_X, st->target_Y, st->target_Z, st->target_Orientation, (int32)st->target_mapId); else if (st->target_mapId == m_caster->GetMapId()) m_targets.SetDst(st->target_X, st->target_Y, st->target_Z, st->target_Orientation); @@ -4853,9 +4858,10 @@ SpellCastResult Spell::CheckCast(bool strict) if (!checkMask) checkMask = VEHICLE_SEAT_FLAG_CAN_ATTACK; + // All creatures should be able to cast as passengers freely, restriction and attribute are only for players VehicleSeatEntry const* vehicleSeat = vehicle->GetSeatForPassenger(m_caster); if (!(m_spellInfo->AttributesEx6 & SPELL_ATTR6_CASTABLE_WHILE_ON_VEHICLE) && !(m_spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_MOUNTED) - && (vehicleSeat->m_flags & checkMask) != checkMask) + && (vehicleSeat->m_flags & checkMask) != checkMask && m_caster->GetTypeId() == TYPEID_PLAYER) return SPELL_FAILED_DONT_REPORT; } @@ -4908,7 +4914,7 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_NOT_INFRONT; if (m_caster->GetEntry() != WORLD_TRIGGER) // Ignore LOS for gameobjects casts (wrongly casted by a trigger) - if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target)) + if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, m_spellInfo->Id, NULL, SPELL_DISABLE_LOS) && !m_caster->IsWithinLOSInMap(target)) return SPELL_FAILED_LINE_OF_SIGHT; } } @@ -4919,7 +4925,7 @@ SpellCastResult Spell::CheckCast(bool strict) float x, y, z; m_targets.GetDstPos()->GetPosition(x, y, z); - if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOS(x, y, z)) + if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, m_spellInfo->Id, NULL, SPELL_DISABLE_LOS) && !m_caster->IsWithinLOS(x, y, z)) return SPELL_FAILED_LINE_OF_SIGHT; } @@ -5242,7 +5248,7 @@ SpellCastResult Spell::CheckCast(bool strict) } break; } - case SPELL_EFFECT_SUMMON_DEAD_PET: + case SPELL_EFFECT_RESURRECT_PET: { Creature* pet = m_caster->GetGuardianPet(); @@ -5615,7 +5621,7 @@ SpellCastResult Spell::CheckCasterAuras() const Unit::AuraEffectList const& stunAuras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_STUN); for (Unit::AuraEffectList::const_iterator i = stunAuras.begin(); i != stunAuras.end(); ++i) { - if (!((*i)->GetSpellInfo()->GetAllEffectsMechanicMask() & (1<<MECHANIC_STUN))) + if ((*i)->GetSpellInfo()->GetAllEffectsMechanicMask() && !((*i)->GetSpellInfo()->GetAllEffectsMechanicMask() & (1<<MECHANIC_STUN))) { foundNotStun = true; break; diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index a892d6c9590..1fe8affc407 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -333,7 +333,7 @@ class Spell void EffectPlayMusic(SpellEffIndex effIndex); void EffectSpecCount(SpellEffIndex effIndex); void EffectActivateSpec(SpellEffIndex effIndex); - void EffectPlayerNotification(SpellEffIndex effIndex); + void EffectPlaySound(SpellEffIndex effIndex); void EffectRemoveAura(SpellEffIndex effIndex); void EffectCastButtons(SpellEffIndex effIndex); void EffectRechargeManaGem(SpellEffIndex effIndex); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 72ef429bed0..8913cf2ac20 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -198,7 +198,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectApplyAreaAura, //128 SPELL_EFFECT_APPLY_AREA_AURA_FRIEND &Spell::EffectApplyAreaAura, //129 SPELL_EFFECT_APPLY_AREA_AURA_ENEMY &Spell::EffectRedirectThreat, //130 SPELL_EFFECT_REDIRECT_THREAT - &Spell::EffectPlayerNotification, //131 SPELL_EFFECT_PLAYER_NOTIFICATION sound id in misc value (SoundEntries.dbc) + &Spell::EffectPlaySound, //131 SPELL_EFFECT_PLAY_SOUND sound id in misc value (SoundEntries.dbc) &Spell::EffectPlayMusic, //132 SPELL_EFFECT_PLAY_MUSIC sound id in misc value (SoundEntries.dbc) &Spell::EffectUnlearnSpecialization, //133 SPELL_EFFECT_UNLEARN_SPECIALIZATION unlearn profession specialization &Spell::EffectKillCredit, //134 SPELL_EFFECT_KILL_CREDIT misc value is creature entry @@ -2010,7 +2010,6 @@ void Spell::SendLoot(uint64 guid, LootType loottype) case GAMEOBJECT_TYPE_DOOR: case GAMEOBJECT_TYPE_BUTTON: gameObjTarget->UseDoorOrButton(0, false, player); - player->GetMap()->ScriptsStart(sGameObjectScripts, gameObjTarget->GetDBTableGUIDLow(), player, gameObjTarget); return; case GAMEOBJECT_TYPE_QUESTGIVER: @@ -2354,6 +2353,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) case SUMMON_TYPE_VEHICLE2: summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); break; + case SUMMON_TYPE_LIGHTWELL: case SUMMON_TYPE_TOTEM: { summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); @@ -6140,7 +6140,7 @@ void Spell::EffectActivateSpec(SpellEffIndex /*effIndex*/) unitTarget->ToPlayer()->ActivateSpec(damage-1); // damage is 1 or 2, spec is 0 or 1 } -void Spell::EffectPlayerNotification(SpellEffIndex effIndex) +void Spell::EffectPlaySound(SpellEffIndex effIndex) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -6153,20 +6153,21 @@ void Spell::EffectPlayerNotification(SpellEffIndex effIndex) case 58730: // Restricted Flight Area case 58600: // Restricted Flight Area unitTarget->ToPlayer()->GetSession()->SendNotification(LANG_ZONE_NOFLYZONE); - unitTarget->PlayDirectSound(9417); // Fel Reaver sound + break; + default: break; } - uint32 soundid = m_spellInfo->Effects[effIndex].MiscValue; + uint32 soundId = m_spellInfo->Effects[effIndex].MiscValue; - if (!sSoundEntriesStore.LookupEntry(soundid)) + if (!sSoundEntriesStore.LookupEntry(soundId)) { - sLog->outError(LOG_FILTER_SPELLS_AURAS, "EffectPlayerNotification: Sound (Id: %u) not exist in spell %u.", soundid, m_spellInfo->Id); + sLog->outError(LOG_FILTER_SPELLS_AURAS, "EffectPlayerSound: Sound (Id: %u) not exist in spell %u.", soundId, m_spellInfo->Id); return; } WorldPacket data(SMSG_PLAY_SOUND, 4); - data << uint32(soundid); + data << uint32(soundId); unitTarget->ToPlayer()->GetSession()->SendPacket(&data); } @@ -6264,51 +6265,38 @@ void Spell::EffectBind(SpellEffIndex effIndex) Player* player = unitTarget->ToPlayer(); - uint32 area_id; - WorldLocation loc; - if (m_spellInfo->Effects[effIndex].TargetA.GetTarget() == TARGET_DEST_DB || m_spellInfo->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DB) - { - SpellTargetPosition const* st = sSpellMgr->GetSpellTargetPosition(m_spellInfo->Id); - if (!st) - { - sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::EffectBind - unknown teleport coordinates for spell ID %u", m_spellInfo->Id); - return; - } + WorldLocation homeLoc; + uint32 areaId = player->GetAreaId(); - loc.m_mapId = st->target_mapId; - loc.m_positionX = st->target_X; - loc.m_positionY = st->target_Y; - loc.m_positionZ = st->target_Z; - loc.m_orientation = st->target_Orientation; - area_id = player->GetAreaId(); - } + if (m_spellInfo->Effects[effIndex].MiscValue) + areaId = m_spellInfo->Effects[effIndex].MiscValue; + + if (m_targets.HasDst()) + homeLoc.WorldRelocate(*destTarget); else { - player->GetPosition(&loc); - area_id = player->GetAreaId(); + player->GetPosition(&homeLoc); + homeLoc.m_mapId = player->GetMapId(); } - player->SetHomebind(loc, area_id); + player->SetHomebind(homeLoc, areaId); // binding WorldPacket data(SMSG_BINDPOINTUPDATE, (4+4+4+4+4)); - data << float(loc.m_positionX); - data << float(loc.m_positionY); - data << float(loc.m_positionZ); - data << uint32(loc.m_mapId); - data << uint32(area_id); + data << float(homeLoc.GetPositionX()); + data << float(homeLoc.GetPositionY()); + data << float(homeLoc.GetPositionZ()); + data << uint32(homeLoc.GetMapId()); + data << uint32(areaId); player->SendDirectMessage(&data); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind X : %f", loc.m_positionX); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind Y : %f", loc.m_positionY); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind Z : %f", loc.m_positionZ); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind MapId : %u", loc.m_mapId); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind AreaId : %u", area_id); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "EffectBind: New homebind X: %f, Y: %f, Z: %f, MapId: %u, AreaId: %u", + homeLoc.GetPositionX(), homeLoc.GetPositionY(), homeLoc.GetPositionZ(), homeLoc.GetMapId(), areaId); // zone update data.Initialize(SMSG_PLAYERBOUND, 8+4); data << uint64(player->GetGUID()); - data << uint32(area_id); + data << uint32(areaId); player->SendDirectMessage(&data); } diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index fcfa441455e..afbf85a0a13 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -684,7 +684,7 @@ SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] = {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 128 SPELL_EFFECT_APPLY_AREA_AURA_FRIEND {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 129 SPELL_EFFECT_APPLY_AREA_AURA_ENEMY {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 130 SPELL_EFFECT_REDIRECT_THREAT - {EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_UNIT}, // 131 SPELL_EFFECT_131 + {EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_UNIT}, // 131 SPELL_EFFECT_PLAY_SOUND {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 132 SPELL_EFFECT_PLAY_MUSIC {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 133 SPELL_EFFECT_UNLEARN_SPECIALIZATION {EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_UNIT}, // 134 SPELL_EFFECT_KILL_CREDIT2 @@ -1027,7 +1027,7 @@ bool SpellInfo::IsPassiveStackableWithRanks() const bool SpellInfo::IsMultiSlotAura() const { - return IsPassive() || Id == 40075 || Id == 44413; // No other way to make 40075 have more than 1 copy of aura + return IsPassive() || Id == 55849 || Id == 40075 || Id == 44413; // Power Spark, Fel Flak Fire, Incanter's Absorption } bool SpellInfo::IsDeathPersistent() const @@ -1100,7 +1100,7 @@ bool SpellInfo::IsAffectedBySpellMods() const return !(AttributesEx3 & SPELL_ATTR3_NO_DONE_BONUS); } -bool SpellInfo::IsAffectedBySpellMod(SpellModifier* mod) const +bool SpellInfo::IsAffectedBySpellMod(SpellModifier const* mod) const { if (!IsAffectedBySpellMods()) return false; @@ -1546,11 +1546,21 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta if (unitTarget->HasUnitState(UNIT_STATE_IN_FLIGHT)) return SPELL_FAILED_BAD_TARGETS; - if (TargetAuraState && !unitTarget->HasAuraState(AuraStateType(TargetAuraState), this, caster)) - return SPELL_FAILED_TARGET_AURASTATE; + /* TARGET_UNIT_MASTER gets blocked here for passengers, because the whole idea of this check is to + not allow passengers to be implicitly hit by spells, however this target type should be an exception, + if this is left it kills spells that award kill credit from vehicle to master (few spells), + the use of these 2 covers passenger target check, logically, if vehicle cast this to master it should always hit + him, because it would be it's passenger, there's no such case where this gets to fail legitimacy, this problem + cannot be solved from within the check in other way since target type cannot be called for the spell currently + Spell examples: [ID - 52864 Devour Water, ID - 52862 Devour Wind, ID - 49370 Wyrmrest Defender: Destabilize Azure Dragonshrine Effect] */ + if (!caster->IsVehicle() && !(caster->GetCharmerOrOwner() == target)) + { + if (TargetAuraState && !unitTarget->HasAuraState(AuraStateType(TargetAuraState), this, caster)) + return SPELL_FAILED_TARGET_AURASTATE; - if (TargetAuraStateNot && unitTarget->HasAuraState(AuraStateType(TargetAuraStateNot), this, caster)) - return SPELL_FAILED_TARGET_AURASTATE; + if (TargetAuraStateNot && unitTarget->HasAuraState(AuraStateType(TargetAuraStateNot), this, caster)) + return SPELL_FAILED_TARGET_AURASTATE; + } if (TargetAuraSpell && !unitTarget->HasAura(sSpellMgr->GetSpellIdForDifficulty(TargetAuraSpell, caster))) return SPELL_FAILED_TARGET_AURASTATE; @@ -2009,7 +2019,7 @@ uint32 SpellInfo::GetRecoveryTime() const return RecoveryTime > CategoryRecoveryTime ? RecoveryTime : CategoryRecoveryTime; } -uint32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) const +int32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) const { // Spell drain all exist power on cast (Only paladin lay of Hands) if (AttributesEx & SPELL_ATTR1_DRAIN_ALL_POWER) diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 2d53c7d8ace..23682c3d48f 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -405,7 +405,7 @@ public: bool IsAutoRepeatRangedSpell() const; bool IsAffectedBySpellMods() const; - bool IsAffectedBySpellMod(SpellModifier* mod) const; + bool IsAffectedBySpellMod(SpellModifier const* mod) const; bool CanPierceImmuneAura(SpellInfo const* aura) const; bool CanDispelAura(SpellInfo const* aura) const; @@ -445,7 +445,7 @@ public: uint32 CalcCastTime(Unit* caster = NULL, Spell* spell = NULL) const; uint32 GetRecoveryTime() const; - uint32 CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) const; + int32 CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) const; bool IsRanked() const; uint8 GetRank() const; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index ecab3712af1..582f13284bb 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -573,12 +573,12 @@ uint32 SpellMgr::GetSpellWithRank(uint32 spell_id, uint32 rank, bool strict) con SpellRequiredMapBounds SpellMgr::GetSpellsRequiredForSpellBounds(uint32 spell_id) const { - return SpellRequiredMapBounds(mSpellReq.lower_bound(spell_id), mSpellReq.upper_bound(spell_id)); + return mSpellReq.equal_range(spell_id); } SpellsRequiringSpellMapBounds SpellMgr::GetSpellsRequiringSpellBounds(uint32 spell_id) const { - return SpellsRequiringSpellMapBounds(mSpellsReqSpell.lower_bound(spell_id), mSpellsReqSpell.upper_bound(spell_id)); + return mSpellsReqSpell.equal_range(spell_id); } bool SpellMgr::IsSpellRequiringSpell(uint32 spellid, uint32 req_spellid) const @@ -618,7 +618,7 @@ SpellLearnSkillNode const* SpellMgr::GetSpellLearnSkill(uint32 spell_id) const SpellLearnSpellMapBounds SpellMgr::GetSpellLearnSpellMapBounds(uint32 spell_id) const { - return SpellLearnSpellMapBounds(mSpellLearnSpells.lower_bound(spell_id), mSpellLearnSpells.upper_bound(spell_id)); + return mSpellLearnSpells.equal_range(spell_id); } bool SpellMgr::IsSpellLearnSpell(uint32 spell_id) const @@ -646,7 +646,7 @@ SpellTargetPosition const* SpellMgr::GetSpellTargetPosition(uint32 spell_id) con SpellSpellGroupMapBounds SpellMgr::GetSpellSpellGroupMapBounds(uint32 spell_id) const { spell_id = GetFirstSpellInChain(spell_id); - return SpellSpellGroupMapBounds(mSpellSpellGroup.lower_bound(spell_id), mSpellSpellGroup.upper_bound(spell_id)); + return mSpellSpellGroup.equal_range(spell_id); } bool SpellMgr::IsSpellMemberOfSpellGroup(uint32 spellid, SpellGroup groupid) const @@ -662,7 +662,7 @@ bool SpellMgr::IsSpellMemberOfSpellGroup(uint32 spellid, SpellGroup groupid) con SpellGroupSpellMapBounds SpellMgr::GetSpellGroupSpellMapBounds(SpellGroup group_id) const { - return SpellGroupSpellMapBounds(mSpellGroupSpell.lower_bound(group_id), mSpellGroupSpell.upper_bound(group_id)); + return mSpellGroupSpell.equal_range(group_id); } void SpellMgr::GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set<uint32>& foundSpells) const @@ -1012,7 +1012,7 @@ SpellThreatEntry const* SpellMgr::GetSpellThreatEntry(uint32 spellID) const SkillLineAbilityMapBounds SpellMgr::GetSkillLineAbilityMapBounds(uint32 spell_id) const { - return SkillLineAbilityMapBounds(mSkillLineAbilityMap.lower_bound(spell_id), mSkillLineAbilityMap.upper_bound(spell_id)); + return mSkillLineAbilityMap.equal_range(spell_id); } PetAura const* SpellMgr::GetPetAura(uint32 spell_id, uint8 eff) @@ -1062,27 +1062,27 @@ PetDefaultSpellsEntry const* SpellMgr::GetPetDefaultSpellsEntry(int32 id) const SpellAreaMapBounds SpellMgr::GetSpellAreaMapBounds(uint32 spell_id) const { - return SpellAreaMapBounds(mSpellAreaMap.lower_bound(spell_id), mSpellAreaMap.upper_bound(spell_id)); + return mSpellAreaMap.equal_range(spell_id); } SpellAreaForQuestMapBounds SpellMgr::GetSpellAreaForQuestMapBounds(uint32 quest_id) const { - return SpellAreaForQuestMapBounds(mSpellAreaForQuestMap.lower_bound(quest_id), mSpellAreaForQuestMap.upper_bound(quest_id)); + return mSpellAreaForQuestMap.equal_range(quest_id); } SpellAreaForQuestMapBounds SpellMgr::GetSpellAreaForQuestEndMapBounds(uint32 quest_id) const { - return SpellAreaForQuestMapBounds(mSpellAreaForQuestEndMap.lower_bound(quest_id), mSpellAreaForQuestEndMap.upper_bound(quest_id)); + return mSpellAreaForQuestEndMap.equal_range(quest_id); } SpellAreaForAuraMapBounds SpellMgr::GetSpellAreaForAuraMapBounds(uint32 spell_id) const { - return SpellAreaForAuraMapBounds(mSpellAreaForAuraMap.lower_bound(spell_id), mSpellAreaForAuraMap.upper_bound(spell_id)); + return mSpellAreaForAuraMap.equal_range(spell_id); } SpellAreaForAreaMapBounds SpellMgr::GetSpellAreaForAreaMapBounds(uint32 area_id) const { - return SpellAreaForAreaMapBounds(mSpellAreaForAreaMap.lower_bound(area_id), mSpellAreaForAreaMap.upper_bound(area_id)); + return mSpellAreaForAreaMap.equal_range(area_id); } bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 newArea) const @@ -1836,14 +1836,14 @@ void SpellMgr::LoadSpellProcs() int32 spellId = fields[0].GetInt32(); bool allRanks = false; - if (spellId <=0) + if (spellId < 0) { allRanks = true; spellId = -spellId; } - SpellInfo const* spellEntry = GetSpellInfo(spellId); - if (!spellEntry) + SpellInfo const* spellInfo = GetSpellInfo(spellId); + if (!spellInfo) { sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` does not exist", spellId); continue; @@ -1851,9 +1851,9 @@ void SpellMgr::LoadSpellProcs() if (allRanks) { - if (GetFirstSpellInChain(spellId) != uint32(spellId)) + if (spellInfo->GetFirstRankSpell()->Id != uint32(spellId)) { - sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` is not first rank of spell.", fields[0].GetInt32()); + sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` is not first rank of spell.", spellId); continue; } } @@ -1876,79 +1876,77 @@ void SpellMgr::LoadSpellProcs() baseProcEntry.cooldown = uint32(cooldown); baseProcEntry.charges = fields[14].GetUInt32(); - while (true) + while (spellInfo) { - if (mSpellProcMap.find(spellId) != mSpellProcMap.end()) + if (mSpellProcMap.find(spellInfo->Id) != mSpellProcMap.end()) { - sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` has duplicate entry in the table", spellId); + sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` has duplicate entry in the table", spellInfo->Id); break; } SpellProcEntry procEntry = SpellProcEntry(baseProcEntry); // take defaults from dbcs if (!procEntry.typeMask) - procEntry.typeMask = spellEntry->ProcFlags; + procEntry.typeMask = spellInfo->ProcFlags; if (!procEntry.charges) - procEntry.charges = spellEntry->ProcCharges; + procEntry.charges = spellInfo->ProcCharges; if (!procEntry.chance && !procEntry.ratePerMinute) - procEntry.chance = float(spellEntry->ProcChance); + procEntry.chance = float(spellInfo->ProcChance); // validate data if (procEntry.schoolMask & ~SPELL_SCHOOL_MASK_ALL) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `schoolMask` set: %u", spellId, procEntry.schoolMask); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `schoolMask` set: %u", spellInfo->Id, procEntry.schoolMask); if (procEntry.spellFamilyName && (procEntry.spellFamilyName < 3 || procEntry.spellFamilyName > 17 || procEntry.spellFamilyName == 14 || procEntry.spellFamilyName == 16)) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellFamilyName` set: %u", spellId, procEntry.spellFamilyName); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellFamilyName` set: %u", spellInfo->Id, procEntry.spellFamilyName); if (procEntry.chance < 0) { - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `chance` field", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `chance` field", spellInfo->Id); procEntry.chance = 0; } if (procEntry.ratePerMinute < 0) { - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `ratePerMinute` field", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `ratePerMinute` field", spellInfo->Id); procEntry.ratePerMinute = 0; } if (cooldown < 0) { - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `cooldown` field", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `cooldown` field", spellInfo->Id); procEntry.cooldown = 0; } if (procEntry.chance == 0 && procEntry.ratePerMinute == 0) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `chance` and `ratePerMinute` values defined, proc will not be triggered", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `chance` and `ratePerMinute` values defined, proc will not be triggered", spellInfo->Id); if (procEntry.charges > 99) { - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has too big value in `charges` field", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has too big value in `charges` field", spellInfo->Id); procEntry.charges = 99; } if (!procEntry.typeMask) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `typeMask` value defined, proc will not be triggered", spellId); - if (procEntry.spellTypeMask & ~PROC_SPELL_PHASE_MASK_ALL) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellTypeMask` set: %u", spellId, procEntry.spellTypeMask); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `typeMask` value defined, proc will not be triggered", spellInfo->Id); + if (procEntry.spellTypeMask & ~PROC_SPELL_TYPE_MASK_ALL) + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellTypeMask` set: %u", spellInfo->Id, procEntry.spellTypeMask); if (procEntry.spellTypeMask && !(procEntry.typeMask & (SPELL_PROC_FLAG_MASK | PERIODIC_PROC_FLAG_MASK))) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellTypeMask` value defined, but it won't be used for defined `typeMask` value", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellTypeMask` value defined, but it won't be used for defined `typeMask` value", spellInfo->Id); if (!procEntry.spellPhaseMask && procEntry.typeMask & REQ_SPELL_PHASE_PROC_FLAG_MASK) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `spellPhaseMask` value defined, but it's required for defined `typeMask` value, proc will not be triggered", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `spellPhaseMask` value defined, but it's required for defined `typeMask` value, proc will not be triggered", spellInfo->Id); if (procEntry.spellPhaseMask & ~PROC_SPELL_PHASE_MASK_ALL) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellPhaseMask` set: %u", spellId, procEntry.spellPhaseMask); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellPhaseMask` set: %u", spellInfo->Id, procEntry.spellPhaseMask); if (procEntry.spellPhaseMask && !(procEntry.typeMask & REQ_SPELL_PHASE_PROC_FLAG_MASK)) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellPhaseMask` value defined, but it won't be used for defined `typeMask` value", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellPhaseMask` value defined, but it won't be used for defined `typeMask` value", spellInfo->Id); if (procEntry.hitMask & ~PROC_HIT_MASK_ALL) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `hitMask` set: %u", spellId, procEntry.hitMask); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `hitMask` set: %u", spellInfo->Id, procEntry.hitMask); if (procEntry.hitMask && !(procEntry.typeMask & TAKEN_HIT_PROC_FLAG_MASK || (procEntry.typeMask & DONE_HIT_PROC_FLAG_MASK && (!procEntry.spellPhaseMask || procEntry.spellPhaseMask & (PROC_SPELL_PHASE_HIT | PROC_SPELL_PHASE_FINISH))))) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `hitMask` value defined, but it won't be used for defined `typeMask` and `spellPhaseMask` values", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `hitMask` value defined, but it won't be used for defined `typeMask` and `spellPhaseMask` values", spellInfo->Id); - mSpellProcMap[spellId] = procEntry; + mSpellProcMap[spellInfo->Id] = procEntry; if (allRanks) - { - spellId = GetNextSpellInChain(spellId); - spellEntry = GetSpellInfo(spellId); - } + spellInfo = spellInfo->GetNextRankSpell(); else break; } ++count; - } while (result->NextRow()); + } + while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell proc conditions and data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } @@ -2978,6 +2976,9 @@ void SpellMgr::LoadDbcDataCorrections() switch (spellInfo->Id) { + case 53096: // Quetz'lun's Judgment + spellInfo->MaxAffectedTargets = 1; + break; case 42730: spellInfo->EffectTriggerSpell[EFFECT_1] = 42739; break; @@ -3410,6 +3411,9 @@ void SpellMgr::LoadDbcDataCorrections() case 71123: // Decimate (Stinky & Precious) spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_100_YARDS; // 100yd break; + case 71169: // Shadow's Fate + spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS; + break; case 72378: // Blood Nova (Deathbringer Saurfang) case 73058: // Blood Nova (Deathbringer Saurfang) spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; @@ -3615,6 +3619,9 @@ void SpellMgr::LoadDbcDataCorrections() case 40167: // Introspection spellInfo->Attributes |= SPELL_ATTR0_NEGATIVE_1; break; + case 45524: // Chains of Ice + spellInfo->EffectImplicitTargetA[EFFECT_2] = 0; + break; case 2378: // Minor Fortitude spellInfo->manaCost = 0; spellInfo->manaPerSecond = 0; diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index cec9d4650f5..0cdb9601370 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index f7ab6e22f2e..c29b08242a0 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index 26dda4d2327..5791c701c07 100644 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index 89b75fd1695..2439ff11a62 100644 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -187,7 +187,7 @@ void CreatureTextMgr::LoadCreatureTextLocales() mLocaleTextMap.clear(); // for reload case - QueryResult result = WorldDatabase.Query("SELECT entry, textGroup, id, text_loc1, text_loc2, text_loc3, text_loc4, text_loc5, text_loc6, text_loc7, text_loc8 FROM locales_creature_text"); + QueryResult result = WorldDatabase.Query("SELECT entry, groupid, id, text_loc1, text_loc2, text_loc3, text_loc4, text_loc5, text_loc6, text_loc7, text_loc8 FROM locales_creature_text"); if (!result) return; @@ -197,7 +197,7 @@ void CreatureTextMgr::LoadCreatureTextLocales() do { Field* fields = result->Fetch(); - CreatureTextLocale& loc = mLocaleTextMap[CreatureTextId(fields[0].GetUInt32(), uint32(fields[1].GetUInt8()), fields[2].GetUInt32())]; + CreatureTextLocale& loc = mLocaleTextMap[CreatureTextId(fields[0].GetUInt32(), uint32(fields[1].GetUInt8()), uint32(fields[2].GetUInt8()))]; for (uint8 i = 1; i < TOTAL_LOCALES; ++i) { LocaleConstant locale = LocaleConstant(i); diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h index df6dd7fe4f3..6edcbf9a88a 100644 --- a/src/server/game/Texts/CreatureTextMgr.h +++ b/src/server/game/Texts/CreatureTextMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index 3f0e608ec14..1b7ecd34051 100644 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Tickets/TicketMgr.h b/src/server/game/Tickets/TicketMgr.h index 7e6768b96b2..22315ab1926 100644 --- a/src/server/game/Tickets/TicketMgr.h +++ b/src/server/game/Tickets/TicketMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.cpp b/src/server/game/Tools/CharacterDatabaseCleaner.cpp index a342388f583..29d96cc0cfe 100644 --- a/src/server/game/Tools/CharacterDatabaseCleaner.cpp +++ b/src/server/game/Tools/CharacterDatabaseCleaner.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -35,7 +35,7 @@ void CharacterDatabaseCleaner::CleanDatabase() uint32 oldMSTime = getMSTime(); // check flags which clean ups are necessary - QueryResult result = CharacterDatabase.Query("SELECT value FROM worldstates WHERE entry = 20004"); + QueryResult result = CharacterDatabase.PQuery("SELECT value FROM worldstates WHERE entry = %d", WS_CLEANING_FLAGS); if (!result) return; @@ -60,12 +60,11 @@ void CharacterDatabaseCleaner::CleanDatabase() // NOTE: In order to have persistentFlags be set in worldstates for the next cleanup, // you need to define them at least once in worldstates. flags &= sWorld->getIntConfig(CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS); - CharacterDatabase.DirectPExecute("UPDATE worldstates SET value = %u WHERE entry = 20004", flags); + CharacterDatabase.DirectPExecute("UPDATE worldstates SET value = %u WHERE entry = %d", flags, WS_CLEANING_FLAGS); sWorld->SetCleaningFlags(flags); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Cleaned character database in %u ms", GetMSTimeDiffToNow(oldMSTime)); - } void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table, bool (*check)(uint32)) diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.h b/src/server/game/Tools/CharacterDatabaseCleaner.h index d6f541dcfbb..83ac25cdf11 100644 --- a/src/server/game/Tools/CharacterDatabaseCleaner.h +++ b/src/server/game/Tools/CharacterDatabaseCleaner.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp index 57986243879..558fe8e2910 100644 --- a/src/server/game/Tools/PlayerDump.cpp +++ b/src/server/game/Tools/PlayerDump.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -406,7 +406,6 @@ DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, s if (!fin) return DUMP_FILE_OPEN_ERROR; - QueryResult result = QueryResult(NULL); char newguid[20], chraccount[20], newpetid[20], currpetid[20], lastpetid[20]; // make sure the same guid doesn't already exist and is safe to use diff --git a/src/server/game/Tools/PlayerDump.h b/src/server/game/Tools/PlayerDump.h index 321649fc485..895676eb5db 100644 --- a/src/server/game/Tools/PlayerDump.h +++ b/src/server/game/Tools/PlayerDump.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Warden/Modules/WardenModuleMac.h b/src/server/game/Warden/Modules/WardenModuleMac.h index 46011c5bcd9..8a71606cd4d 100644 --- a/src/server/game/Warden/Modules/WardenModuleMac.h +++ b/src/server/game/Warden/Modules/WardenModuleMac.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Warden/Modules/WardenModuleWin.h b/src/server/game/Warden/Modules/WardenModuleWin.h index bf40cde546b..fd369802bf6 100644 --- a/src/server/game/Warden/Modules/WardenModuleWin.h +++ b/src/server/game/Warden/Modules/WardenModuleWin.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp index 06f8454fda7..a99688c8844 100644 --- a/src/server/game/Warden/Warden.cpp +++ b/src/server/game/Warden/Warden.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Warden/Warden.h b/src/server/game/Warden/Warden.h index 7a8f0f52315..7a61f3d5723 100644 --- a/src/server/game/Warden/Warden.h +++ b/src/server/game/Warden/Warden.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Warden/WardenCheckMgr.cpp b/src/server/game/Warden/WardenCheckMgr.cpp index f6daba76c1a..b96cb1156c2 100644 --- a/src/server/game/Warden/WardenCheckMgr.cpp +++ b/src/server/game/Warden/WardenCheckMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Warden/WardenCheckMgr.h b/src/server/game/Warden/WardenCheckMgr.h index 7a83d8f0c6d..d2d6236fc65 100644 --- a/src/server/game/Warden/WardenCheckMgr.h +++ b/src/server/game/Warden/WardenCheckMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Warden/WardenMac.cpp b/src/server/game/Warden/WardenMac.cpp index c6ce33fe131..d1df94d7f07 100644 --- a/src/server/game/Warden/WardenMac.cpp +++ b/src/server/game/Warden/WardenMac.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Warden/WardenMac.h b/src/server/game/Warden/WardenMac.h index b2ecc72367d..2cfb7c66df7 100644 --- a/src/server/game/Warden/WardenMac.h +++ b/src/server/game/Warden/WardenMac.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp index 3d5f27f6a31..bff12280d89 100644 --- a/src/server/game/Warden/WardenWin.cpp +++ b/src/server/game/Warden/WardenWin.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -453,8 +453,8 @@ void WardenWin::HandleData(ByteBuffer &buff) if (luaStrLen != 0) { char *str = new char[luaStrLen + 1]; - memset(str, 0, luaStrLen + 1); memcpy(str, buff.contents() + buff.rpos(), luaStrLen); + str[luaStrLen] = '\0'; // null terminator sLog->outDebug(LOG_FILTER_WARDEN, "Lua string: %s", str); delete[] str; } diff --git a/src/server/game/Warden/WardenWin.h b/src/server/game/Warden/WardenWin.h index 4d859f2b22a..102a64c6895 100644 --- a/src/server/game/Warden/WardenWin.h +++ b/src/server/game/Warden/WardenWin.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Weather/Weather.cpp b/src/server/game/Weather/Weather.cpp index e119ebf5f2e..cd148712b55 100644 --- a/src/server/game/Weather/Weather.cpp +++ b/src/server/game/Weather/Weather.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Weather/Weather.h b/src/server/game/Weather/Weather.h index 59bff95d7ea..1fcd822d580 100644 --- a/src/server/game/Weather/Weather.h +++ b/src/server/game/Weather/Weather.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Weather/WeatherMgr.cpp b/src/server/game/Weather/WeatherMgr.cpp index c96ec1742cf..802cdb8209f 100644 --- a/src/server/game/Weather/WeatherMgr.cpp +++ b/src/server/game/Weather/WeatherMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Weather/WeatherMgr.h b/src/server/game/Weather/WeatherMgr.h index 768cd2dca17..3f680b383b5 100644 --- a/src/server/game/Weather/WeatherMgr.h +++ b/src/server/game/Weather/WeatherMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 7824a72c4d3..d232920418d 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -1134,15 +1134,13 @@ void World::LoadConfigSettings(bool reload) bool enableLOS = ConfigMgr::GetBoolDefault("vmap.enableLOS", true); bool enableHeight = ConfigMgr::GetBoolDefault("vmap.enableHeight", true); bool enablePetLOS = ConfigMgr::GetBoolDefault("vmap.petLOS", true); - std::string ignoreSpellIds = ConfigMgr::GetStringDefault("vmap.ignoreSpellIds", ""); if (!enableHeight) sLog->outError(LOG_FILTER_SERVER_LOADING, "VMap height checking disabled! Creatures movements and other various things WILL be broken! Expect no support."); VMAP::VMapFactory::createOrGetVMapManager()->setEnableLineOfSightCalc(enableLOS); VMAP::VMapFactory::createOrGetVMapManager()->setEnableHeightCalc(enableHeight); - VMAP::VMapFactory::preventSpellsFromBeingTestedForLoS(ignoreSpellIds.c_str()); - sLog->outInfo(LOG_FILTER_SERVER_LOADING, "VMap support included. LineOfSight:%i, getHeight:%i, indoorCheck:%i PetLOS:%i", enableLOS, enableHeight, enableIndoor, enablePetLOS); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "VMap support included. LineOfSight: %i, getHeight: %i, indoorCheck: %i PetLOS: %i", enableLOS, enableHeight, enableIndoor, enablePetLOS); sLog->outInfo(LOG_FILTER_SERVER_LOADING, "VMap data directory is: %svmaps", m_dataPath.c_str()); m_int_configs[CONFIG_MAX_WHO] = ConfigMgr::GetIntDefault("MaxWhoListReturns", 49); @@ -1647,9 +1645,7 @@ void World::SetInitialWorldSettings() LoadAutobroadcasts(); ///- Load and initialize scripts - sObjectMgr->LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate sObjectMgr->LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data) - sObjectMgr->LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data) sObjectMgr->LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data) sObjectMgr->LoadWaypointScripts(); diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 1ac9b153dfd..768f1d327b8 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -471,8 +471,9 @@ enum WorldStates { WS_WEEKLY_QUEST_RESET_TIME = 20002, // Next weekly reset time WS_BG_DAILY_RESET_TIME = 20003, // Next daily BG reset time - WS_MONTHLY_QUEST_RESET_TIME = 20004, // Next monthly reset time + WS_CLEANING_FLAGS = 20004, // Cleaning Flags WS_GUILD_DAILY_RESET_TIME = 20006, // Next guild cap reset time + WS_MONTHLY_QUEST_RESET_TIME = 20007, // Next monthly reset time }; /// Storage class for commands issued for delayed execution @@ -605,8 +606,8 @@ class World /// Get the maximum skill level a player can reach uint16 GetConfigMaxSkillValue() const { - uint8 lvl = getIntConfig(CONFIG_MAX_PLAYER_LEVEL); - return lvl > 60 ? 300 + ((lvl - 60) * 75) / 10 : lvl*5; + uint16 lvl = uint16(getIntConfig(CONFIG_MAX_PLAYER_LEVEL)); + return lvl > 60 ? 300 + ((lvl - 60) * 75) / 10 : lvl * 5; } void SetInitialWorldSettings(); diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt index 8e636ee1208..9726cc1a937 100644 --- a/src/server/scripts/CMakeLists.txt +++ b/src/server/scripts/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # 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/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index a65324a9f42..97e9b35e6cd 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # 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/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 9269bbb07ee..3a20a03bb4a 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -306,6 +306,9 @@ public: { handler->SendSysMessage(LANG_COMMAND_WRONGOLDPASSWORD); handler->SetSentErrorMessage(true); + sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %u (IP: %s) Character:[%s] (GUID: %u) Tried to change password.", + handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(), + handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow()); return false; } @@ -321,6 +324,9 @@ public: { case AOR_OK: handler->SendSysMessage(LANG_COMMAND_PASSWORD); + sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %u (IP: %s) Character:[%s] (GUID: %u) Changed Password.", + handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(), + handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow()); break; case AOR_PASS_TOO_LONG: handler->SendSysMessage(LANG_PASSWORD_TOO_LONG); diff --git a/src/server/scripts/Commands/cs_achievement.cpp b/src/server/scripts/Commands/cs_achievement.cpp index 9a84a4c4cbc..fa97792b85c 100644 --- a/src/server/scripts/Commands/cs_achievement.cpp +++ b/src/server/scripts/Commands/cs_achievement.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp index 3d340f3aaea..0ed19a76984 100644 --- a/src/server/scripts/Commands/cs_ban.cpp +++ b/src/server/scripts/Commands/cs_ban.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_bf.cpp b/src/server/scripts/Commands/cs_bf.cpp index 7284e6ad6b7..6f5c00940f4 100644 --- a/src/server/scripts/Commands/cs_bf.cpp +++ b/src/server/scripts/Commands/cs_bf.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_cast.cpp b/src/server/scripts/Commands/cs_cast.cpp index 7539ebd2b0c..cb4f0ecf68d 100644 --- a/src/server/scripts/Commands/cs_cast.cpp +++ b/src/server/scripts/Commands/cs_cast.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index f8db39e0338..5ec40bcd0fc 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_cheat.cpp b/src/server/scripts/Commands/cs_cheat.cpp index 026177ece6d..9dbc9900e58 100644 --- a/src/server/scripts/Commands/cs_cheat.cpp +++ b/src/server/scripts/Commands/cs_cheat.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 956d9ac3376..030bc136333 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_disable.cpp b/src/server/scripts/Commands/cs_disable.cpp index cf0b1f08e53..37e282cac8e 100644 --- a/src/server/scripts/Commands/cs_disable.cpp +++ b/src/server/scripts/Commands/cs_disable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_event.cpp b/src/server/scripts/Commands/cs_event.cpp index b0a646b7288..8d1370b16c6 100644 --- a/src/server/scripts/Commands/cs_event.cpp +++ b/src/server/scripts/Commands/cs_event.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp index b46f99eaa8f..932bb562f11 100644 --- a/src/server/scripts/Commands/cs_gm.cpp +++ b/src/server/scripts/Commands/cs_gm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index 6d75e63d053..11aa02ce648 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index c9f07c90259..4093861ae9a 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_guild.cpp b/src/server/scripts/Commands/cs_guild.cpp index 73955a6b9b2..afe792048f6 100644 --- a/src/server/scripts/Commands/cs_guild.cpp +++ b/src/server/scripts/Commands/cs_guild.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_honor.cpp b/src/server/scripts/Commands/cs_honor.cpp index c1d9229ccd3..44ebee4f044 100644 --- a/src/server/scripts/Commands/cs_honor.cpp +++ b/src/server/scripts/Commands/cs_honor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp index ffd8a5a7cf7..f1fd9d53423 100644 --- a/src/server/scripts/Commands/cs_instance.cpp +++ b/src/server/scripts/Commands/cs_instance.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index 9c383153d46..4c01b89a3ae 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_lfg.cpp b/src/server/scripts/Commands/cs_lfg.cpp index c4da37d032c..7f39a8fc024 100644 --- a/src/server/scripts/Commands/cs_lfg.cpp +++ b/src/server/scripts/Commands/cs_lfg.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index 977369d1405..fce1f77c2cf 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index c265cd1faa5..2130e61cb47 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -46,6 +46,14 @@ public: { "email", SEC_GAMEMASTER, true, &HandleLookupPlayerEmailCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; + + static ChatCommand lookupSpellCommandTable[] = + { + { "id", SEC_ADMINISTRATOR, true, &HandleLookupSpellIdCommand, "", NULL }, + { "", SEC_ADMINISTRATOR, true, &HandleLookupSpellCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + static ChatCommand lookupCommandTable[] = { { "area", SEC_MODERATOR, true, &HandleLookupAreaCommand, "", NULL }, @@ -58,13 +66,14 @@ public: { "quest", SEC_ADMINISTRATOR, true, &HandleLookupQuestCommand, "", NULL }, { "player", SEC_GAMEMASTER, true, NULL, "", lookupPlayerCommandTable }, { "skill", SEC_ADMINISTRATOR, true, &HandleLookupSkillCommand, "", NULL }, - { "spell", SEC_ADMINISTRATOR, true, &HandleLookupSpellCommand, "", NULL }, + { "spell", SEC_ADMINISTRATOR, true, NULL, "", lookupSpellCommandTable }, { "taxinode", SEC_ADMINISTRATOR, true, &HandleLookupTaxiNodeCommand, "", NULL }, { "tele", SEC_MODERATOR, true, &HandleLookupTeleCommand, "", NULL }, { "title", SEC_GAMEMASTER, true, &HandleLookupTitleCommand, "", NULL }, { "map", SEC_ADMINISTRATOR, true, &HandleLookupMapCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; + static ChatCommand commandTable[] = { { "lookup", SEC_ADMINISTRATOR, true, NULL, "", lookupCommandTable }, @@ -943,6 +952,94 @@ public: return true; } + static bool HandleLookupSpellIdCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + // can be NULL at console call + Player* target = handler->getSelectedPlayer(); + + uint32 id = atoi((char*)args); + + bool found = false; + uint32 count = 0; + uint32 maxResults = 1; + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id); + if (spellInfo) + { + int locale = handler->GetSessionDbcLocale(); + std::string name = spellInfo->SpellName[locale]; + if (name.empty()) + { + handler->SendSysMessage(LANG_COMMAND_NOSPELLFOUND); + return true; + } + + if (locale < TOTAL_LOCALES) + { + if (maxResults && count++ == maxResults) + { + handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); + return true; + } + + bool known = target && target->HasSpell(id); + bool learn = (spellInfo->Effects[0].Effect == SPELL_EFFECT_LEARN_SPELL); + + SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[0].TriggerSpell); + + uint32 talentCost = GetTalentSpellCost(id); + + bool talent = (talentCost > 0); + bool passive = spellInfo->IsPassive(); + bool active = target && target->HasAura(id); + + // unit32 used to prevent interpreting uint8 as char at output + // find rank of learned spell for learning spell, or talent rank + uint32 rank = talentCost ? talentCost : learn && learnSpellInfo ? learnSpellInfo->GetRank() : spellInfo->GetRank(); + + // send spell in "id - [name, rank N] [talent] [passive] [learn] [known]" format + std::ostringstream ss; + if (handler->GetSession()) + ss << id << " - |cffffffff|Hspell:" << id << "|h[" << name; + else + ss << id << " - " << name; + + // include rank in link name + if (rank) + ss << handler->GetTrinityString(LANG_SPELL_RANK) << rank; + + if (handler->GetSession()) + ss << ' ' << localeNames[locale] << "]|h|r"; + else + ss << ' ' << localeNames[locale]; + + if (talent) + ss << handler->GetTrinityString(LANG_TALENT); + if (passive) + ss << handler->GetTrinityString(LANG_PASSIVE); + if (learn) + ss << handler->GetTrinityString(LANG_LEARN); + if (known) + ss << handler->GetTrinityString(LANG_KNOWN); + if (active) + ss << handler->GetTrinityString(LANG_ACTIVE); + + handler->SendSysMessage(ss.str().c_str()); + + if (!found) + found = true; + } + } + + if (!found) + handler->SendSysMessage(LANG_COMMAND_NOSPELLFOUND); + + return true; + } + static bool HandleLookupTaxiNodeCommand(ChatHandler* handler, const char * args) { if (!*args) diff --git a/src/server/scripts/Commands/cs_message.cpp b/src/server/scripts/Commands/cs_message.cpp index 30c94442c51..e2c53492e9d 100644 --- a/src/server/scripts/Commands/cs_message.cpp +++ b/src/server/scripts/Commands/cs_message.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index c701c4f350c..59315e1a813 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 16599e5d892..01648f25cff 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 28e0744c29d..8679e288282 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -87,6 +87,7 @@ public: static ChatCommand npcCommandTable[] = { { "info", SEC_ADMINISTRATOR, false, &HandleNpcInfoCommand, "", NULL }, + { "near", SEC_GAMEMASTER, false, &HandleNpcNearCommand, "", NULL }, { "move", SEC_GAMEMASTER, false, &HandleNpcMoveCommand, "", NULL }, { "playemote", SEC_ADMINISTRATOR, false, &HandleNpcPlayEmoteCommand, "", NULL }, { "say", SEC_MODERATOR, false, &HandleNpcSayCommand, "", NULL }, @@ -627,6 +628,52 @@ public: return true; } + static bool HandleNpcNearCommand(ChatHandler* handler, char const* args) + { + float distance = (!*args) ? 10.0f : float((atof(args))); + uint32 count = 0; + + Player* player = handler->GetSession()->GetPlayer(); + + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_NEAREST); + stmt->setFloat(0, player->GetPositionX()); + stmt->setFloat(1, player->GetPositionY()); + stmt->setFloat(2, player->GetPositionZ()); + stmt->setUInt32(3, player->GetMapId()); + stmt->setFloat(4, player->GetPositionX()); + stmt->setFloat(5, player->GetPositionY()); + stmt->setFloat(6, player->GetPositionZ()); + stmt->setFloat(7, distance * distance); + PreparedQueryResult result = WorldDatabase.Query(stmt); + + if (result) + { + do + { + Field* fields = result->Fetch(); + uint32 guid = fields[0].GetUInt32(); + uint32 entry = fields[1].GetUInt32(); + float x = fields[2].GetFloat(); + float y = fields[3].GetFloat(); + float z = fields[4].GetFloat(); + uint16 mapId = fields[5].GetUInt16(); + + CreatureTemplate const* creatureTemplate = sObjectMgr->GetCreatureTemplate(entry); + if (!creatureTemplate) + continue; + + handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, guid, creatureTemplate->Name.c_str(), x, y, z, mapId); + + ++count; + } + while (result->NextRow()); + } + + handler->PSendSysMessage(LANG_COMMAND_NEAR_NPC_MESSAGE, distance, count); + + return true; + } + //move selected creature static bool HandleNpcMoveCommand(ChatHandler* handler, char const* args) { diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index 22d6e0831d6..a8748bc1adf 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 5b5608f9a26..43c2001fbf7 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -97,7 +97,6 @@ public: { "gameobject_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestInvRelationsCommand, "", NULL }, { "gameobject_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesGameobjectCommand, "", NULL }, { "gameobject_questrelation", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestRelationsCommand, "", NULL }, - { "gameobject_scripts", SEC_ADMINISTRATOR, true, &HandleReloadGameObjectScriptsCommand, "", NULL }, { "gm_tickets", SEC_ADMINISTRATOR, true, &HandleReloadGMTicketsCommand, "", NULL }, { "gossip_menu", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuCommand, "", NULL }, { "gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuOptionCommand, "", NULL }, @@ -126,7 +125,6 @@ public: { "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesPickpocketingCommand, "", NULL}, { "points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadPointsOfInterestCommand, "", NULL }, { "prospecting_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesProspectingCommand, "", NULL }, - { "quest_end_scripts", SEC_ADMINISTRATOR, true, &HandleReloadQuestEndScriptsCommand, "", NULL }, { "quest_poi", SEC_ADMINISTRATOR, true, &HandleReloadQuestPOICommand, "", NULL }, { "quest_template", SEC_ADMINISTRATOR, true, &HandleReloadQuestTemplateCommand, "", NULL }, { "reference_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesReferenceCommand, "", NULL }, @@ -261,9 +259,7 @@ public: } sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts..."); - HandleReloadGameObjectScriptsCommand(handler, "a"); HandleReloadEventScriptsCommand(handler, "a"); - HandleReloadQuestEndScriptsCommand(handler, "a"); HandleReloadSpellScriptsCommand(handler, "a"); handler->SendGlobalGMSysMessage("DB tables `*_scripts` reloaded."); HandleReloadDbScriptStringCommand(handler, "a"); @@ -953,26 +949,6 @@ public: return true; } - static bool HandleReloadGameObjectScriptsCommand(ChatHandler* handler, const char* args) - { - if (sScriptMgr->IsScriptScheduled()) - { - handler->SendSysMessage("DB scripts used currently, please attempt reload later."); - handler->SetSentErrorMessage(true); - return false; - } - - if (*args != 'a') - sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `gameobject_scripts`..."); - - sObjectMgr->LoadGameObjectScripts(); - - if (*args != 'a') - handler->SendGlobalGMSysMessage("DB table `gameobject_scripts` reloaded."); - - return true; - } - static bool HandleReloadEventScriptsCommand(ChatHandler* handler, const char* args) { if (sScriptMgr->IsScriptScheduled()) @@ -1043,26 +1019,6 @@ public: return true; } - static bool HandleReloadQuestEndScriptsCommand(ChatHandler* handler, const char* args) - { - if (sScriptMgr->IsScriptScheduled()) - { - handler->SendSysMessage("DB scripts used currently, please attempt reload later."); - handler->SetSentErrorMessage(true); - return false; - } - - if (*args != 'a') - sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `quest_end_scripts`..."); - - sObjectMgr->LoadQuestEndScripts(); - - if (*args != 'a') - handler->SendGlobalGMSysMessage("DB table `quest_end_scripts` reloaded."); - - return true; - } - static bool HandleReloadSpellScriptsCommand(ChatHandler* handler, const char* args) { if (sScriptMgr->IsScriptScheduled()) diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index 21a22381ae0..44d97ee2221 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index bb4f9be5ffe..309380a9cbb 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index 756bd75387b..fcc0875ca4f 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_ticket.cpp b/src/server/scripts/Commands/cs_ticket.cpp index c2c5a0909d6..3215b533bce 100644 --- a/src/server/scripts/Commands/cs_ticket.cpp +++ b/src/server/scripts/Commands/cs_ticket.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp index c6e11c930fb..4c80f669312 100644 --- a/src/server/scripts/Commands/cs_titles.cpp +++ b/src/server/scripts/Commands/cs_titles.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index c0b2938c156..87b12021212 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Custom/CMakeLists.txt b/src/server/scripts/Custom/CMakeLists.txt index 62abde25905..99cf026f776 100644 --- a/src/server/scripts/Custom/CMakeLists.txt +++ b/src/server/scripts/Custom/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp index cef95b607c7..809bd2440d7 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp index e776194652d..5622e91cd73 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp index 47091c162d9..6e2738d79ca 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp index 0c1eb6e6d30..fea8573d6f8 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp index af61c723ca3..732bbc6f1ba 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp index 5b5787b2ab8..071e0c4dd19 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.h b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.h index b18d8720c3b..dcce7d0c374 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.h +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp index b2031ef0658..99619a89bf3 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp index a07e9059b70..424489fc703 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it 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 bad4d8735b7..3a7baff0196 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp index 15882b30ed2..8c2c590e3e5 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it 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 055f1eebbac..4f876f41907 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp index 2aab7739d8d..51fddc0f71f 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it 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 b6be72d71e0..0631a4308df 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp index c1e00796433..fa8a13f1bfd 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp index 6f665e9efc7..3142610b346 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it 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 ecdcb4b0b82..f4e9d561b5e 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp index 2c2ae3a79c5..f9506a9a551 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h index 0af2af948d3..82500ab90b0 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp index ff40094debd..fa1f79d82e7 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp index 214ce4e02f3..cef633ac2d8 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp index c5d566c51cb..2f9d39152e3 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp index 027952dc74a..afb6ab75649 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp index c455b1d404d..d67fa7c5caa 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp index 0c23f55bd39..ff68462ffb5 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ enum Spells SPELL_BLASTWAVE = 11130, SPELL_SHOUT = 23511, SPELL_CLEAVE = 20691, - SPELL_KNOCKAWAY = 20686, + SPELL_KNOCKAWAY = 20686 }; enum Events @@ -33,14 +33,13 @@ enum Events EVENT_BLAST_WAVE = 1, EVENT_SHOUT = 2, EVENT_CLEAVE = 3, - EVENT_KNOCK_AWAY = 4, + EVENT_KNOCK_AWAY = 4 }; enum Adds { NPC_SPIRESTONE_WARLORD = 9216, - NPC_SMOLDERTHORN_BERSERKER = 9268, - + NPC_SMOLDERTHORN_BERSERKER = 9268 }; const Position SummonLocation1 = { -39.355f, -513.456f, 88.472f, 4.679f }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp index 015c13d1098..047ad3f7096 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ enum Text EMOTE_ONE_STACK = 0, EMOTE_TEN_STACK = 1, EMOTE_FREE_OF_BONDS = 2, - YELL_FREE_OF_BONDS = 3, + YELL_FREE_OF_BONDS = 3 }; enum Spells @@ -37,14 +37,14 @@ enum Spells SPELL_EMBERSEER_FULL_STRENGTH = 16047, // Emberseer Full Strength SPELL_FIRENOVA = 23462, // Combat SPELL_FLAMEBUFFET = 23341, // Combat - SPELL_PYROBLAST = 17274, // Combat + SPELL_PYROBLAST = 17274 // Combat }; enum Events { EVENT_FIRENOVA = 1, EVENT_FLAMEBUFFET = 2, - EVENT_PYROBLAST = 3, + EVENT_PYROBLAST = 3 }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp index d1eb60fbb71..2f86c009d56 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -25,13 +25,13 @@ enum Spells SPELL_SHOOT = 16496, SPELL_STUNBOMB = 16497, SPELL_HEALING_POTION = 15504, - SPELL_HOOKEDNET = 15609, + SPELL_HOOKEDNET = 15609 }; enum Events { EVENT_SHOOT = 1, - EVENT_STUN_BOMB = 2, + EVENT_STUN_BOMB = 2 }; class quartermaster_zigris : public CreatureScript diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp index 1f7e3697a6d..b881f94dda9 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp index 99e87dc617b..69ebf33248f 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp index 843679b460d..f8f4f64b618 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp index a3891ef8590..7d4c7a40d61 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp index 124743174b6..72a5712181e 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp index d05b6220441..0aeba151385 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp index 8f12ab3f2e8..14e4e90337c 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp index 962e65fb8b0..54c1ba99e8d 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp index 4d5f9b214db..7ca74f4ed4f 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp index b191d2fbb02..a1659330a6f 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp index 5a3c72054b4..5594d826fdf 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp index f4a9fcb5060..b8361da5eb8 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp index 6ffe30d2c50..45a9eb397eb 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp index 1335f189286..86709e5e6b5 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp index ae518b7c703..279375be228 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt index 5dc3b52dec1..f581baa31fa 100644 --- a/src/server/scripts/EasternKingdoms/CMakeLists.txt +++ b/src/server/scripts/EasternKingdoms/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -10,8 +10,8 @@ set(scripts_STAT_SRCS ${scripts_STAT_SRCS} - EasternKingdoms/ghostlands.cpp - EasternKingdoms/eversong_woods.cpp + EasternKingdoms/zone_ghostlands.cpp + EasternKingdoms/zone_eversong_woods.cpp EasternKingdoms/AlteracValley/boss_galvangar.cpp EasternKingdoms/AlteracValley/boss_balinda.cpp EasternKingdoms/AlteracValley/boss_drekthar.cpp @@ -31,7 +31,8 @@ set(scripts_STAT_SRCS EasternKingdoms/Scholomance/instance_scholomance.cpp EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp - EasternKingdoms/isle_of_queldanas.cpp + EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp + EasternKingdoms/zone_isle_of_queldanas.cpp EasternKingdoms/boss_kruul.cpp EasternKingdoms/ZulGurub/boss_hakkar.cpp EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -48,12 +49,12 @@ set(scripts_STAT_SRCS EasternKingdoms/ZulGurub/boss_jindo.cpp EasternKingdoms/ZulGurub/boss_wushoolay.cpp EasternKingdoms/ZulGurub/boss_thekal.cpp - EasternKingdoms/wetlands.cpp - EasternKingdoms/arathi_highlands.cpp + EasternKingdoms/zone_wetlands.cpp + EasternKingdoms/zone_arathi_highlands.cpp EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp EasternKingdoms/Gnomeregan/gnomeregan.cpp EasternKingdoms/Gnomeregan/gnomeregan.h - EasternKingdoms/redridge_mountains.cpp + EasternKingdoms/zone_redridge_mountains.cpp EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -67,12 +68,12 @@ set(scripts_STAT_SRCS EasternKingdoms/BlackrockDepths/blackrock_depths.h EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp EasternKingdoms/BlackrockDepths/boss_magmus.cpp - EasternKingdoms/ironforge.cpp + EasternKingdoms/zone_ironforge.cpp EasternKingdoms/ScarletEnclave/chapter2.cpp EasternKingdoms/ScarletEnclave/chapter5.cpp EasternKingdoms/ScarletEnclave/chapter1.cpp - EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp - EasternKingdoms/eastern_plaguelands.cpp + EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp + EasternKingdoms/zone_eastern_plaguelands.cpp EasternKingdoms/MoltenCore/boss_gehennas.cpp EasternKingdoms/MoltenCore/boss_lucifron.cpp EasternKingdoms/MoltenCore/boss_golemagg.cpp @@ -99,7 +100,7 @@ set(scripts_STAT_SRCS EasternKingdoms/Stratholme/boss_postmaster_malown.cpp EasternKingdoms/Stratholme/stratholme.h EasternKingdoms/Stratholme/stratholme.cpp - EasternKingdoms/tirisfal_glades.cpp + EasternKingdoms/zone_tirisfal_glades.cpp EasternKingdoms/SunkenTemple/sunken_temple.cpp EasternKingdoms/SunkenTemple/sunken_temple.h EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp @@ -115,7 +116,7 @@ set(scripts_STAT_SRCS EasternKingdoms/Uldaman/uldaman.h EasternKingdoms/Uldaman/instance_uldaman.cpp EasternKingdoms/Uldaman/boss_archaedas.cpp - EasternKingdoms/swamp_of_sorrows.cpp + EasternKingdoms/zone_swamp_of_sorrows.cpp EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp @@ -139,12 +140,12 @@ set(scripts_STAT_SRCS EasternKingdoms/SunwellPlateau/boss_brutallus.cpp EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp EasternKingdoms/SunwellPlateau/boss_felmyst.cpp - EasternKingdoms/stranglethorn_vale.cpp + EasternKingdoms/zone_stranglethorn_vale.cpp EasternKingdoms/Deadmines/deadmines.h EasternKingdoms/Deadmines/deadmines.cpp EasternKingdoms/Deadmines/boss_mr_smite.cpp EasternKingdoms/Deadmines/instance_deadmines.cpp - EasternKingdoms/duskwood.cpp + EasternKingdoms/zone_duskwood.cpp EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp @@ -157,13 +158,13 @@ set(scripts_STAT_SRCS EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp EasternKingdoms/ScarletMonastery/boss_herod.cpp EasternKingdoms/ScarletMonastery/boss_scorn.cpp - EasternKingdoms/undercity.cpp - EasternKingdoms/silvermoon_city.cpp - EasternKingdoms/loch_modan.cpp + EasternKingdoms/zone_undercity.cpp + EasternKingdoms/zone_silvermoon_city.cpp + EasternKingdoms/zone_loch_modan.cpp EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp EasternKingdoms/ShadowfangKeep/shadowfang_keep.h - EasternKingdoms/burning_steppes.cpp + EasternKingdoms/zone_burning_steppes.cpp EasternKingdoms/BlackwingLair/boss_chromaggus.cpp EasternKingdoms/BlackwingLair/boss_razorgore.cpp EasternKingdoms/BlackwingLair/boss_firemaw.cpp @@ -174,8 +175,8 @@ set(scripts_STAT_SRCS EasternKingdoms/BlackwingLair/boss_nefarian.cpp EasternKingdoms/BlackwingLair/boss_flamegor.cpp EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp - EasternKingdoms/blasted_lands.cpp - EasternKingdoms/stormwind_city.cpp + EasternKingdoms/zone_blasted_lands.cpp + EasternKingdoms/zone_stormwind_city.cpp EasternKingdoms/ZulAman/boss_halazzi.cpp EasternKingdoms/ZulAman/boss_hexlord.cpp EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -185,11 +186,11 @@ set(scripts_STAT_SRCS EasternKingdoms/ZulAman/boss_nalorakk.cpp EasternKingdoms/ZulAman/zulaman.cpp EasternKingdoms/ZulAman/zulaman.h - EasternKingdoms/hinterlands.cpp - EasternKingdoms/western_plaguelands.cpp - EasternKingdoms/alterac_mountains.cpp - EasternKingdoms/westfall.cpp - EasternKingdoms/silverpine_forest.cpp + EasternKingdoms/zone_hinterlands.cpp + EasternKingdoms/zone_western_plaguelands.cpp + EasternKingdoms/zone_alterac_mountains.cpp + EasternKingdoms/zone_westfall.cpp + EasternKingdoms/zone_silverpine_forest.cpp EasternKingdoms/Karazhan/instance_karazhan.cpp EasternKingdoms/Karazhan/boss_nightbane.cpp EasternKingdoms/Karazhan/karazhan.cpp diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp index 712f7fbe8c5..eb8fc77717c 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp index 5ce55307675..991056d0ce0 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h index 419af40ee36..ee3b710df4e 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h +++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp index 1b2beb11351..210fb11a269 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp index 71cd69caeb5..6b0d39d7223 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h index 068ba5d26af..328f22656f6 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp index 8e126fae588..de3606b7b55 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp index 13c70630c7a..bcdd1a9671a 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp index 026524108b3..a431a3e10e7 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index 73fefe210df..8347e1c114d 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -32,10 +32,11 @@ enum Midnight SAY_MIDNIGHT_KILL = 0, SAY_APPEAR = 1, SAY_MOUNT = 2, - SAY_KILL = 3, - SAY_DISARMED = 4, - SAY_DEATH = 5, - SAY_RANDOM = 6, + + SAY_KILL = 0, + SAY_DISARMED = 1, + SAY_DEATH = 2, + SAY_RANDOM = 3, SPELL_SHADOWCLEAVE = 29832, SPELL_INTANGIBLE_PRESENCE = 29833, diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index 38eb3289ec4..5c7c39e3725 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp index 37506d9fd0e..dd9b97386b4 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index 690822203b5..6d9a1f98e93 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -27,25 +27,30 @@ EndScriptData */ #include "ScriptedCreature.h" #include "karazhan.h" -//phase 1 -#define SPELL_BELLOWING_ROAR 39427 -#define SPELL_CHARRED_EARTH 30129 -#define SPELL_DISTRACTING_ASH 30130 -#define SPELL_SMOLDERING_BREATH 30210 -#define SPELL_TAIL_SWEEP 25653 -//phase 2 -#define SPELL_RAIN_OF_BONES 37098 -#define SPELL_SMOKING_BLAST 37057 -#define SPELL_FIREBALL_BARRAGE 30282 -#define SPELL_SEARING_CINDERS 30127 -#define SPELL_SUMMON_SKELETON 30170 - -#define EMOTE_SUMMON "An ancient being awakens in the distance..." -#define YELL_AGGRO "What fools! I shall bring a quick end to your suffering!" -#define YELL_FLY_PHASE "Miserable vermin. I shall exterminate you from the air!" -#define YELL_LAND_PHASE_1 "Enough! I shall land and crush you myself!" -#define YELL_LAND_PHASE_2 "Insects! Let me show you my strength up close!" -#define EMOTE_BREATH "takes a deep breath." +enum Spells +{ + // phase 1 + SPELL_BELLOWING_ROAR = 39427, + SPELL_CHARRED_EARTH = 30129, + SPELL_DISTRACTING_ASH = 30130, + SPELL_SMOLDERING_BREATH = 30210, + SPELL_TAIL_SWEEP = 25653, + // phase 2 + SPELL_RAIN_OF_BONES = 37098, + SPELL_SMOKING_BLAST = 37057, + SPELL_FIREBALL_BARRAGE = 30282, + SPELL_SEARING_CINDERS = 30127, + SPELL_SUMMON_SKELETON = 30170 +}; + +enum Says +{ + EMOTE_SUMMON = 0, // Not used in script + YELL_AGGRO = 1, + YELL_FLY_PHASE = 2, + YELL_LAND_PHASE = 3, + EMOTE_BREATH = 4 +}; float IntroWay[8][3] = { @@ -161,7 +166,7 @@ public: instance->SetData(TYPE_NIGHTBANE, IN_PROGRESS); HandleTerraceDoors(false); - me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, 0); + Talk(YELL_AGGRO); } void AttackStart(Unit* who) @@ -205,7 +210,7 @@ public: { if (id == 0) { - me->MonsterTextEmote(EMOTE_BREATH, 0, true); + Talk(EMOTE_BREATH); Flying = false; Phase = 2; return; @@ -237,7 +242,7 @@ public: void TakeOff() { - me->MonsterYell(YELL_FLY_PHASE, LANG_UNIVERSAL, 0); + Talk(YELL_FLY_PHASE); me->InterruptSpell(CURRENT_GENERIC_SPELL); me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); @@ -403,7 +408,7 @@ public: if (FlyTimer <= diff) //landing { - me->MonsterYell(RAND(*YELL_LAND_PHASE_1, *YELL_LAND_PHASE_2), LANG_UNIVERSAL, 0); + Talk(YELL_LAND_PHASE); me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->MovePoint(3, IntroWay[3][0], IntroWay[3][1], IntroWay[3][2]); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 845a773c108..3a026d23faa 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -88,12 +88,12 @@ enum PrinceMalchezaar SPELL_CLEAVE = 30131, //Same as Nightbane. SPELL_HELLFIRE = 30859, //Infenals' hellfire aura NETHERSPITE_INFERNAL = 17646, //The netherspite infernal creature - MALCHEZARS_AXE = 17650, //Malchezar's axes (creatures), summoned during phase 3 + MALCHEZARS_AXE = 17650, //Malchezar's axes (creatures), summoned during phase 3 - INFERNAL_MODEL_INVISIBLE = 11686, //Infernal Effects + INFERNAL_MODEL_INVISIBLE = 11686, //Infernal Effects SPELL_INFERNAL_RELAY = 30834, - EQUIP_ID_AXE = 33542, //Axes info + EQUIP_ID_AXE = 33542 //Axes info }; //---------Infernal code first diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp index 843220663b7..5bd9e8a0bae 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp index cb5a1b7b914..75a8c8cf662 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index 7053cbb3ed7..6cb4e70ee7a 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp index 2937d0ab700..28bb17055f9 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 1fa5cc9c5af..7d3b63acb6a 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h index c8a1aa55c7e..6857a5eafac 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index 84d0cd6b4c4..5d132cbd34e 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp index b2cf2336024..3ed4c50fab4 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp index dcf70b36df6..a18dbe79d40 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp index 31821623878..85a113ec495 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -70,9 +70,9 @@ public: return new boss_vexallusAI (creature); }; - struct boss_vexallusAI : public ScriptedAI + struct boss_vexallusAI : public BossAI { - boss_vexallusAI(Creature* creature) : ScriptedAI(creature) + boss_vexallusAI(Creature* creature) : BossAI(creature, DATA_VEXALLUS_EVENT) { instance = creature->GetInstanceScript(); } @@ -87,6 +87,7 @@ public: void Reset() { + summons.DespawnAll(); ChainLightningTimer = 8000; ArcaneShockTimer = 5000; OverloadTimer = 1200; @@ -104,6 +105,7 @@ public: void JustDied(Unit* /*killer*/) { + summons.DespawnAll(); if (instance) instance->SetData(DATA_VEXALLUS_EVENT, DONE); } @@ -206,7 +208,10 @@ public: struct mob_pure_energyAI : public ScriptedAI { - mob_pure_energyAI(Creature* creature) : ScriptedAI(creature) {} + mob_pure_energyAI(Creature* creature) : ScriptedAI(creature) + { + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); + } void Reset() {} diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp index c142a0c30d7..9bfcfc4e0f4 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp index 5925be5f415..da1423ed0e9 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h index 41b847635d7..e010eb91522 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp index 85a54398511..cc8f2b41fbb 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp index a9d32ebca9a..824fcca4714 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp index 7261bbf1fbd..6e9d9b00523 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp index 5e5cc0ffab8..65c82610cc2 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp index e3e04002112..1bb93b2e038 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp index 42952580d54..c18e9db1ab7 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp index 043e5b16330..26788e10302 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp index edd8905ff4a..eecd9ae65f4 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -29,17 +29,17 @@ EndScriptData */ enum Texts { - SAY_SUMMON_MAJ = 0, - SAY_ARRIVAL1_RAG = 1, - SAY_ARRIVAL2_MAJ = 2, - SAY_ARRIVAL3_RAG = 3, - SAY_ARRIVAL5_RAG = 4, - SAY_REINFORCEMENTS1 = 5, - SAY_REINFORCEMENTS2 = 6, - SAY_HAND = 7, - SAY_WRATH = 8, - SAY_KILL = 9, - SAY_MAGMABURST = 10 + SAY_SUMMON_MAJ = 0, + SAY_ARRIVAL1_RAG = 1, + SAY_ARRIVAL2_MAJ = 2, + SAY_ARRIVAL3_RAG = 3, + SAY_ARRIVAL5_RAG = 4, + SAY_REINFORCEMENTS1 = 5, + SAY_REINFORCEMENTS2 = 6, + SAY_HAND = 7, + SAY_WRATH = 8, + SAY_KILL = 9, + SAY_MAGMABURST = 10 }; enum Spells @@ -53,24 +53,24 @@ enum Spells SPELL_RAGEMERGE = 20568, SPELL_MELT_WEAPON = 21388, SPELL_ELEMENTAL_FIRE = 20564, - SPELL_ERRUPTION = 17731, + SPELL_ERRUPTION = 17731 }; enum Events { - EVENT_ERUPTION = 1, - EVENT_WRATH_OF_RAGNAROS = 2, - EVENT_HAND_OF_RAGNAROS = 3, - EVENT_LAVA_BURST = 4, - EVENT_ELEMENTAL_FIRE = 5, - EVENT_MAGMA_BLAST = 6, - EVENT_SUBMERGE = 7, - - EVENT_INTRO_1 = 8, - EVENT_INTRO_2 = 9, - EVENT_INTRO_3 = 10, - EVENT_INTRO_4 = 11, - EVENT_INTRO_5 = 12, + EVENT_ERUPTION = 1, + EVENT_WRATH_OF_RAGNAROS = 2, + EVENT_HAND_OF_RAGNAROS = 3, + EVENT_LAVA_BURST = 4, + EVENT_ELEMENTAL_FIRE = 5, + EVENT_MAGMA_BLAST = 6, + EVENT_SUBMERGE = 7, + + EVENT_INTRO_1 = 8, + EVENT_INTRO_2 = 9, + EVENT_INTRO_3 = 10, + EVENT_INTRO_4 = 11, + EVENT_INTRO_5 = 12 }; class boss_ragnaros : public CreatureScript diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp index f696ec58e1b..778a8012269 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp index 343298d29fe..1ad0c5dfa2d 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp index 1a055b9bce0..ec912440fa7 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h index 99dd74fb5fe..407e3ee5204 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h +++ b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 4a29a7d929b..97fe57c5434 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -146,7 +146,7 @@ public: me->CastSpell(me, SPELL_DK_INITIATE_VISUAL, true); if (Player* starter = Unit::GetPlayer(*me, playerGUID)) - sCreatureTextMgr->SendChat(me, SAY_EVENT_ATTACK, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, starter); + Talk(SAY_EVENT_ATTACK); phase = PHASE_TO_ATTACK; } @@ -165,7 +165,7 @@ public: anchor->GetContactPoint(me, anchorX, anchorY, z, 1.0f); playerGUID = target->GetGUID(); - sCreatureTextMgr->SendChat(me, SAY_EVENT_START, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, target); + Talk(SAY_EVENT_START); } void UpdateAI(const uint32 diff) @@ -330,15 +330,21 @@ public: #define GOSSIP_ACCEPT_DUEL "I challenge you, death knight!" -enum eDuelEnums +enum Spells_DKI { - SAY_DUEL = 0, - SPELL_DUEL = 52996, //SPELL_DUEL_TRIGGERED = 52990, SPELL_DUEL_VICTORY = 52994, SPELL_DUEL_FLAG = 52991, +}; + +enum Says_VBM +{ + SAY_DUEL = 0, +}; +enum Misc_VBN +{ QUEST_DEATH_CHALLENGE = 12733, FACTION_HOSTILE = 2068 }; @@ -501,8 +507,15 @@ public: ## npc_dark_rider_of_acherus ######*/ -#define DESPAWN_HORSE 52267 -#define SAY_DARK_RIDER "The realm of shadows awaits..." +enum Spells_DR +{ + SPELL_DESPAWN_HORSE = 51918 +}; + +enum Says_DR +{ + SAY_DARK_RIDER = 0 +}; class npc_dark_rider_of_acherus : public CreatureScript { @@ -547,7 +560,7 @@ public: break; case 1: if (Unit* target = Unit::GetUnit(*me, TargetGUID)) - DoCast(target, DESPAWN_HORSE, true); + DoCast(target, SPELL_DESPAWN_HORSE, true); PhaseTimer = 3000; Phase = 2; break; @@ -587,13 +600,13 @@ public: ## npc_salanar_the_horseman ######*/ -enum eSalanar +enum Spells_Salanar { - REALM_OF_SHADOWS = 52693, - EFFECT_STOLEN_HORSE = 52263, - DELIVER_STOLEN_HORSE = 52264, - CALL_DARK_RIDER = 52266, - SPELL_EFFECT_OVERTAKE = 52349 + SPELL_REALM_OF_SHADOWS = 52693, + SPELL_EFFECT_STOLEN_HORSE = 52263, + SPELL_DELIVER_STOLEN_HORSE = 52264, + SPELL_CALL_DARK_RIDER = 52266, + SPELL_EFFECT_OVERTAKE = 52349 }; class npc_salanar_the_horseman : public CreatureScript @@ -612,18 +625,18 @@ public: void SpellHit(Unit* caster, const SpellInfo* spell) { - if (spell->Id == DELIVER_STOLEN_HORSE) + if (spell->Id == SPELL_DELIVER_STOLEN_HORSE) { if (caster->GetTypeId() == TYPEID_UNIT && caster->IsVehicle()) { if (Unit* charmer = caster->GetCharmer()) { - if (charmer->HasAura(EFFECT_STOLEN_HORSE)) + if (charmer->HasAura(SPELL_EFFECT_STOLEN_HORSE)) { - charmer->RemoveAurasDueToSpell(EFFECT_STOLEN_HORSE); + charmer->RemoveAurasDueToSpell(SPELL_EFFECT_STOLEN_HORSE); caster->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); caster->setFaction(35); - DoCast(caster, CALL_DARK_RIDER, true); + DoCast(caster, SPELL_CALL_DARK_RIDER, true); if (Creature* Dark_Rider = me->FindNearestCreature(28654, 15)) CAST_AI(npc_dark_rider_of_acherus::npc_dark_rider_of_acherusAI, Dark_Rider->AI())->InitDespawnHorse(caster); } @@ -651,8 +664,8 @@ public: //CAST_CRE(who)->Respawn(true); } - if (CAST_PLR(charmer)->HasAura(REALM_OF_SHADOWS)) - charmer->RemoveAurasDueToSpell(REALM_OF_SHADOWS); + if (CAST_PLR(charmer)->HasAura(SPELL_REALM_OF_SHADOWS)) + charmer->RemoveAurasDueToSpell(SPELL_REALM_OF_SHADOWS); } } } @@ -715,10 +728,10 @@ public: }; // correct way: 52312 52314 52555 ... -enum SG +enum Creatures_SG { - GHOULS = 28845, - GHOSTS = 28846, + NPC_GHOULS = 28845, + NPC_GHOSTS = 28846, }; class npc_dkc1_gothik : public CreatureScript { @@ -738,7 +751,7 @@ public: { ScriptedAI::MoveInLineOfSight(who); - if (who->GetEntry() == GHOULS && me->IsWithinDistInMap(who, 10.0f)) + if (who->GetEntry() == NPC_GHOULS && me->IsWithinDistInMap(who, 10.0f)) { if (Unit* owner = who->GetOwner()) { @@ -753,7 +766,7 @@ public: CAST_CRE(who)->DespawnOrUnsummon(); if (CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_COMPLETE) - owner->RemoveAllMinionsByEntry(GHOULS); + owner->RemoveAllMinionsByEntry(NPC_GHOSTS); } } } @@ -786,7 +799,7 @@ public: void FindMinions(Unit* owner) { std::list<Creature*> MinionList; - owner->GetAllMinionsByEntry(MinionList, GHOULS); + owner->GetAllMinionsByEntry(MinionList, NPC_GHOULS); if (!MinionList.empty()) { @@ -812,7 +825,7 @@ public: Player* plrOwner = owner->ToPlayer(); if (plrOwner && plrOwner->isInCombat()) { - if (plrOwner->getAttackerForHelper() && plrOwner->getAttackerForHelper()->GetEntry() == GHOSTS) + if (plrOwner->getAttackerForHelper() && plrOwner->getAttackerForHelper()->GetEntry() == NPC_GHOSTS) AttackStart(plrOwner->getAttackerForHelper()); else FindMinions(owner); @@ -825,7 +838,7 @@ public: //ScriptedAI::UpdateAI(diff); //Check if we have a current target - if (me->getVictim()->GetEntry() == GHOSTS) + if (me->getVictim()->GetEntry() == NPC_GHOSTS) { if (me->isAttackReady()) { @@ -846,8 +859,11 @@ public: ## npc_scarlet_miner_cart ####*/ -#define SPELL_CART_CHECK 54173 -#define SPELL_CART_DRAG 52465 +enum Spells_SM +{ + SPELL_CART_CHECK = 54173, + SPELL_CART_DRAG = 52465 +}; class npc_scarlet_miner_cart : public CreatureScript { @@ -902,8 +918,11 @@ public: ## npc_scarlet_miner ####*/ -#define SAY_SCARLET_MINER1 "Where'd this come from? I better get this down to the ships before the foreman sees it!" -#define SAY_SCARLET_MINER2 "Now I can have a rest!" +enum Says_SM +{ + SAY_SCARLET_MINER_0 = 0, + SAY_SCARLET_MINER_1 = 1 +}; class npc_scarlet_miner : public CreatureScript { @@ -984,7 +1003,7 @@ public: me->SetInFront(car); me->SendMovementFlagUpdate(); } - me->MonsterSay(SAY_SCARLET_MINER1, LANG_UNIVERSAL, 0); + Talk(SAY_SCARLET_MINER_0); SetRun(true); IntroTimer = 4000; IntroPhase = 1; @@ -998,7 +1017,7 @@ public: car->StopMoving(); car->RemoveAura(SPELL_CART_DRAG); } - me->MonsterSay(SAY_SCARLET_MINER2, LANG_UNIVERSAL, 0); + Talk(SAY_SCARLET_MINER_1); break; default: break; @@ -1036,7 +1055,10 @@ public: ## go_inconspicuous_mine_car ######*/ -#define SPELL_CART_SUMM 52463 +enum Spells_Cart +{ + SPELL_CART_SUMM = 52463 +}; class go_inconspicuous_mine_car : public GameObjectScript { diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 7ceb86dd980..6985ad2c4ad 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 8f410cf62bc..ff92710d5b2 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp index 6e7f7e103c5..32ce484f715 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -23,8 +23,16 @@ /*#### ## npc_valkyr_battle_maiden ####*/ -#define SPELL_REVIVE 51918 -#define VALK_WHISPER "It is not yet your time, champion. Rise! Rise and fight once more!" + +enum Spells_VBM +{ + SPELL_REVIVE = 51918 +}; + +enum Says_VBM +{ + WHISPER_REVIVE = 0 +}; class npc_valkyr_battle_maiden : public CreatureScript { @@ -96,7 +104,7 @@ public: { me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOM_SPELL_01); DoCast(player, SPELL_REVIVE, true); - me->MonsterWhisper(VALK_WHISPER, player->GetGUID()); + Talk(WHISPER_REVIVE,player->GetGUID()); } FlyBackTimer = 5000; break; diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp index 33335c32d05..1ede8a871d9 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp index a2cc0172969..23480154c22 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp index b97e1d15dc0..7540a1eefb3 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 2ff3dcd5e32..4927666073b 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -29,6 +29,7 @@ EndScriptData */ #include "scarlet_monastery.h" #include "LFGMgr.h" #include "Player.h" +#include "Group.h" #include "SpellInfo.h" //this texts are already used by 3975 and 3976 @@ -576,10 +577,7 @@ public: Map::PlayerList const& players = me->GetMap()->GetPlayers(); if (!players.isEmpty()) - for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i) - if (Player* player = i->getSource()) - if (player->IsAtGroupRewardDistance(me)) - sLFGMgr->RewardDungeonDoneFor(285, player); + sLFGMgr->FinishDungeon(players.begin()->getSource()->GetGroup()->GetGUID(), 285); } void SpellHit(Unit* caster, const SpellInfo* spell) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp index 8c1b22e9871..6e24dd81bbe 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp index 847a14f54d8..2c64ba693d0 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp index 0d08431d39c..1b2679538b0 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp index f0e7ac94703..76673b7a632 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp index 651ca453916..70af355a4c7 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp index 6eb27327438..f6b6118f701 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index e65ab21b8cf..8c45231ecbf 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h index 70b18919704..52710cd348e 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp index c2ccde645ca..4e2a1b6fa19 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp @@ -1,6 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,216 +15,346 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Darkmaster_Gandling -SD%Complete: 75 -SDComment: Doors missing in instance script. -SDCategory: Scholomance -EndScriptData */ +/* +Name: Boss_Darkmaster_Gandling +%Complete: 90 +Comment: Doors Not yet reopening. +Category: Scholomance +*/ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "scholomance.h" +#include "SpellScript.h" -#define SPELL_ARCANEMISSILES 22272 -#define SPELL_SHADOWSHIELD 22417 //Not right ID. But 12040 is wrong either. -#define SPELL_CURSE 18702 - -#define ADD_1X 170.205f -#define ADD_1Y 99.413f -#define ADD_1Z 104.733f -#define ADD_1O 3.16f - -#define ADD_2X 170.813f -#define ADD_2Y 97.857f -#define ADD_2Z 104.713f -#define ADD_2O 3.16f +enum Says +{ + YELL_SUMMONED = 0 +}; -#define ADD_3X 170.720f -#define ADD_3Y 100.900f -#define ADD_3Z 104.739f -#define ADD_3O 3.16f +enum Spells +{ + SPELL_ARCANEMISSILES = 15790, + SPELL_SHADOWSHIELD = 12040, + SPELL_CURSE = 18702, + SPELL_SHADOW_PORTAL = 17950 +}; -#define ADD_4X 171.866f -#define ADD_4Y 99.373f -#define ADD_4Z 104.732f -#define ADD_4O 3.16f +enum Events +{ + EVENT_ARCANEMISSILES = 1, + EVENT_SHADOWSHIELD = 2, + EVENT_CURSE = 3, + EVENT_SHADOW_PORTAL = 4 +}; class boss_darkmaster_gandling : public CreatureScript { -public: - boss_darkmaster_gandling() : CreatureScript("boss_darkmaster_gandling") { } + public: boss_darkmaster_gandling() : CreatureScript("boss_darkmaster_gandling") { } - CreatureAI* GetAI(Creature* creature) const - { - return new boss_darkmaster_gandlingAI (creature); - } - - struct boss_darkmaster_gandlingAI : public ScriptedAI - { - boss_darkmaster_gandlingAI(Creature* creature) : ScriptedAI(creature) + struct boss_darkmaster_gandlingAI : public BossAI { - instance = me->GetInstanceScript(); - } + boss_darkmaster_gandlingAI(Creature* creature) : BossAI(creature, DATA_DARKMASTERGANDLING) {} + + void Reset() + { + if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_GANDLING))) + gate->SetGoState(GO_STATE_ACTIVE); + } + + void JustDied(Unit* /*killer*/) + { + if (instance) + instance->SetData(DATA_DARKMASTERGANDLING, DONE); + if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_GANDLING))) + gate->SetGoState(GO_STATE_ACTIVE); + } + + void EnterCombat(Unit* /*who*/) + { + events.ScheduleEvent(EVENT_ARCANEMISSILES, 4500); + events.ScheduleEvent(EVENT_SHADOWSHIELD, 12000); + events.ScheduleEvent(EVENT_CURSE, 2000); + events.ScheduleEvent(EVENT_SHADOW_PORTAL, 16000); + + if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_GANDLING))) + gate->SetGoState(GO_STATE_READY); + } - InstanceScript* instance; + void IsSummonedBy(Unit* /*summoner*/) + { + Talk(YELL_SUMMONED); + me->GetMotionMaster()->MoveRandom(5); + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); - uint32 ArcaneMissiles_Timer; - uint32 ShadowShield_Timer; - uint32 Curse_Timer; - uint32 Teleport_Timer; + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - void Reset() + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_ARCANEMISSILES: + DoCastVictim(SPELL_ARCANEMISSILES, true); + events.ScheduleEvent(EVENT_ARCANEMISSILES, 8000); + break; + case EVENT_SHADOWSHIELD: + DoCast(me, SPELL_SHADOWSHIELD); + events.ScheduleEvent(EVENT_SHADOWSHIELD, urand(14000, 28000)); + break; + case EVENT_CURSE: + DoCastVictim(SPELL_CURSE, true); + events.ScheduleEvent(EVENT_CURSE, urand(15000, 27000)); + break; + case EVENT_SHADOW_PORTAL: + if (HealthAbovePct(3)) + { + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_SHADOW_PORTAL,true); + events.ScheduleEvent(EVENT_SHADOW_PORTAL, urand(17000, 27000)); + } + } + } + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const { - ArcaneMissiles_Timer = 4500; - ShadowShield_Timer = 12000; - Curse_Timer = 2000; - Teleport_Timer = 16000; + return new boss_darkmaster_gandlingAI (creature); } +}; - void EnterCombat(Unit* /*who*/) +// Script for Shadow Portal spell 17950 +enum Rooms +{ + ROOM_HALL_OF_SECRETS = 0, + ROOM_HALL_OF_THE_DAMNED = 1, + ROOM_THE_COVEN = 2, + ROOM_THE_SHADOW_VAULT = 3, + ROOM_BAROV_FAMILY_VAULT = 4, + ROOM_VAULT_OF_THE_RAVENIAN = 5 +}; + +enum SPSpells +{ + SPELL_SHADOW_PORTAL_HALLOFSECRETS = 17863, + SPELL_SHADOW_PORTAL_HALLOFTHEDAMNED = 17939, + SPELL_SHADOW_PORTAL_THECOVEN = 17943, + SPELL_SHADOW_PORTAL_THESHADOWVAULT = 17944, + SPELL_SHADOW_PORTAL_BAROVFAMILYVAULT = 17946, + SPELL_SHADOW_PORTAL_VAULTOFTHERAVENIAN = 17948 +}; + +class spell_shadow_portal : public SpellScriptLoader +{ + public: + spell_shadow_portal() : SpellScriptLoader("spell_shadow_portal") { } + + class spell_shadow_portal_SpellScript : public SpellScript { - } + PrepareSpellScript(spell_shadow_portal_SpellScript); - void JustDied(Unit* /*killer*/) + void HandleCast(SpellEffIndex /*effIndex*/) + { + Creature* caster = GetCaster()->ToCreature(); + int8 attempts = 0; + int32 spell_to_cast =0; + + while (!spell_to_cast) + { + if (attempts++ >= 6) break; + + switch (urand(0,5)) + { + case ROOM_HALL_OF_SECRETS: + if (InstanceScript* instance = GetCaster()->GetInstanceScript()) + if (GameObject::GetGameObject(*caster, instance->GetData64(GO_GATE_RAVENIAN))->GetGoState() == GO_STATE_ACTIVE) + spell_to_cast = SPELL_SHADOW_PORTAL_HALLOFSECRETS; + break; + case ROOM_HALL_OF_THE_DAMNED: + if (InstanceScript* instance = GetCaster()->GetInstanceScript()) + if (GameObject::GetGameObject(*caster, instance->GetData64(GO_GATE_THEOLEN))->GetGoState() == GO_STATE_ACTIVE) + spell_to_cast = SPELL_SHADOW_PORTAL_HALLOFTHEDAMNED; + break; + case ROOM_THE_COVEN: + if (InstanceScript* instance = GetCaster()->GetInstanceScript()) + if (GameObject::GetGameObject(*caster, instance->GetData64(GO_GATE_MALICIA))->GetGoState() == GO_STATE_ACTIVE) + spell_to_cast = SPELL_SHADOW_PORTAL_THECOVEN; + break; + case ROOM_THE_SHADOW_VAULT: + if (InstanceScript* instance = GetCaster()->GetInstanceScript()) + if (GameObject::GetGameObject(*caster, instance->GetData64(GO_GATE_ILLUCIA))->GetGoState() == GO_STATE_ACTIVE) + spell_to_cast = SPELL_SHADOW_PORTAL_THESHADOWVAULT; + break; + case ROOM_BAROV_FAMILY_VAULT: + if (InstanceScript* instance = GetCaster()->GetInstanceScript()) + if (GameObject::GetGameObject(*caster, instance->GetData64(GO_GATE_BAROV))->GetGoState() == GO_STATE_ACTIVE) + spell_to_cast = SPELL_SHADOW_PORTAL_BAROVFAMILYVAULT; + break; + case ROOM_VAULT_OF_THE_RAVENIAN: + if (InstanceScript* instance = GetCaster()->GetInstanceScript()) + if (GameObject::GetGameObject(*caster, instance->GetData64(GO_GATE_POLKELT))->GetGoState() == GO_STATE_ACTIVE) + spell_to_cast = SPELL_SHADOW_PORTAL_VAULTOFTHERAVENIAN; + break; + } + + if (spell_to_cast) + GetHitUnit()->CastSpell(GetHitUnit(), spell_to_cast); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_shadow_portal_SpellScript::HandleCast, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - if (instance) - instance->SetData(TYPE_GANDLING, DONE); + return new spell_shadow_portal_SpellScript(); } +}; + +// Script for Shadow Portal spells 17863,17939,17943,17944,17946,17948 +Position const SummonPos[18] = +{ + // Hall of Secrects + + + + // The Hall of the damned + { 177.9624f, -68.23893f, 84.95197f, 3.228859f }, + { 183.7705f, -61.43489f, 84.92424f, 5.148721f }, + { 184.7035f, -77.74805f, 84.92424f, 4.660029f }, + // The Coven + { 111.7203f, -1.105035f, 85.45985f, 3.961897f }, + { 118.0079f, 6.430664f, 85.31169f, 2.408554f }, + { 120.0276f, -7.496636f, 85.31169f, 2.984513f }, + // The Shadow Vault + { 245.3716f, 0.628038f, 72.73877f, 0.01745329f }, + { 240.9920f, 3.405653f, 72.73877f, 6.143559f }, + { 240.9543f, -3.182943f, 72.73877f, 0.2268928f }, + // Barov Family Vault + { 181.8245f, -42.58117f, 75.4812f, 4.660029f }, + { 177.7456f, -42.74745f, 75.4812f, 4.886922f }, + { 185.6157f, -42.91200f, 75.4812f, 4.45059f }, + // Vault of the Ravenian + + + +}; - void UpdateAI(const uint32 diff) +enum Creatures +{ + NPC_RISEN_GUARDIAN = 11598 +}; + +enum ScriptEventId +{ + SPELL_EVENT_HALLOFSECRETS = 5618, + SPELL_EVENT_HALLOFTHEDAMNED = 5619, + SPELL_EVENT_THECOVEN = 5620, + SPELL_EVENT_THESHADOWVAULT = 5621, + SPELL_EVENT_BAROVFAMILYVAULT = 5622, + SPELL_EVENT_VAULTOFTHERAVENIAN = 5623 +}; + +class spell_shadow_portal_rooms : public SpellScriptLoader +{ + public: + spell_shadow_portal_rooms() : SpellScriptLoader("spell_shadow_portal_rooms") { } + + class spell_shadow_portal_rooms_SpellScript : public SpellScript { - if (!UpdateVictim()) - return; + PrepareSpellScript(spell_shadow_portal_rooms_SpellScript); - //ArcaneMissiles_Timer - if (ArcaneMissiles_Timer <= diff) + void HandleSendEvent(SpellEffIndex effIndex) { - DoCast(me->getVictim(), SPELL_ARCANEMISSILES); - ArcaneMissiles_Timer = 8000; - } else ArcaneMissiles_Timer -= diff; + // If only one player in threat list fail spell - //ShadowShield_Timer - if (ShadowShield_Timer <= diff) - { - DoCast(me, SPELL_SHADOWSHIELD); - ShadowShield_Timer = urand(14000, 28000); - } else ShadowShield_Timer -= diff; + Creature* Summoned = NULL; + Creature* caster = GetCaster()->ToCreature(); - //Curse_Timer - if (Curse_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CURSE); - Curse_Timer = urand(15000, 27000); - } else Curse_Timer -= diff; + int8 pos_to_summon = 0; + int8 phase_to_set = 0; + int32 gate_to_close = 0; - //Teleporting Random Target to one of the six pre boss rooms and spawn 3-4 skeletons near the gamer. - //We will only telport if gandling has more than 3% of hp so teleported gamers can always loot. - if (HealthAbovePct(3)) - { - if (Teleport_Timer <= diff) + switch (GetSpellInfo()->Effects[effIndex].MiscValue) { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target && target->GetTypeId() == TYPEID_PLAYER) - { - if (DoGetThreat(target)) - DoModifyThreatPercent(target, -100); + case SPELL_EVENT_HALLOFSECRETS: + pos_to_summon = 0; // Not yet spawned + phase_to_set = 1; + gate_to_close = GO_GATE_RAVENIAN; + break; + case SPELL_EVENT_HALLOFTHEDAMNED: + pos_to_summon = 0; + phase_to_set = 2; + gate_to_close = GO_GATE_THEOLEN; + break; + case SPELL_EVENT_THECOVEN: + pos_to_summon = 3; + phase_to_set = 3; + gate_to_close = GO_GATE_MALICIA; + break; + case SPELL_EVENT_THESHADOWVAULT: + pos_to_summon = 6; + phase_to_set = 4; + gate_to_close = GO_GATE_ILLUCIA; + break; + case SPELL_EVENT_BAROVFAMILYVAULT: + pos_to_summon = 9; + phase_to_set = 5; + gate_to_close = GO_GATE_BAROV; + break; + case SPELL_EVENT_VAULTOFTHERAVENIAN: + pos_to_summon = 0; // Not yet spawned + phase_to_set = 6; + gate_to_close = GO_GATE_POLKELT; + break; + default: + break; + } - Creature* Summoned = NULL; - switch (rand()%6) + if (gate_to_close && (GetCaster()->GetMap()->GetId() == 289)) + { + for (uint8 i = 0; i < 3; ++i) + { + Summoned = GetCaster()->SummonCreature(NPC_RISEN_GUARDIAN, SummonPos[pos_to_summon++], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + if (Summoned) { - case 0: - DoTeleportPlayer(target, 250.0696f, 0.3921f, 84.8408f, 3.149f); - Summoned = me->SummonCreature(16119, 254.2325f, 0.3417f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - Summoned = me->SummonCreature(16119, 257.7133f, 4.0226f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - Summoned = me->SummonCreature(16119, 258.6702f, -2.60656f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - break; - case 1: - DoTeleportPlayer(target, 181.4220f, -91.9481f, 84.8410f, 1.608f); - Summoned = me->SummonCreature(16119, 184.0519f, -73.5649f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - Summoned = me->SummonCreature(16119, 179.5951f, -73.7045f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - Summoned = me->SummonCreature(16119, 180.6452f, -78.2143f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - Summoned = me->SummonCreature(16119, 283.2274f, -78.1518f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - break; - case 2: - DoTeleportPlayer(target, 95.1547f, -1.8173f, 85.2289f, 0.043f); - Summoned = me->SummonCreature(16119, 100.9404f, -1.8016f, 85.2289f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - Summoned = me->SummonCreature(16119, 101.3729f, 0.4882f, 85.2289f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - Summoned = me->SummonCreature(16119, 101.4596f, -4.4740f, 85.2289f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - break; - case 3: - DoTeleportPlayer(target, 250.0696f, 0.3921f, 72.6722f, 3.149f); - Summoned = me->SummonCreature(16119, 240.34481f, 0.7368f, 72.6722f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - Summoned = me->SummonCreature(16119, 240.3633f, -2.9520f, 72.6722f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - Summoned = me->SummonCreature(16119, 240.6702f, 3.34949f, 72.6722f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - break; - case 4: - DoTeleportPlayer(target, 181.4220f, -91.9481f, 70.7734f, 1.608f); - Summoned = me->SummonCreature(16119, 184.0519f, -73.5649f, 70.7734f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - Summoned = me->SummonCreature(16119, 179.5951f, -73.7045f, 70.7734f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - Summoned = me->SummonCreature(16119, 180.6452f, -78.2143f, 70.7734f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - Summoned = me->SummonCreature(16119, 283.2274f, -78.1518f, 70.7734f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - break; - case 5: - DoTeleportPlayer(target, 106.1541f, -1.8994f, 75.3663f, 0.043f); - Summoned = me->SummonCreature(16119, 115.3945f, -1.5555f, 75.3663f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - Summoned = me->SummonCreature(16119, 257.7133f, 1.8066f, 75.3663f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - Summoned = me->SummonCreature(16119, 258.6702f, -5.1001f, 75.3663f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (Summoned) - Summoned->AI()->AttackStart(target); - break; + Summoned->GetMotionMaster()->MoveRandom(5); + Summoned->AI()->SetData(0,phase_to_set); } } - Teleport_Timer = urand(20000, 35000); - } else Teleport_Timer -= diff; + + if (InstanceScript* instance = GetCaster()->GetInstanceScript()) + if (GameObject* gate = GameObject::GetGameObject(*caster, instance->GetData64(gate_to_close))) + gate->SetGoState(GO_STATE_READY); + } } - DoMeleeAttackIfReady(); - } - }; + void Register() + { + OnEffectHit += SpellEffectFn(spell_shadow_portal_rooms_SpellScript::HandleSendEvent, EFFECT_1, SPELL_EFFECT_SEND_EVENT); + } + }; + SpellScript* GetSpellScript() const + { + return new spell_shadow_portal_rooms_SpellScript(); + } }; void AddSC_boss_darkmaster_gandling() { new boss_darkmaster_gandling(); + new spell_shadow_portal(); + new spell_shadow_portal_rooms(); } diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp index b4c4332aa45..fffcc7cdf11 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp index 08aa86d6a06..fc54b90ab45 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp @@ -1,6 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,105 +15,99 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Doctor_Theolen_Krastinov -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ +/* +Name: Boss_Doctor_Theolen_Krastinov +%Complete: 100 +Comment: +Category: Scholomance +*/ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "scholomance.h" -enum eEnums +enum Say { EMOTE_FRENZY_KILL = 0, +}; + +enum Spells +{ SPELL_REND = 16509, SPELL_BACKHAND = 18103, SPELL_FRENZY = 8269 }; -class boss_doctor_theolen_krastinov : public CreatureScript +enum Events { -public: - boss_doctor_theolen_krastinov() : CreatureScript("boss_doctor_theolen_krastinov") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_theolenkrastinovAI (creature); - } - - struct boss_theolenkrastinovAI : public ScriptedAI - { - boss_theolenkrastinovAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 m_uiRend_Timer; - uint32 m_uiBackhand_Timer; - uint32 m_uiFrenzy_Timer; + EVENT_REND = 1, + EVENT_BACKHAND = 2, + EVENT_FRENZY = 3 +}; - void Reset() - { - m_uiRend_Timer = 8000; - m_uiBackhand_Timer = 9000; - m_uiFrenzy_Timer = 1000; - } +class boss_doctor_theolen_krastinov : public CreatureScript +{ + public: boss_doctor_theolen_krastinov() : CreatureScript("boss_doctor_theolen_krastinov") { } - void JustDied(Unit* /*killer*/) + struct boss_theolenkrastinovAI : public BossAI { - InstanceScript* instance = me->GetInstanceScript(); - if (instance) - { - instance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0); + boss_theolenkrastinovAI(Creature* creature) : BossAI(creature, DATA_DOCTORTHEOLENKRASTINOV) {} - if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) - { - instance->SetData(TYPE_GANDLING, IN_PROGRESS); - me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; + void Reset() {} - //Rend_Timer - if (m_uiRend_Timer <= uiDiff) + void JustDied(Unit* /*killer*/) { - DoCast(me->getVictim(), SPELL_REND); - m_uiRend_Timer = 10000; + if (instance) + instance->SetData(DATA_DOCTORTHEOLENKRASTINOV, DONE); } - else - m_uiRend_Timer -= uiDiff; - //Backhand_Timer - if (m_uiBackhand_Timer <= uiDiff) + void EnterCombat(Unit* /*who*/) { - DoCast(me->getVictim(), SPELL_BACKHAND); - m_uiBackhand_Timer = 10000; + events.ScheduleEvent(EVENT_REND, 8000); + events.ScheduleEvent(EVENT_BACKHAND, 9000); + events.ScheduleEvent(EVENT_FRENZY, 1000); } - else - m_uiBackhand_Timer -= uiDiff; - //Frenzy_Timer - if (HealthBelowPct(26)) + void UpdateAI(uint32 const diff) { - if (m_uiFrenzy_Timer <= uiDiff) - { - DoCast(me, SPELL_FRENZY); - Talk(EMOTE_FRENZY_KILL); + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - m_uiFrenzy_Timer = 120000; + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_REND: + DoCastVictim(SPELL_REND, true); + events.ScheduleEvent(EVENT_REND, 10000); + break; + case EVENT_BACKHAND: + DoCastVictim(SPELL_BACKHAND, true); + events.ScheduleEvent(EVENT_BACKHAND, 10000); + break; + case EVENT_FRENZY: + DoCast(me, SPELL_FRENZY, true); + Talk(EMOTE_FRENZY_KILL); + events.ScheduleEvent(EVENT_FRENZY, 120000); + break; + default: + break; + } } - else - m_uiFrenzy_Timer -= uiDiff; + + DoMeleeAttackIfReady(); } + }; - DoMeleeAttackIfReady(); + CreatureAI* GetAI(Creature* creature) const + { + return new boss_theolenkrastinovAI (creature); } - }; }; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp index e1cffbaf90d..64d827e41f1 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp @@ -1,6 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,108 +15,100 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Illucia_Barov -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ +/* +Name: Boss_Illucia_Barov +%Complete: 100 +Comment: +Category: Scholomance +*/ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "scholomance.h" -#define SPELL_CURSEOFAGONY 18671 -#define SPELL_SHADOWSHOCK 20603 -#define SPELL_SILENCE 15487 -#define SPELL_FEAR 6215 - -class boss_illucia_barov : public CreatureScript +enum Spells { -public: - boss_illucia_barov() : CreatureScript("boss_illucia_barov") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_illuciabarovAI (creature); - } + SPELL_CURSEOFAGONY = 34794, + SPELL_SHADOWSHOCK = 34799, + SPELL_SILENCE = 34803, + SPELL_FEAR = 34803 +}; - struct boss_illuciabarovAI : public ScriptedAI - { - boss_illuciabarovAI(Creature* creature) : ScriptedAI(creature) {} +enum Events +{ + EVENT_CURSEOFAGONY = 1, + EVENT_SHADOWSHOCK = 2, + EVENT_SILENCE = 3, + EVENT_FEAR = 4 +}; - uint32 CurseOfAgony_Timer; - uint32 ShadowShock_Timer; - uint32 Silence_Timer; - uint32 Fear_Timer; +class boss_illucia_barov : public CreatureScript +{ + public: boss_illucia_barov() : CreatureScript("boss_illucia_barov") { } - void Reset() + struct boss_illuciabarovAI : public BossAI { - CurseOfAgony_Timer = 18000; - ShadowShock_Timer = 9000; - Silence_Timer = 5000; - Fear_Timer = 30000; - } + boss_illuciabarovAI(Creature* creature) : BossAI(creature,DATA_LADYILLUCIABAROV) {} - void JustDied(Unit* /*killer*/) - { - InstanceScript* instance = me->GetInstanceScript(); - if (instance) - { - instance->SetData(DATA_LADYILLUCIABAROV_DEATH, 0); + void Reset() {} - if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) - { - instance->SetData(TYPE_GANDLING, IN_PROGRESS); - me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); - } + void JustDied(Unit* /*killer*/) + { + if (instance) + instance->SetData(DATA_LADYILLUCIABAROV, DONE); } - } - - void EnterCombat(Unit* /*who*/) - { - } - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //CurseOfAgony_Timer - if (CurseOfAgony_Timer <= diff) + void EnterCombat(Unit* /*who*/) { - DoCast(me->getVictim(), SPELL_CURSEOFAGONY); - CurseOfAgony_Timer = 30000; - } else CurseOfAgony_Timer -= diff; + events.ScheduleEvent(EVENT_CURSEOFAGONY, 18000); + events.ScheduleEvent(EVENT_SHADOWSHOCK, 9000); + events.ScheduleEvent(EVENT_SILENCE, 5000); + events.ScheduleEvent(EVENT_FEAR, 30000); + } - //ShadowShock_Timer - if (ShadowShock_Timer <= diff) + void UpdateAI(uint32 const diff) { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) DoCast(target, SPELL_SHADOWSHOCK); + if (!UpdateVictim()) + return; - ShadowShock_Timer = 12000; - } else ShadowShock_Timer -= diff; + events.Update(diff); - //Silence_Timer - if (Silence_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SILENCE); - Silence_Timer = 14000; - } else Silence_Timer -= diff; + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - //Fear_Timer - if (Fear_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FEAR); - Fear_Timer = 30000; - } else Fear_Timer -= diff; + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_CURSEOFAGONY: + DoCastVictim(SPELL_CURSEOFAGONY, true); + events.ScheduleEvent(EVENT_CURSEOFAGONY, 30000); + break; + case EVENT_SHADOWSHOCK: + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_SHADOWSHOCK,true); + events.ScheduleEvent(EVENT_SHADOWSHOCK, 12000); + break; + case EVENT_SILENCE: + DoCastVictim(SPELL_SILENCE, true); + events.ScheduleEvent(EVENT_SILENCE, 14000); + break; + case EVENT_FEAR: + DoCastVictim(SPELL_FEAR, true); + events.ScheduleEvent(EVENT_FEAR, 30000); + break; + default: + break; + } + } - DoMeleeAttackIfReady(); - } - }; + DoMeleeAttackIfReady(); + } + }; + CreatureAI* GetAI(Creature* creature) const + { + return new boss_illuciabarovAI (creature); + } }; void AddSC_boss_illuciabarov() diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp index 1768584cb25..1f55666acc3 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp @@ -1,6 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -27,132 +26,123 @@ EndScriptData */ #include "ScriptedCreature.h" #include "scholomance.h" -#define SPELL_CALLOFGRAVES 17831 -#define SPELL_CORRUPTION 11672 -#define SPELL_FLASHHEAL 10917 -#define SPELL_RENEW 10929 -#define SPELL_HEALINGTOUCH 9889 +enum Spells +{ + SPELL_CALLOFGRAVES = 17831, + SPELL_CORRUPTION = 11672, + SPELL_FLASHHEAL = 10917, + SPELL_RENEW = 10929, + SPELL_HEALINGTOUCH = 9889 +}; + +enum Events +{ + EVENT_CALLOFGRAVES = 1, + EVENT_CORRUPTION = 2, + EVENT_FLASHHEAL = 3, + EVENT_RENEW = 4, + EVENT_HEALINGTOUCH = 5 +}; class boss_instructor_malicia : public CreatureScript { -public: - boss_instructor_malicia() : CreatureScript("boss_instructor_malicia") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_instructormaliciaAI (creature); - } - - struct boss_instructormaliciaAI : public ScriptedAI - { - boss_instructormaliciaAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 CallOfGraves_Timer; - uint32 Corruption_Timer; - uint32 FlashHeal_Timer; - uint32 Renew_Timer; - uint32 HealingTouch_Timer; - uint32 FlashCounter; - uint32 TouchCounter; - - void Reset() - { - CallOfGraves_Timer = 4000; - Corruption_Timer = 8000; - FlashHeal_Timer = 38000; - Renew_Timer = 32000; - HealingTouch_Timer = 45000; - FlashCounter = 0; - TouchCounter = 0; - } + public: boss_instructor_malicia() : CreatureScript("boss_instructor_malicia") { } - void JustDied(Unit* /*killer*/) + struct boss_instructormaliciaAI : public BossAI { - InstanceScript* instance = me->GetInstanceScript(); - if (instance) - { - instance->SetData(DATA_INSTRUCTORMALICIA_DEATH, 0); + boss_instructormaliciaAI(Creature* creature) : BossAI(creature, DATA_INSTRUCTORMALICIA) {} - if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) - { - instance->SetData(TYPE_GANDLING, IN_PROGRESS); - me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); - } - } - } + uint32 FlashCounter; + uint32 TouchCounter; - void EnterCombat(Unit* /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //CallOfGraves_Timer - if (CallOfGraves_Timer <= diff) + void Reset() { - DoCast(me->getVictim(), SPELL_CALLOFGRAVES); - CallOfGraves_Timer = 65000; - } else CallOfGraves_Timer -= diff; + FlashCounter = 0; + TouchCounter = 0; + } - //Corruption_Timer - if (Corruption_Timer <= diff) + void JustDied(Unit* /*killer*/) { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) DoCast(target, SPELL_CORRUPTION); - - Corruption_Timer = 24000; - } else Corruption_Timer -= diff; + if (instance) + instance->SetData(DATA_INSTRUCTORMALICIA, DONE); + } - //Renew_Timer - if (Renew_Timer <= diff) + void EnterCombat(Unit* /*who*/) { - DoCast(me, SPELL_RENEW); - Renew_Timer = 10000; - } else Renew_Timer -= diff; + events.ScheduleEvent(EVENT_CALLOFGRAVES, 4000); + events.ScheduleEvent(EVENT_CORRUPTION, 8000); + events.ScheduleEvent(EVENT_RENEW, 32000); + events.ScheduleEvent(EVENT_FLASHHEAL, 38000); + events.ScheduleEvent(EVENT_HEALINGTOUCH, 45000); + } - //FlashHeal_Timer - if (FlashHeal_Timer <= diff) + void UpdateAI(uint32 const diff) { - DoCast(me, SPELL_FLASHHEAL); + if (!UpdateVictim()) + return; - //5 Flashheals will be casted - if (FlashCounter < 2) - { - FlashHeal_Timer = 5000; - ++FlashCounter; - } - else - { - FlashCounter=0; - FlashHeal_Timer = 30000; - } - } else FlashHeal_Timer -= diff; + events.Update(diff); - //HealingTouch_Timer - if (HealingTouch_Timer <= diff) - { - DoCast(me, SPELL_HEALINGTOUCH); + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - //3 Healingtouchs will be casted - if (HealingTouch_Timer < 2) - { - HealingTouch_Timer = 5500; - ++TouchCounter; - } - else + while (uint32 eventId = events.ExecuteEvent()) { - TouchCounter=0; - HealingTouch_Timer = 30000; + switch (eventId) + { + case EVENT_CALLOFGRAVES: + DoCastVictim(SPELL_CALLOFGRAVES, true); + events.ScheduleEvent(EVENT_CALLOFGRAVES, 65000); + break; + case EVENT_CORRUPTION: + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_CORRUPTION,true); + events.ScheduleEvent(EVENT_CORRUPTION, 24000); + break; + case EVENT_RENEW: + DoCast(me, SPELL_RENEW); + events.ScheduleEvent(EVENT_RENEW, 10000); + break; + case EVENT_FLASHHEAL: + //5 Flashheals will be casted + DoCast(me, SPELL_FLASHHEAL); + if (FlashCounter < 2) + { + events.ScheduleEvent(EVENT_FLASHHEAL, 5000); + ++FlashCounter; + } + else + { + FlashCounter=0; + events.ScheduleEvent(EVENT_FLASHHEAL, 30000); + } + break; + case EVENT_HEALINGTOUCH: + //3 Healing Touch will be casted + DoCast(me, SPELL_HEALINGTOUCH); + if (TouchCounter < 2) + { + events.ScheduleEvent(EVENT_HEALINGTOUCH, 5500); + ++TouchCounter; + } + else + { + TouchCounter=0; + events.ScheduleEvent(EVENT_HEALINGTOUCH, 30000); + } + break; + default: + break; + } } - } else HealingTouch_Timer -= diff; - DoMeleeAttackIfReady(); + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_instructormaliciaAI (creature); } - }; }; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp index 3eb78662578..c9cf4aa9020 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp new file mode 100644 index 00000000000..9d8f448964c --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp @@ -0,0 +1,302 @@ +/* + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "scholomance.h" +#include "MoveSplineInit.h" +#include "GameObjectAI.h" +#include "Player.h" + +enum Says +{ + EMOTE_SUMMONED = 0 +}; + +enum Spells +{ + SPELL_SWOOP = 18144, + SPELL_WING_FLAP = 12882, + SPELL_PIERCE_ARMOR = 6016, + SPELL_DISARM = 8379, + SPELL_KIRTONOS_TRANSFORM = 16467, + SPELL_SHADOW_BOLT = 17228, + SPELL_CURSE_OF_TONGUES = 12889, + SPELL_DOMINATE_MIND = 14515 +}; + +enum Events +{ + INTRO_1 = 1, + INTRO_2 = 2, + INTRO_3 = 3, + INTRO_4 = 4, + INTRO_5 = 5, + INTRO_6 = 6, + EVENT_SWOOP = 7, + EVENT_WING_FLAP = 8, + EVENT_PIERCE_ARMOR = 9, + EVENT_DISARM = 10, + EVENT_SHADOW_BOLT = 11, + EVENT_CURSE_OF_TONGUES = 12, + EVENT_DOMINATE_MIND = 13, + EVENT_KIRTONOS_TRANSFORM = 14 +}; + +enum eMisc +{ + WEAPON_KIRTONOS_STAFF = 11365, + POINT_KIRTONOS_LAND = 13, + KIRTONOS_PATH = 105061 +}; + +class boss_kirtonos_the_herald : public CreatureScript +{ + public: boss_kirtonos_the_herald() : CreatureScript("boss_kirtonos_the_herald") { } + + struct boss_kirtonos_the_heraldAI : public BossAI + { + boss_kirtonos_the_heraldAI(Creature* creature) : BossAI(creature, DATA_KIRTONOS) { } + + void Reset() + { + _introEvent = 0; + _introTimer = 0; + _Reset(); + } + + void EnterCombat(Unit* /*who*/) + { + _introTimer = 0; + _introEvent = 0; + events.ScheduleEvent(EVENT_SWOOP, urand(8000, 8000)); + events.ScheduleEvent(EVENT_WING_FLAP, urand(15000, 15000)); + events.ScheduleEvent(EVENT_PIERCE_ARMOR, urand(18000, 18000)); + events.ScheduleEvent(EVENT_DISARM, urand(22000, 22000)); + events.ScheduleEvent(EVENT_SHADOW_BOLT, urand(42000, 42000)); + events.ScheduleEvent(EVENT_CURSE_OF_TONGUES, urand(53000, 53000)); + events.ScheduleEvent(EVENT_DOMINATE_MIND, urand(34000, 48000)); + events.ScheduleEvent(EVENT_KIRTONOS_TRANSFORM, urand(20000, 20000)); + _EnterCombat(); + } + + void JustDied(Unit* /*killer*/) + { + if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_KIRTONOS))) + gate->SetGoState(GO_STATE_ACTIVE); + if (GameObject* brazier = me->GetMap()->GetGameObject(instance->GetData64(GO_BRAZIER_OF_THE_HERALD))) + { + brazier->ResetDoorOrButton(); + brazier->SetGoState(GO_STATE_READY); + } + if (instance) + instance->SetData(DATA_KIRTONOS, DONE); + } + + void EnterEvadeMode() + { + if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_KIRTONOS))) + gate->SetGoState(GO_STATE_ACTIVE); + if (GameObject* brazier = me->GetMap()->GetGameObject(instance->GetData64(GO_BRAZIER_OF_THE_HERALD))) + { + brazier->ResetDoorOrButton(); + brazier->SetGoState(GO_STATE_READY); + } + me->DespawnOrUnsummon(5000); + } + + void IsSummonedBy(Unit* /*summoner*/) + { + me->SetDisableGravity(true); + me->SetReactState(REACT_PASSIVE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); + _introEvent = INTRO_1; + _introTimer = 1; + _currentPoint = 0; + Talk(EMOTE_SUMMONED); + } + + void JustSummoned(Creature* summon) + { + BossAI::JustSummoned(summon); + } + + void MovementInform(uint32 type, uint32 id) + { + if (type == WAYPOINT_MOTION_TYPE && id == POINT_KIRTONOS_LAND) + { + _introTimer = 1500; + _introEvent = INTRO_2; + } + } + + void UpdateAI(uint32 const diff) + { + if (_introEvent) + { + if (_introTimer <= diff) + { + switch (_introEvent) + { + case INTRO_1: + me->GetMotionMaster()->MovePath(KIRTONOS_PATH,false); + _introEvent = 0; + break; + case INTRO_2: + me->GetMotionMaster()->MovePoint(0, 299.4884f, 92.76137f, 105.6335f); + _introTimer = 1000; + _introEvent = INTRO_3; + break; + case INTRO_3: + if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_KIRTONOS))) + gate->SetGoState(GO_STATE_READY); + me->SetFacingTo(0.01745329f); + _introTimer = 3000; + _introEvent = INTRO_4; + break; + case INTRO_4: + if (GameObject* brazier = me->GetMap()->GetGameObject(instance->GetData64(GO_BRAZIER_OF_THE_HERALD))) + brazier->SetGoState(GO_STATE_READY); + me->SetWalk(true); + me->SetDisableGravity(false); + DoCast(me, SPELL_KIRTONOS_TRANSFORM); + me->SetCanFly(false); + _introTimer = 1000; + _introEvent = INTRO_5; + break; + case INTRO_5: + me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_KIRTONOS_STAFF)); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); + me->SetReactState(REACT_AGGRESSIVE); + _introTimer = 5000; + _introEvent = INTRO_6; + case INTRO_6: + me->GetMotionMaster()->MovePoint(0, 314.8673f, 90.3021f, 101.6459f); + _introTimer = 0; + _introEvent = 0; + break; + } + } + else + _introTimer -= diff; + } + + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_SWOOP: + DoCast(me, SPELL_SWOOP); + events.ScheduleEvent(EVENT_SWOOP, 15000); + break; + case EVENT_WING_FLAP: + DoCast(me, SPELL_WING_FLAP); + events.ScheduleEvent(EVENT_WING_FLAP, 13000); + break; + case EVENT_PIERCE_ARMOR: + DoCastVictim(SPELL_PIERCE_ARMOR, true); + events.ScheduleEvent(EVENT_PIERCE_ARMOR, 12000); + break; + case EVENT_DISARM: + DoCastVictim(SPELL_DISARM, true); + events.ScheduleEvent(EVENT_DISARM, 11000); + break; + case EVENT_SHADOW_BOLT: + DoCastVictim(SPELL_SHADOW_BOLT, true); + events.ScheduleEvent(EVENT_SHADOW_BOLT, 42000); + break; + case EVENT_CURSE_OF_TONGUES: + DoCastVictim(SPELL_CURSE_OF_TONGUES, true); + events.ScheduleEvent(EVENT_CURSE_OF_TONGUES, 35000); + break; + case EVENT_DOMINATE_MIND: + DoCastVictim(SPELL_DOMINATE_MIND, true); + events.ScheduleEvent(EVENT_DOMINATE_MIND, urand(44000, 48000)); + break; + case EVENT_KIRTONOS_TRANSFORM: + if (me->HasAura(SPELL_KIRTONOS_TRANSFORM)) + { + me->RemoveAura(SPELL_KIRTONOS_TRANSFORM); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(0)); + me->SetCanFly(false); + } + else + { + DoCast(me, SPELL_KIRTONOS_TRANSFORM); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_KIRTONOS_STAFF)); + me->SetCanFly(true); + } + events.ScheduleEvent(EVENT_KIRTONOS_TRANSFORM, urand(16000, 18000)); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + uint8 _introEvent; + uint32 _introTimer; + uint32 _currentPoint; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_kirtonos_the_heraldAI(creature); + } +}; + +/*###### +## go_brazier_of_the_herald +######*/ + +enum Brazier_Of_The_Herald +{ + NPC_KIRTONOS = 10506, + SOUND_SCREECH = 557 +}; + +class go_brazier_of_the_herald : public GameObjectScript +{ + public: + go_brazier_of_the_herald() : GameObjectScript("go_brazier_of_the_herald") { } + + bool OnGossipHello(Player* player, GameObject* go) + { + go->UseDoorOrButton(); + go->PlayDirectSound(SOUND_SCREECH, 0); + player->SummonCreature(NPC_KIRTONOS, 315.028f, 70.53845f, 102.1496f, 0.3859715f, TEMPSUMMON_DEAD_DESPAWN, 900000); + return true; + } +}; + +void AddSC_boss_kirtonos_the_herald() +{ + new boss_kirtonos_the_herald(); + new go_brazier_of_the_herald; +} diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp index 10736464ef3..a0dc31c4dff 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp index 3035688343c..c246e781bd8 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp @@ -1,6 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -27,79 +26,78 @@ EndScriptData */ #include "ScriptedCreature.h" #include "scholomance.h" -#define SPELL_IMMOLATE 20294 // Old ID was 15570 -#define SPELL_VEILOFSHADOW 17820 - -class boss_lord_alexei_barov : public CreatureScript +enum Spells { -public: - boss_lord_alexei_barov() : CreatureScript("boss_lord_alexei_barov") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_lordalexeibarovAI (creature); - } + SPELL_IMMOLATE = 20294, // Old ID was 15570 + SPELL_VEILOFSHADOW = 17820 +}; - struct boss_lordalexeibarovAI : public ScriptedAI - { - boss_lordalexeibarovAI(Creature* creature) : ScriptedAI(creature) {} +enum Events +{ + EVENT_IMMOLATE = 1, + EVENT_VEILOFSHADOW = 2 +}; - uint32 Immolate_Timer; - uint32 VeilofShadow_Timer; +class boss_lord_alexei_barov : public CreatureScript +{ + public: boss_lord_alexei_barov() : CreatureScript("boss_lord_alexei_barov") { } - void Reset() + struct boss_lordalexeibarovAI : public BossAI { - Immolate_Timer = 7000; - VeilofShadow_Timer = 15000; + boss_lordalexeibarovAI(Creature* creature) : BossAI(creature, DATA_LORDALEXEIBAROV) {} - me->LoadCreaturesAddon(); - } + void Reset() + { + me->LoadCreaturesAddon(); + } - void JustDied(Unit* /*killer*/) - { - InstanceScript* instance = me->GetInstanceScript(); - if (instance) + void JustDied(Unit* /*killer*/) { - instance->SetData(DATA_LORDALEXEIBAROV_DEATH, 0); + if (instance) + instance->SetData(DATA_LORDALEXEIBAROV, DONE); + } - if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) - { - instance->SetData(TYPE_GANDLING, IN_PROGRESS); - me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); - } + void EnterCombat(Unit* /*who*/) + { + events.ScheduleEvent(EVENT_IMMOLATE, 7000); + events.ScheduleEvent(EVENT_VEILOFSHADOW, 15000); } - } - void EnterCombat(Unit* /*who*/) - { - } + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; + events.Update(diff); - //Immolate_Timer - if (Immolate_Timer <= diff) - { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) DoCast(target, SPELL_IMMOLATE); + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - Immolate_Timer = 12000; - } else Immolate_Timer -= diff; + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_IMMOLATE: + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_IMMOLATE,true); + events.ScheduleEvent(EVENT_IMMOLATE, 12000); + break; + case EVENT_VEILOFSHADOW: + DoCastVictim(SPELL_VEILOFSHADOW, true); + events.ScheduleEvent(EVENT_VEILOFSHADOW, 20000); + break; + default: + break; + } + } - //VeilofShadow_Timer - if (VeilofShadow_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_VEILOFSHADOW); - VeilofShadow_Timer = 20000; - } else VeilofShadow_Timer -= diff; + DoMeleeAttackIfReady(); + } + }; - DoMeleeAttackIfReady(); + CreatureAI* GetAI(Creature* creature) const + { + return new boss_lordalexeibarovAI (creature); } - }; - }; void AddSC_boss_lordalexeibarov() diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp index dfab9dd37df..2239194a5e3 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp @@ -1,6 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,105 +15,100 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Lorekeeper_Polkelt -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ +/* +Name: Boss_Lorekeeper_Polkelt +%Complete: 100 +Comment: +Category: Scholomance +*/ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "scholomance.h" -#define SPELL_VOLATILEINFECTION 24928 -#define SPELL_DARKPLAGUE 18270 -#define SPELL_CORROSIVEACID 23313 -#define SPELL_NOXIOUSCATALYST 18151 - -class boss_lorekeeper_polkelt : public CreatureScript +enum Spells { -public: - boss_lorekeeper_polkelt() : CreatureScript("boss_lorekeeper_polkelt") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_lorekeeperpolkeltAI (creature); - } + SPELL_VOLATILEINFECTION = 24928, + SPELL_DARKPLAGUE = 18270, + SPELL_CORROSIVEACID = 23313, + SPELL_NOXIOUSCATALYST = 18151 +}; - struct boss_lorekeeperpolkeltAI : public ScriptedAI - { - boss_lorekeeperpolkeltAI(Creature* creature) : ScriptedAI(creature) {} +enum Events +{ + EVENT_VOLATILEINFECTION = 1, + EVENT_DARKPLAGUE = 2, + EVENT_CORROSIVEACID = 3, + EVENT_NOXIOUSCATALYST = 4 +}; - uint32 VolatileInfection_Timer; - uint32 Darkplague_Timer; - uint32 CorrosiveAcid_Timer; - uint32 NoxiousCatalyst_Timer; +class boss_lorekeeper_polkelt : public CreatureScript +{ + public: boss_lorekeeper_polkelt() : CreatureScript("boss_lorekeeper_polkelt") { } - void Reset() + struct boss_lorekeeperpolkeltAI : public BossAI { - VolatileInfection_Timer = 38000; - Darkplague_Timer = 8000; - CorrosiveAcid_Timer = 45000; - NoxiousCatalyst_Timer = 35000; - } + boss_lorekeeperpolkeltAI(Creature* creature) : BossAI(creature, DATA_LOREKEEPERPOLKELT) {} - void JustDied(Unit* /*killer*/) - { - InstanceScript* instance = me->GetInstanceScript(); - if (instance) - { - instance->SetData(DATA_LOREKEEPERPOLKELT_DEATH, 0); + void Reset() {} - if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) - { - instance->SetData(TYPE_GANDLING, IN_PROGRESS); - me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); - } + void JustDied(Unit* /*killer*/) + { + if (instance) + instance->SetData(DATA_LOREKEEPERPOLKELT, DONE); } - } - void EnterCombat(Unit* /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //VolatileInfection_Timer - if (VolatileInfection_Timer <= diff) + void EnterCombat(Unit* /*who*/) { - DoCast(me->getVictim(), SPELL_VOLATILEINFECTION); - VolatileInfection_Timer = 32000; - } else VolatileInfection_Timer -= diff; + events.ScheduleEvent(EVENT_VOLATILEINFECTION, 38000); + events.ScheduleEvent(EVENT_DARKPLAGUE, 8000); + events.ScheduleEvent(EVENT_CORROSIVEACID, 45000); + events.ScheduleEvent(EVENT_NOXIOUSCATALYST, 35000); + } - //Darkplague_Timer - if (Darkplague_Timer <= diff) + void UpdateAI(uint32 const diff) { - DoCast(me->getVictim(), SPELL_DARKPLAGUE); - Darkplague_Timer = 8000; - } else Darkplague_Timer -= diff; + if (!UpdateVictim()) + return; - //CorrosiveAcid_Timer - if (CorrosiveAcid_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CORROSIVEACID); - CorrosiveAcid_Timer = 25000; - } else CorrosiveAcid_Timer -= diff; + events.Update(diff); - //NoxiousCatalyst_Timer - if (NoxiousCatalyst_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_NOXIOUSCATALYST); - NoxiousCatalyst_Timer = 38000; - } else NoxiousCatalyst_Timer -= diff; + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - DoMeleeAttackIfReady(); - } - }; + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_VOLATILEINFECTION: + DoCastVictim(SPELL_VOLATILEINFECTION, true); + events.ScheduleEvent(EVENT_VOLATILEINFECTION, 32000); + break; + case EVENT_DARKPLAGUE: + DoCastVictim(SPELL_DARKPLAGUE, true); + events.ScheduleEvent(EVENT_DARKPLAGUE, 8000); + break; + case EVENT_CORROSIVEACID: + DoCastVictim(SPELL_CORROSIVEACID, true); + events.ScheduleEvent(EVENT_CORROSIVEACID, 25000); + break; + case EVENT_NOXIOUSCATALYST: + DoCastVictim(SPELL_NOXIOUSCATALYST, true); + events.ScheduleEvent(EVENT_NOXIOUSCATALYST, 38000); + break; + default: + break; + } + } + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_lorekeeperpolkeltAI (creature); + } }; void AddSC_boss_lorekeeperpolkelt() diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp index 808dc97dc86..99f01ee96c3 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -26,12 +26,15 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" -#define SPELL_FROSTBOLT 21369 -#define SPELL_ICEARMOR 18100 //This is actually a buff he gives himself -#define SPELL_FREEZE 18763 -#define SPELL_FEAR 26070 -#define SPELL_CHILLNOVA 18099 -#define SPELL_FROSTVOLLEY 8398 +enum Spells +{ + SPELL_FROSTBOLT = 21369, + SPELL_ICEARMOR = 18100, // This is actually a buff he gives himself + SPELL_FREEZE = 18763, + SPELL_FEAR = 26070, + SPELL_CHILLNOVA = 18099, + SPELL_FROSTVOLLEY = 8398 +}; class boss_boss_ras_frostwhisper : public CreatureScript { diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp index b3d42d4676a..e2e04ae7b81 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp @@ -1,6 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,107 +15,101 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_the_ravenian -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ +/* +Name: Boss_the_ravenian +%Complete: 100 +Comment: +Category: Scholomance +*/ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "scholomance.h" -#define SPELL_TRAMPLE 15550 -#define SPELL_CLEAVE 20691 -#define SPELL_SUNDERINCLEAVE 25174 -#define SPELL_KNOCKAWAY 10101 - -class boss_the_ravenian : public CreatureScript +enum Spells { -public: - boss_the_ravenian() : CreatureScript("boss_the_ravenian") { } + SPELL_TRAMPLE = 15550, + SPELL_CLEAVE = 20691, + SPELL_SUNDERINCLEAVE = 25174, + SPELL_KNOCKAWAY = 10101 +}; - CreatureAI* GetAI(Creature* creature) const - { - return new boss_theravenianAI (creature); - } +enum Events +{ + EVENT_TRAMPLE = 1, + EVENT_CLEAVE = 2, + EVENT_SUNDERINCLEAVE = 3, + EVENT_KNOCKAWAY = 4 +}; - struct boss_theravenianAI : public ScriptedAI - { - boss_theravenianAI(Creature* creature) : ScriptedAI(creature) {} - uint32 Trample_Timer; - uint32 Cleave_Timer; - uint32 SunderingCleave_Timer; - uint32 KnockAway_Timer; - bool HasYelled; +class boss_the_ravenian : public CreatureScript +{ + public: boss_the_ravenian() : CreatureScript("boss_the_ravenian") { } - void Reset() + struct boss_theravenianAI : public BossAI { - Trample_Timer = 24000; - Cleave_Timer = 15000; - SunderingCleave_Timer = 40000; - KnockAway_Timer = 32000; - HasYelled = false; - } + boss_theravenianAI(Creature* creature) : BossAI(creature, DATA_THERAVENIAN) {} - void JustDied(Unit* /*killer*/) - { - InstanceScript* instance = me->GetInstanceScript(); - if (instance) - { - instance->SetData(DATA_THERAVENIAN_DEATH, 0); + void Reset() {} - if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) - { - instance->SetData(TYPE_GANDLING, IN_PROGRESS); - me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); - } + void JustDied(Unit* /*killer*/) + { + if (instance) + instance->SetData(DATA_THERAVENIAN, DONE); } - } - void EnterCombat(Unit* /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Trample_Timer - if (Trample_Timer <= diff) + void EnterCombat(Unit* /*who*/) { - DoCast(me->getVictim(), SPELL_TRAMPLE); - Trample_Timer = 10000; - } else Trample_Timer -= diff; + events.ScheduleEvent(EVENT_TRAMPLE, 24000); + events.ScheduleEvent(EVENT_CLEAVE, 15000); + events.ScheduleEvent(EVENT_SUNDERINCLEAVE, 40000); + events.ScheduleEvent(EVENT_KNOCKAWAY, 32000); + } - //Cleave_Timer - if (Cleave_Timer <= diff) + void UpdateAI(uint32 const diff) { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 7000; - } else Cleave_Timer -= diff; + if (!UpdateVictim()) + return; - //SunderingCleave_Timer - if (SunderingCleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SUNDERINCLEAVE); - SunderingCleave_Timer = 20000; - } else SunderingCleave_Timer -= diff; + events.Update(diff); - //KnockAway_Timer - if (KnockAway_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KNOCKAWAY); - KnockAway_Timer = 12000; - } else KnockAway_Timer -= diff; + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - DoMeleeAttackIfReady(); - } - }; + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_TRAMPLE: + DoCastVictim(SPELL_TRAMPLE, true); + events.ScheduleEvent(EVENT_TRAMPLE, 10000); + break; + case EVENT_CLEAVE: + DoCastVictim(SPELL_CLEAVE, true); + events.ScheduleEvent(EVENT_CLEAVE, 7000); + break; + case EVENT_SUNDERINCLEAVE: + DoCastVictim(SPELL_SUNDERINCLEAVE, true); + events.ScheduleEvent(EVENT_SUNDERINCLEAVE, 20000); + break; + case EVENT_KNOCKAWAY: + DoCastVictim(SPELL_KNOCKAWAY, true); + events.ScheduleEvent(EVENT_KNOCKAWAY, 12000); + break; + default: + break; + } + } + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_theravenianAI (creature); + } }; void AddSC_boss_theravenian() diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp index dd3e591bf61..054760981d2 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp index f8a0c0010d2..d97372d4379 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp @@ -1,6 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -17,26 +16,23 @@ */ /* ScriptData -SDName: Instance_Scholomance -SD%Complete: 100 -SDComment: -SDCategory: Scholomance +Name: Instance_Scholomance +%Complete: 100 +Comment: +Category: Scholomance EndScriptData */ #include "ScriptMgr.h" #include "InstanceScript.h" #include "scholomance.h" +#include "Player.h" -#define GO_GATE_KIRTONOS 175570 -#define GO_GATE_GANDLING 177374 -#define GO_GATE_MALICIA 177375 -#define GO_GATE_THEOLEN 177377 -#define GO_GATE_POLKELT 177376 -#define GO_GATE_RAVENIAN 177372 -#define GO_GATE_BAROV 177373 -#define GO_GATE_ILLUCIA 177371 +enum CreatureId +{ + NPC_DARKMASTER_GANDLING = 1853 +}; -#define MAX_ENCOUNTER 2 +Position const GandlingLoc = {180.7712f, -5.428603f, 75.57024f, 1.291544f}; class instance_scholomance : public InstanceMapScript { @@ -53,9 +49,7 @@ public: instance_scholomance_InstanceMapScript(Map* map) : InstanceScript(map) {} //Lord Alexei Barov, Doctor Theolen Krastinov, The Ravenian, Lorekeeper Polkelt, Instructor Malicia and the Lady Illucia Barov. - bool IsBossDied[6]; uint32 m_auiEncounter[MAX_ENCOUNTER]; - uint64 GateKirtonosGUID; uint64 GateGandlingGUID; uint64 GateMiliciaGUID; @@ -64,11 +58,10 @@ public: uint64 GateRavenianGUID; uint64 GateBarovGUID; uint64 GateIlluciaGUID; + uint64 BrazierOfTheHeraldGUID; void Initialize() { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - GateKirtonosGUID = 0; GateGandlingGUID = 0; GateMiliciaGUID = 0; @@ -77,23 +70,25 @@ public: GateRavenianGUID = 0; GateBarovGUID = 0; GateIlluciaGUID = 0; + BrazierOfTheHeraldGUID = 0; - for (uint8 i = 0; i < 6; ++i) - IsBossDied[i] = false; + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + m_auiEncounter[i] = NOT_STARTED; } void OnGameObjectCreate(GameObject* go) { switch (go->GetEntry()) { - case GO_GATE_KIRTONOS: GateKirtonosGUID = go->GetGUID(); break; - case GO_GATE_GANDLING: GateGandlingGUID = go->GetGUID(); break; - case GO_GATE_MALICIA: GateMiliciaGUID = go->GetGUID(); break; - case GO_GATE_THEOLEN: GateTheolenGUID = go->GetGUID(); break; - case GO_GATE_POLKELT: GatePolkeltGUID = go->GetGUID(); break; - case GO_GATE_RAVENIAN: GateRavenianGUID = go->GetGUID(); break; - case GO_GATE_BAROV: GateBarovGUID = go->GetGUID(); break; - case GO_GATE_ILLUCIA: GateIlluciaGUID = go->GetGUID(); break; + case GO_GATE_KIRTONOS: GateKirtonosGUID = go->GetGUID(); break; + case GO_GATE_GANDLING: GateGandlingGUID = go->GetGUID(); break; + case GO_GATE_MALICIA: GateMiliciaGUID = go->GetGUID(); break; + case GO_GATE_THEOLEN: GateTheolenGUID = go->GetGUID(); break; + case GO_GATE_POLKELT: GatePolkeltGUID = go->GetGUID(); break; + case GO_GATE_RAVENIAN: GateRavenianGUID = go->GetGUID(); break; + case GO_GATE_BAROV: GateBarovGUID = go->GetGUID(); break; + case GO_GATE_ILLUCIA: GateIlluciaGUID = go->GetGUID(); break; + case GO_BRAZIER_OF_THE_HERALD: BrazierOfTheHeraldGUID = go->GetGUID(); break; } } @@ -101,40 +96,78 @@ public: { switch (type) { - case DATA_LORDALEXEIBAROV_DEATH: - IsBossDied[0] = true; + case DATA_LORDALEXEIBAROV: + m_auiEncounter[DATA_LORDALEXEIBAROV] = data; + CheckToSpawnGandling(); break; - case DATA_DOCTORTHEOLENKRASTINOV_DEATH: - IsBossDied[1] = true; + case DATA_DOCTORTHEOLENKRASTINOV: + m_auiEncounter[DATA_DOCTORTHEOLENKRASTINOV] = data; + CheckToSpawnGandling(); break; - case DATA_THERAVENIAN_DEATH: - IsBossDied[2] = true; + case DATA_THERAVENIAN: + m_auiEncounter[DATA_THERAVENIAN] = data; + CheckToSpawnGandling(); break; - case DATA_LOREKEEPERPOLKELT_DEATH: - IsBossDied[3] = true; + case DATA_LOREKEEPERPOLKELT: + m_auiEncounter[DATA_LOREKEEPERPOLKELT] = data; + CheckToSpawnGandling(); break; - case DATA_INSTRUCTORMALICIA_DEATH: - IsBossDied[4] = true; + case DATA_INSTRUCTORMALICIA: + m_auiEncounter[DATA_INSTRUCTORMALICIA] = data; + CheckToSpawnGandling(); break; - case DATA_LADYILLUCIABAROV_DEATH: - IsBossDied[5] = true; + case DATA_LADYILLUCIABAROV: + m_auiEncounter[DATA_LADYILLUCIABAROV] = data; + CheckToSpawnGandling(); break; - case TYPE_GANDLING: - m_auiEncounter[0] = data; + case DATA_DARKMASTERGANDLING: + m_auiEncounter[DATA_DARKMASTERGANDLING] = data; break; - case TYPE_KIRTONOS: - m_auiEncounter[1] = data; + case DATA_KIRTONOS: + m_auiEncounter[DATA_KIRTONOS] = data; break; } } uint32 GetData(uint32 type) const { - return (type == TYPE_GANDLING && - IsBossDied[0] && IsBossDied[1] && IsBossDied[2] && - IsBossDied[3] && IsBossDied[4] && IsBossDied[5]) + return type == (m_auiEncounter[DATA_LORDALEXEIBAROV] == DONE) && (m_auiEncounter[DATA_DOCTORTHEOLENKRASTINOV] == DONE) && + (m_auiEncounter[DATA_THERAVENIAN] == DONE) && (m_auiEncounter[DATA_LOREKEEPERPOLKELT] == DONE) && + (m_auiEncounter[DATA_INSTRUCTORMALICIA] == DONE) && (m_auiEncounter[DATA_LADYILLUCIABAROV] == DONE) ? IN_PROGRESS : 0; } + + uint64 GetData64(uint32 type) const + { + switch (type) + { + case GO_GATE_KIRTONOS: return GateKirtonosGUID; break; + case GO_GATE_GANDLING: return GateGandlingGUID; break; + case GO_GATE_MALICIA: return GateMiliciaGUID; break; + case GO_GATE_THEOLEN: return GateTheolenGUID; break; + case GO_GATE_POLKELT: return GatePolkeltGUID; break; + case GO_GATE_RAVENIAN: return GateRavenianGUID; break; + case GO_GATE_BAROV: return GateBarovGUID; break; + case GO_GATE_ILLUCIA: return GateIlluciaGUID; break; + case GO_BRAZIER_OF_THE_HERALD: return BrazierOfTheHeraldGUID; break; + } + + return 0; + } + + void CheckToSpawnGandling() + { + if (GetData(DATA_DARKMASTERGANDLING) == IN_PROGRESS) + { + Map::PlayerList const &PlayerList = instance->GetPlayers(); + if (PlayerList.isEmpty()) + return; + + Map::PlayerList::const_iterator i = PlayerList.begin(); + if (Player* i_pl = i->getSource()) + i_pl->SummonCreature(NPC_DARKMASTER_GANDLING, GandlingLoc); + } + } }; }; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h b/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h index 6e8ed21e4bb..2d9c8c7bbe7 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h +++ b/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h @@ -1,6 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -19,13 +18,34 @@ #ifndef DEF_SCHOLOMANCE_H #define DEF_SCHOLOMANCE_H -#define TYPE_GANDLING 1 -#define DATA_DOCTORTHEOLENKRASTINOV_DEATH 2 -#define DATA_INSTRUCTORMALICIA_DEATH 3 -#define DATA_LADYILLUCIABAROV_DEATH 4 -#define DATA_LORDALEXEIBAROV_DEATH 5 -#define DATA_LOREKEEPERPOLKELT_DEATH 6 -#define DATA_THERAVENIAN_DEATH 7 -#define TYPE_KIRTONOS 8 -#endif +enum DataTypes +{ + DATA_DOCTORTHEOLENKRASTINOV = 0, + DATA_INSTRUCTORMALICIA = 1, + DATA_LADYILLUCIABAROV = 2, + DATA_LORDALEXEIBAROV = 3, + DATA_LOREKEEPERPOLKELT = 4, + DATA_THERAVENIAN = 5, + DATA_DARKMASTERGANDLING = 6, + DATA_KIRTONOS = 7 +}; + +enum GameobjectIds +{ + GO_GATE_KIRTONOS = 175570, + GO_GATE_GANDLING = 177374, + GO_GATE_RAVENIAN = 177372, + GO_GATE_THEOLEN = 177377, + GO_GATE_ILLUCIA = 177371, + GO_GATE_MALICIA = 177375, + GO_GATE_BAROV = 177373, + GO_GATE_POLKELT = 177376, + GO_BRAZIER_OF_THE_HERALD = 175564 +}; +enum Misc +{ + MAX_ENCOUNTER = 8 +}; + +#endif diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp index 1ec0eda171c..1490005791e 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -33,7 +33,7 @@ EndScriptData */ enum eEnums { - SAY_BOSS_DIE_AD = 0, + SAY_BOSS_DIE_AD = 4, SAY_BOSS_DIE_AS = 3, SAY_ARCHMAGE = 0, diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp index c98148e645b..f9bd7d89216 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h index 0c41239c9b4..cee4e5ffc1e 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp index cd3fbd09223..2357f59b65d 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -27,56 +27,39 @@ EndScriptData */ #include "ScriptedCreature.h" #include "stratholme.h" -#define SAY_0 "Intruders! More pawns of the Argent Dawn, no doubt. I already count one of their number among my prisoners. Withdraw from my domain before she is executed!" -#define SAY_1 "You're still here? Your foolishness is amusing! The Argent Dawn wench needn't suffer in vain. Leave at once and she shall be spared!" -#define SAY_2 "I shall take great pleasure in taking this poor wretch's life! It's not too late, she needn't suffer in vain. Turn back and her death shall be merciful!" -#define SAY_3 "May this prisoner's death serve as a warning. None shall defy the Scourge and live!" -#define SAY_4 "So you see fit to toy with the Lich King's creations? Ramstein, be sure to give the intruders a proper greeting." -#define SAY_5 "Time to take matters into my own hands. Come. Enter my domain and challenge the might of the Scourge!" - -#define ADD_1X 4017.403809f -#define ADD_1Y -3339.703369f -#define ADD_1Z 115.057655f -#define ADD_1O 5.487860f - -#define ADD_2X 4013.189209f -#define ADD_2Y -3351.808350f -#define ADD_2Z 115.052254f -#define ADD_2O 0.134280f - -#define ADD_3X 4017.738037f -#define ADD_3Y -3363.478016f -#define ADD_3Z 115.057274f -#define ADD_3O 0.723313f - -#define ADD_4X 4048.877197f -#define ADD_4Y -3363.223633f -#define ADD_4Z 115.054253f -#define ADD_4O 3.627735f - -#define ADD_5X 4051.777588f -#define ADD_5Y -3350.893311f -#define ADD_5Z 115.055351f -#define ADD_5O 3.066176f - -#define ADD_6X 4048.375977f -#define ADD_6Y -3339.966309f -#define ADD_6Z 115.055222f -#define ADD_6O 2.457497f - -#define SPELL_SHADOWBOLT 17393 -#define SPELL_CLEAVE 15284 -#define SPELL_MORTALSTRIKE 15708 - -#define SPELL_UNHOLY_AURA 17467 -#define SPELL_RAISEDEAD 17473 //triggers death pact (17471) - -#define SPELL_RAISE_DEAD1 17475 -#define SPELL_RAISE_DEAD2 17476 -#define SPELL_RAISE_DEAD3 17477 -#define SPELL_RAISE_DEAD4 17478 -#define SPELL_RAISE_DEAD5 17479 -#define SPELL_RAISE_DEAD6 17480 +enum Says +{ + SAY_BARON_RUN_START = 0, + SAY_BARON_RUN_BOSS_KILL = 1, + SAY_BARON_RUN_FAIL = 2, + SAY_EVENT_RAMSTEIN = 3, + SAY_EVENT_BARON = 4 +}; + +enum Spells +{ + SPELL_SHADOWBOLT = 17393, + SPELL_CLEAVE = 15284, + SPELL_MORTALSTRIKE = 15708, + + SPELL_UNHOLY_AURA = 15284, + SPELL_RAISEDEAD = 15708, //triggers death pact (17471) + + SPELL_RAISE_DEAD1 = 17475, + SPELL_RAISE_DEAD2 = 17476, + SPELL_RAISE_DEAD3 = 17477, + SPELL_RAISE_DEAD4 = 17478, + SPELL_RAISE_DEAD5 = 17479, + SPELL_RAISE_DEAD6 = 17480, +}; + +// Define Add positions +Position const ADD_POS_1 = {4017.403809f, -3339.703369f, 115.057655f, 5.487860f}; +Position const ADD_POS_2 = {4013.189209f, -3351.808350f, 115.052254f, 0.134280f}; +Position const ADD_POS_3 = {4017.738037f, -3363.478016f, 115.057274f, 0.723313f}; +Position const ADD_POS_4 = {4048.877197f, -3363.223633f, 115.054253f, 3.627735f}; +Position const ADD_POS_5 = {4051.777588f, -3350.893311f, 115.055351f, 3.066176f}; +Position const ADD_POS_6 = {4048.375977f, -3339.966309f, 115.055222f, 2.457497f}; class boss_baron_rivendare : public CreatureScript { @@ -172,12 +155,12 @@ public: //SummonSkeletons if (SummonSkeletons_Timer <= diff) { - me->SummonCreature(11197, ADD_1X, ADD_1Y, ADD_1Z, ADD_1O, TEMPSUMMON_TIMED_DESPAWN, 29000); - me->SummonCreature(11197, ADD_2X, ADD_2Y, ADD_2Z, ADD_2O, TEMPSUMMON_TIMED_DESPAWN, 29000); - me->SummonCreature(11197, ADD_3X, ADD_3Y, ADD_3Z, ADD_3O, TEMPSUMMON_TIMED_DESPAWN, 29000); - me->SummonCreature(11197, ADD_4X, ADD_4Y, ADD_4Z, ADD_4O, TEMPSUMMON_TIMED_DESPAWN, 29000); - me->SummonCreature(11197, ADD_5X, ADD_5Y, ADD_5Z, ADD_5O, TEMPSUMMON_TIMED_DESPAWN, 29000); - me->SummonCreature(11197, ADD_6X, ADD_6Y, ADD_6Z, ADD_6O, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_1, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_2, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_3, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_4, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_5, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_6, TEMPSUMMON_TIMED_DESPAWN, 29000); //34 seconds until we should cast this again SummonSkeletons_Timer = 40000; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp index 7dafcc2b647..d72e226d2e2 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp index 4c2aa395e3c..909609baecc 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp index 04380da3051..2cb00df38db 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp index 5e67f35af8b..5d75ce4fa16 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp index 522e43c0824..0a7bdfad583 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp index d6742e63167..75bdd2b06de 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -27,10 +27,13 @@ EndScriptData */ #include "ScriptedCreature.h" #include "stratholme.h" -#define SPELL_ENCASINGWEBS 4962 -#define SPELL_PIERCEARMOR 6016 -#define SPELL_CRYPT_SCARABS 31602 -#define SPELL_RAISEUNDEADSCARAB 17235 +enum Spells +{ + SPELL_ENCASINGWEBS = 4962, + SPELL_PIERCEARMOR = 6016, + SPELL_CRYPT_SCARABS = 31602, + SPELL_RAISEUNDEADSCARAB = 17235 +}; class boss_nerubenkan : public CreatureScript { diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp index 96e59a657a3..e52fd3402e7 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -35,15 +35,22 @@ EndScriptData */ # Once Aurius is defeated, he should be the one summoning the ghosts. #####*/ -#define SH_GREGOR 17910 -#define SH_CATHELA 17911 -#define SH_NEMAS 17912 -#define SH_AELMAR 17913 -#define SH_VICAR 17914 -#define SH_QUEST_CREDIT 17915 +enum SH_CreatureIds +{ + SH_GREGOR = 17910, + SH_CATHELA = 17911, + SH_NEMAS = 17912, + SH_AELMAR = 17913, + SH_VICAR = 17914, + SH_QUEST_CREDIT = 17915 +}; + +enum Spells +{ + SPELL_HOLY_LIGHT = 25263, + SPELL_DIVINE_SHIELD = 13874 +}; -#define SPELL_HOLY_LIGHT 25263 -#define SPELL_DIVINE_SHIELD 13874 class boss_silver_hand_bosses : public CreatureScript { public: diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp index f650029a439..5b0b39c1de2 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -25,123 +25,109 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "stratholme.h" //Spell ID to summon this guy is 24627 "Summon Postmaster Malown" //He should be spawned along with three other elites once the third postbox has been opened -#define SAY_MALOWNED "You just got MALOWNED!" +enum Says +{ + SAY_KILL = 0 +}; -#define SPELL_WAILINGDEAD 7713 -#define SPELL_BACKHAND 6253 -#define SPELL_CURSEOFWEAKNESS 8552 -#define SPELL_CURSEOFTONGUES 12889 -#define SPELL_CALLOFTHEGRAVE 17831 +enum Spells +{ + SPELL_WAILINGDEAD = 7713, + SPELL_BACKHAND = 6253, + SPELL_CURSEOFWEAKNESS = 8552, + SPELL_CURSEOFTONGUES = 12889, + SPELL_CALLOFTHEGRAVE = 17831 +}; + +enum Events +{ + EVENT_WAILINGDEAD = 1, + EVENT_BACKHAND = 2, + EVENT_CURSEOFWEAKNESS = 3, + EVENT_CURSEOFTONGUES = 4, + EVENT_CALLOFTHEGRAVE = 5 +}; class boss_postmaster_malown : public CreatureScript { -public: - boss_postmaster_malown() : CreatureScript("boss_postmaster_malown") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_postmaster_malownAI (creature); - } - - struct boss_postmaster_malownAI : public ScriptedAI - { - boss_postmaster_malownAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 WailingDead_Timer; - uint32 Backhand_Timer; - uint32 CurseOfWeakness_Timer; - uint32 CurseOfTongues_Timer; - uint32 CallOfTheGrave_Timer; - bool HasYelled; - - void Reset() - { - WailingDead_Timer = 19000; //lasts 6 sec - Backhand_Timer = 8000; //2 sec stun - CurseOfWeakness_Timer = 20000; //lasts 2 mins - CurseOfTongues_Timer = 22000; - CallOfTheGrave_Timer = 25000; - HasYelled = false; - } + public: boss_postmaster_malown() : CreatureScript("boss_postmaster_malown") { } - void EnterCombat(Unit* /*who*/) + struct boss_postmaster_malownAI : public BossAI { - } + boss_postmaster_malownAI(Creature* creature) : BossAI(creature, TYPE_MALOWN) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; + void Reset() {} - //WailingDead - if (WailingDead_Timer <= diff) + void EnterCombat(Unit* /*who*/) { - //Cast - if (rand()%100 < 65) //65% chance to cast - { - DoCast(me->getVictim(), SPELL_WAILINGDEAD); - } - //19 seconds until we should cast this again - WailingDead_Timer = 19000; - } else WailingDead_Timer -= diff; - - //Backhand - if (Backhand_Timer <= diff) + events.ScheduleEvent(EVENT_WAILINGDEAD, 19000); // lasts 6 sec + events.ScheduleEvent(EVENT_BACKHAND, 8000); // 2 sec stun + events.ScheduleEvent(EVENT_CURSEOFWEAKNESS, 20000); // lasts 2 mins + events.ScheduleEvent(EVENT_CURSEOFTONGUES, 22000); + events.ScheduleEvent(EVENT_CALLOFTHEGRAVE, 25000); + } + + void KilledUnit(Unit* /*victim*/) { - //Cast - if (rand()%100 < 45) //45% chance to cast - { - DoCast(me->getVictim(), SPELL_BACKHAND); - } - //8 seconds until we should cast this again - Backhand_Timer = 8000; - } else Backhand_Timer -= diff; + Talk(SAY_KILL); + } - //CurseOfWeakness - if (CurseOfWeakness_Timer <= diff) + void UpdateAI(uint32 const diff) { - //Cast - if (rand()%100 < 3) //3% chance to cast - { - DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS); - } - //20 seconds until we should cast this again - CurseOfWeakness_Timer = 20000; - } else CurseOfWeakness_Timer -= diff; + if (!UpdateVictim()) + return; - //CurseOfTongues - if (CurseOfTongues_Timer <= diff) - { - //Cast - if (rand()%100 < 3) //3% chance to cast - { - DoCast(me->getVictim(), SPELL_CURSEOFTONGUES); - } - //22 seconds until we should cast this again - CurseOfTongues_Timer = 22000; - } else CurseOfTongues_Timer -= diff; + events.Update(diff); - //CallOfTheGrave - if (CallOfTheGrave_Timer <= diff) - { - //Cast - if (rand()%100 < 5) //5% chance to cast + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) { - DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE); + switch (eventId) + { + case EVENT_WAILINGDEAD: + if (rand()%100 < 65) //65% chance to cast + DoCastVictim(SPELL_WAILINGDEAD, true); + events.ScheduleEvent(EVENT_WAILINGDEAD, 19000); + break; + case EVENT_BACKHAND: + if (rand()%100 < 45) //45% chance to cast + DoCastVictim(SPELL_BACKHAND, true); + events.ScheduleEvent(EVENT_WAILINGDEAD, 8000); + break; + case EVENT_CURSEOFWEAKNESS: + if (rand()%100 < 3) //3% chance to cast + DoCastVictim(SPELL_CURSEOFWEAKNESS, true); + events.ScheduleEvent(EVENT_WAILINGDEAD, 20000); + break; + case EVENT_CURSEOFTONGUES: + if (rand()%100 < 3) //3% chance to cast + DoCastVictim(SPELL_CURSEOFTONGUES, true); + events.ScheduleEvent(EVENT_WAILINGDEAD, 22000); + break; + case EVENT_CALLOFTHEGRAVE: + if (rand()%100 < 5) //5% chance to cast + DoCastVictim(SPELL_CALLOFTHEGRAVE, true); + events.ScheduleEvent(EVENT_WAILINGDEAD, 25000); + break; + default: + break; + } } - //25 seconds until we should cast this again - CallOfTheGrave_Timer = 25000; - } else CallOfTheGrave_Timer -= diff; + DoMeleeAttackIfReady(); + } + }; - DoMeleeAttackIfReady(); + CreatureAI* GetAI(Creature* creature) const + { + return new boss_postmaster_malownAI(creature); } - }; - }; void AddSC_boss_postmaster_malown() diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp index 4f82367924d..6d83093d13c 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -27,10 +27,16 @@ EndScriptData */ #include "ScriptedCreature.h" #include "stratholme.h" -#define SPELL_TRAMPLE 5568 -#define SPELL_KNOCKOUT 17307 +enum Spells +{ + SPELL_TRAMPLE = 5568, + SPELL_KNOCKOUT = 17307 +}; - #define C_MINDLESS_UNDEAD 11030 +enum CreatureId +{ + NPC_MINDLESS_UNDEAD = 11030 +}; class boss_ramstein_the_gorger : public CreatureScript { @@ -68,7 +74,7 @@ public: { for (uint8 i = 0; i < 30; ++i) { - if (Creature* mob = me->SummonCreature(C_MINDLESS_UNDEAD, 3969.35f+irand(-10, 10), -3391.87f+irand(-10, 10), 119.11f, 5.91f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000)) + if (Creature* mob = me->SummonCreature(NPC_MINDLESS_UNDEAD, 3969.35f+irand(-10, 10), -3391.87f+irand(-10, 10), 119.11f, 5.91f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000)) mob->AI()->AttackStart(me->SelectNearestTarget(100.0f)); } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp index 356023bce77..bd7c3519926 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -26,9 +26,15 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" -#define SAY_SPAWN "TIMMY!" +enum Says +{ + SAY_SPAWN = 0 +}; -#define SPELL_RAVENOUSCLAW 17470 +enum Spells +{ + SPELL_RAVENOUSCLAW = 17470 +}; class boss_timmy_the_cruel : public CreatureScript { @@ -57,7 +63,7 @@ public: { if (!HasYelled) { - me->MonsterYell(SAY_SPAWN, LANG_UNIVERSAL, 0); + Talk(SAY_SPAWN); HasYelled = true; } } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp index 2e4ec7278fc..c3244c63de6 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -29,33 +29,15 @@ EndScriptData */ #include "stratholme.h" #include "Player.h" -#define GO_SERVICE_ENTRANCE 175368 -#define GO_GAUNTLET_GATE1 175357 -#define GO_ZIGGURAT1 175380 //baroness -#define GO_ZIGGURAT2 175379 //nerub'enkan -#define GO_ZIGGURAT3 175381 //maleki -#define GO_ZIGGURAT4 175405 //rammstein -#define GO_ZIGGURAT5 175796 //baron -#define GO_PORT_GAUNTLET 175374 //port from gauntlet to slaugther -#define GO_PORT_SLAUGTHER 175373 //port at slaugther -#define GO_PORT_ELDERS 175377 //port at elders square - -#define C_CRYSTAL 10415 //three ziggurat crystals -#define C_BARON 10440 -#define C_YSIDA_TRIGGER 16100 - -#define C_RAMSTEIN 10439 -#define C_ABOM_BILE 10416 -#define C_ABOM_VENOM 10417 -#define C_BLACK_GUARD 10394 -#define C_YSIDA 16031 - -#define MAX_ENCOUNTER 6 +enum Misc +{ + MAX_ENCOUNTER = 6 +}; enum InstanceEvents { EVENT_BARON_RUN = 1, - EVENT_SLAUGHTER_SQUARE = 2, + EVENT_SLAUGHTER_SQUARE = 2 }; class instance_stratholme : public InstanceMapScript @@ -148,17 +130,17 @@ class instance_stratholme : public InstanceMapScript { switch (creature->GetEntry()) { - case C_BARON: + case NPC_BARON: baronGUID = creature->GetGUID(); break; - case C_YSIDA_TRIGGER: + case NPC_YSIDA_TRIGGER: ysidaTriggerGUID = creature->GetGUID(); break; - case C_CRYSTAL: + case NPC_CRYSTAL: crystalsGUID.insert(creature->GetGUID()); break; - case C_ABOM_BILE: - case C_ABOM_VENOM: + case NPC_ABOM_BILE: + case NPC_ABOM_VENOM: abomnationGUID.insert(creature->GetGUID()); break; } @@ -168,11 +150,11 @@ class instance_stratholme : public InstanceMapScript { switch (creature->GetEntry()) { - case C_CRYSTAL: + case NPC_CRYSTAL: crystalsGUID.erase(creature->GetGUID()); break; - case C_ABOM_BILE: - case C_ABOM_VENOM: + case NPC_ABOM_BILE: + case NPC_ABOM_VENOM: abomnationGUID.erase(creature->GetGUID()); break; } @@ -255,7 +237,7 @@ class instance_stratholme : public InstanceMapScript { Position ysidaPos; ysidaTrigger->GetPosition(&ysidaPos); - ysidaTrigger->SummonCreature(C_YSIDA, ysidaPos, TEMPSUMMON_TIMED_DESPAWN, 1800000); + ysidaTrigger->SummonCreature(NPC_YSIDA, ysidaPos, TEMPSUMMON_TIMED_DESPAWN, 1800000); } events.CancelEvent(EVENT_BARON_RUN); break; @@ -300,7 +282,7 @@ class instance_stratholme : public InstanceMapScript //a bit itchy, it should close the door after 10 secs, but it doesn't. skipping it for now. //UpdateGoState(ziggurat4GUID, 0, true); if (Creature* pBaron = instance->GetCreature(baronGUID)) - pBaron->SummonCreature(C_RAMSTEIN, 4032.84f, -3390.24f, 119.73f, 4.71f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); + pBaron->SummonCreature(NPC_RAMSTEIN, 4032.84f, -3390.24f, 119.73f, 4.71f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); sLog->outDebug(LOG_FILTER_TSCR, "Instance Stratholme: Ramstein spawned."); } else @@ -455,7 +437,7 @@ class instance_stratholme : public InstanceMapScript if (Creature* baron = instance->GetCreature(baronGUID)) { for (uint8 i = 0; i < 4; ++i) - baron->SummonCreature(C_BLACK_GUARD, 4032.84f, -3390.24f, 119.73f, 4.71f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); + baron->SummonCreature(NPC_BLACK_GUARD, 4032.84f, -3390.24f, 119.73f, 4.71f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); HandleGameObject(ziggurat4GUID, true); HandleGameObject(ziggurat5GUID, true); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp index 5da38e21d2f..0798fe2e3b0 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h index b28271f5915..fc7630d7403 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -19,24 +19,65 @@ #ifndef DEF_STRATHOLME_H #define DEF_STRATHOLME_H -#define TYPE_BARON_RUN 1 -#define TYPE_BARONESS 2 -#define TYPE_NERUB 3 -#define TYPE_PALLID 4 -#define TYPE_RAMSTEIN 5 -#define TYPE_BARON 6 - -#define DATA_BARON 10 -#define DATA_YSIDA_TRIGGER 11 - -#define TYPE_SH_QUEST 20 -#define TYPE_SH_CATHELA 21 -#define TYPE_SH_GREGOR 22 -#define TYPE_SH_NEMAS 23 -#define TYPE_SH_VICAR 24 -#define TYPE_SH_AELMAR 25 - -#define QUEST_DEAD_MAN_PLEA 8945 -#define SPELL_BARON_ULTIMATUM 27861 +enum DataTypes +{ + TYPE_BARON_RUN = 1, + TYPE_BARONESS = 2, + TYPE_NERUB = 3, + TYPE_PALLID = 4, + TYPE_RAMSTEIN = 5, + TYPE_BARON = 6, + + TYPE_MALOWN = 7, + + DATA_BARON = 10, + DATA_YSIDA_TRIGGER = 11, + + TYPE_SH_QUEST = 20, + TYPE_SH_CATHELA = 21, + TYPE_SH_GREGOR = 22, + TYPE_SH_NEMAS = 23, + TYPE_SH_VICAR = 24, + TYPE_SH_AELMAR = 25 +}; + +enum CreatureIds +{ + NPC_CRYSTAL = 10415, // ziggurat crystal + NPC_BARON = 10440, // ziggurat crystal + NPC_YSIDA_TRIGGER = 16100, // ziggurat crystal + + NPC_RAMSTEIN = 10439, + NPC_ABOM_BILE = 10416, + NPC_ABOM_VENOM = 10417, + NPC_BLACK_GUARD = 10394, + NPC_YSIDA = 16031, +}; + +enum GameobjectIds +{ + GO_DOOR_HALAZZI = 186303, + GO_SERVICE_ENTRANCE = 175368, + GO_GAUNTLET_GATE1 = 175357, + GO_ZIGGURAT1 = 175380, // baroness + GO_ZIGGURAT2 = 175379, // nerub'enkan + GO_ZIGGURAT3 = 175381, // maleki + GO_ZIGGURAT4 = 175405, // rammstein + GO_ZIGGURAT5 = 175796, // baron + GO_PORT_GAUNTLET = 175374, // port from gauntlet to slaugther + GO_PORT_SLAUGTHER = 175373, // port at slaugther + GO_PORT_ELDERS = 175377 // port at elders square +}; + +enum QuestIds +{ + QUEST_DEAD_MAN_PLEA = 8945 +}; + +enum SpellIds +{ + SPELL_BARON_ULTIMATUM = 27861 +}; + #endif diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp index 624e5460213..ee0d9bb64f3 100644 --- a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp +++ b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -27,18 +27,24 @@ EndScriptData */ #include "InstanceScript.h" #include "sunken_temple.h" -#define GO_ATALAI_STATUE1 148830 -#define GO_ATALAI_STATUE2 148831 -#define GO_ATALAI_STATUE3 148832 -#define GO_ATALAI_STATUE4 148833 -#define GO_ATALAI_STATUE5 148834 -#define GO_ATALAI_STATUE6 148835 -#define GO_ATALAI_IDOL 148836 +enum Gameobject +{ + GO_ATALAI_STATUE1 = 148830, + GO_ATALAI_STATUE2 = 148831, + GO_ATALAI_STATUE3 = 148832, + GO_ATALAI_STATUE4 = 148833, + GO_ATALAI_STATUE5 = 148834, + GO_ATALAI_STATUE6 = 148835, + GO_ATALAI_IDOL = 148836, + GO_ATALAI_LIGHT1 = 148883, + GO_ATALAI_LIGHT2 = 148937 -#define GO_ATALAI_LIGHT1 148883 -#define GO_ATALAI_LIGHT2 148937 +}; -#define NPC_MALFURION_STORMRAGE 15362 +enum CreatureIds +{ + NPC_MALFURION_STORMRAGE = 15362 +}; class instance_sunken_temple : public InstanceMapScript { diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp index 040e2153c2d..027080404f6 100644 --- a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp +++ b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h index 6b93ef03fa8..57d073380bc 100644 --- a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h +++ b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index 3e9d2e991fc..dab612828f8 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp index 23a83a7ee8f..6e3f024ac1d 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index 35fabb7a195..7f72da805ce 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index c2dc7123f6d..a8755c16418 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index b32f9244034..59face32389 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index d23ca834f86..5eb79258005 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp index c4bb41036bc..d575b7633cb 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp index 25bc85f47b6..2db77197eb0 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h index ed21077cc63..2efffc816c0 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index 0b7a62f6563..87301f43745 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -31,19 +31,15 @@ EndScriptData */ #include "uldaman.h" #include "Player.h" -#define SAY_AGGRO "Who dares awaken Archaedas? Who dares the wrath of the makers!" -#define SOUND_AGGRO 5855 - -#define SAY_SUMMON "Awake ye servants, defend the discs!" -#define SOUND_SUMMON 5856 - -#define SAY_SUMMON2 "To my side, brothers. For the makers!" -#define SOUND_SUMMON2 5857 - -#define SAY_KILL "Reckless mortal." -#define SOUND_KILL 5858 +enum Says +{ + SAY_AGGRO = 0, + SAY_SUMMON_GUARDIANS = 1, + SAY_SUMMON_VAULT_WALKERS = 2, + SAY_KILL = 3 +}; -enum eSpells +enum Spells { SPELL_GROUND_TREMOR = 6524, SPELL_ARCHAEDAS_AWAKEN = 10347, @@ -52,6 +48,7 @@ enum eSpells SPELL_SUB_BOSS_AGGRO = 11568, SPELL_AWAKEN_VAULT_WALKER = 10258, SPELL_AWAKEN_EARTHEN_GUARDIAN = 10252, + SPELL_SELF_DESTRUCT = 9874 }; class boss_archaedas : public CreatureScript @@ -122,8 +119,7 @@ class boss_archaedas : public CreatureScript // Being woken up from the altar, start the awaken sequence if (spell == sSpellMgr->GetSpellInfo(SPELL_ARCHAEDAS_AWAKEN)) { - me->MonsterYell(SAY_AGGRO, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_AGGRO); + Talk(SAY_AGGRO); iAwakenTimer = 4000; bWakingUp = true; } @@ -131,8 +127,7 @@ class boss_archaedas : public CreatureScript void KilledUnit(Unit* /*victim*/) { - me->MonsterYell(SAY_KILL, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_KILL); + Talk(SAY_KILL); } void UpdateAI(const uint32 uiDiff) @@ -172,8 +167,7 @@ class boss_archaedas : public CreatureScript ActivateMinion(instance->GetData64(8), true); // EarthenGuardian4 ActivateMinion(instance->GetData64(9), true); // EarthenGuardian5 ActivateMinion(instance->GetData64(10), false); // EarthenGuardian6 - me->MonsterYell(SAY_SUMMON, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_SUMMON); + Talk(SAY_SUMMON_GUARDIANS); bGuardiansAwake = true; } @@ -184,8 +178,7 @@ class boss_archaedas : public CreatureScript ActivateMinion(instance->GetData64(2), true); // VaultWalker2 ActivateMinion(instance->GetData64(3), true); // VaultWalker3 ActivateMinion(instance->GetData64(4), false); // VaultWalker4 - me->MonsterYell(SAY_SUMMON2, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_SUMMON2); + Talk(SAY_SUMMON_VAULT_WALKERS); bVaultWalkersAwake = true; } @@ -224,8 +217,6 @@ SDComment: These mobs are initially frozen until Archaedas awakens them one at a time. EndScriptData */ -#define SPELL_ARCHAEDAS_AWAKEN 10347 - class mob_archaedas_minions : public CreatureScript { public: @@ -323,8 +314,6 @@ SDComment: After activating the altar of the keepers, the stone keepers will wake up one by one. EndScriptData */ -#define SPELL_SELF_DESTRUCT 9874 - class mob_stonekeepers : public CreatureScript { public: @@ -388,8 +377,6 @@ SDComment: Needs 1 person to activate the Archaedas script SDCategory: Uldaman EndScriptData */ -#define SPELL_BOSS_OBJECT_VISUAL 11206 - class go_altar_of_archaedas : public GameObjectScript { public: @@ -419,8 +406,6 @@ SDComment: Need 1 person to activate to open the altar. One by one the StoneKee SDCategory: Uldaman EndScriptData */ -#define SPELL_BOSS_OBJECT_VISUAL 11206 - class go_altar_of_the_keepers : public GameObjectScript { public: diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp index 1537f0eeb88..6f521060541 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp index efbc4f75ae1..138243a9ce2 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp index d86da3efce5..0cd59951590 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.h b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.h index 360a80ac4f3..86f3d3b6d1e 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.h +++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index 068d00f550f..1b2512ccf63 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ enum Spells { SPELL_STATIC_DISRUPTION = 43622, SPELL_STATIC_VISUAL = 45265, - SPELL_CALL_LIGHTNING = 43661, //Missing timer + SPELL_CALL_LIGHTNING = 43661, // Missing timer SPELL_GUST_OF_WIND = 43621, SPELL_ELECTRICAL_STORM = 43648, SPELL_BERSERK = 45078, @@ -46,25 +46,24 @@ enum Spells SPELL_EAGLE_SWOOP = 44732 }; -//"Your death gonna be quick, strangers. You shoulda never have come to this place..." -#define SAY_ONAGGRO "I be da predator! You da prey..." -#define SAY_ONDEATH "You can't... kill... me spirit!" -#define SAY_ONSLAY1 "Ya got nothin'!" -#define SAY_ONSLAY2 "Stop your cryin'!" -#define SAY_ONSUMMON "Feed, me bruddahs!" -#define SAY_ONENRAGE "All you be doing is wasting my time!" -#define SOUND_ONAGGRO 12013 -#define SOUND_ONDEATH 12019 -#define SOUND_ONSLAY1 12017 -#define SOUND_ONSLAY2 12018 -#define SOUND_ONSUMMON 12014 -#define SOUND_ONENRAGE 12016 - -#define MOB_SOARING_EAGLE 24858 -#define SE_LOC_X_MAX 400 -#define SE_LOC_X_MIN 335 -#define SE_LOC_Y_MAX 1435 -#define SE_LOC_Y_MIN 1370 +enum Says +{ + SAY_AGGRO = 0, + SAY_SUMMON = 1, + SAY_INTRO = 2, // Not used in script + SAY_ENRAGE = 3, + SAY_KILL = 4, + SAY_DEATH = 5 +}; + +enum Misc +{ + MOB_SOARING_EAGLE = 24858, + SE_LOC_X_MAX = 400, + SE_LOC_X_MIN = 335, + SE_LOC_Y_MAX = 1435, + SE_LOC_Y_MIN = 1370 +}; class boss_akilzon : public CreatureScript { @@ -130,8 +129,7 @@ class boss_akilzon : public CreatureScript void EnterCombat(Unit* /*who*/) { - me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONAGGRO); + Talk(SAY_AGGRO); //DoZoneInCombat(); if (instance) instance->SetData(DATA_AKILZONEVENT, IN_PROGRESS); @@ -139,8 +137,7 @@ class boss_akilzon : public CreatureScript void JustDied(Unit* /*killer*/) { - me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONDEATH); + Talk(SAY_DEATH); if (instance) instance->SetData(DATA_AKILZONEVENT, DONE); DespawnSummons(); @@ -148,17 +145,7 @@ class boss_akilzon : public CreatureScript void KilledUnit(Unit* /*victim*/) { - switch (urand(0, 1)) - { - case 0: - me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONSLAY1); - break; - case 1: - me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONSLAY2); - break; - } + Talk(SAY_KILL); } void DespawnSummons() @@ -276,8 +263,7 @@ class boss_akilzon : public CreatureScript if (Enrage_Timer <= diff) { - me->MonsterYell(SAY_ONENRAGE, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONENRAGE); + Talk(SAY_ENRAGE); DoCast(me, SPELL_BERSERK, true); Enrage_Timer = 600000; } else Enrage_Timer -= diff; @@ -351,8 +337,7 @@ class boss_akilzon : public CreatureScript if (SummonEagles_Timer <= diff) { - me->MonsterYell(SAY_ONSUMMON, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONSUMMON); + Talk(SAY_SUMMON); float x, y, z; me->GetPosition(x, y, z); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp index f7f279cf716..935e54eae0c 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp index 4fcfa8a046e..d3d7bd390ca 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index ed10dec97dd..eced8dd6830 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp index eb3057a74d3..8fd9da930ae 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index 5aa74fbbe89..2305c360fd2 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -27,86 +27,68 @@ EndScriptData */ #include "zulaman.h" #include "SpellInfo.h" -//Speech -const char* YELL_TRANSFORM_TO_LYNX = "Let me introduce to you my new bruddahs: fang and claw!"; -#define SOUND_TRANSFORM_TO_LYNX 12094 - -const char* YELL_TRANSFORM_TO_BEAR = "Got me some new tricks...like me bruddah bear!"; -#define SOUND_TRANSFORM_TO_BEAR 12092 - -const char* YELL_TRANSFORM_TO_DRAGONHAWK = "Ya don' have to look to da sky to see da dragonhawk!"; -#define SOUND_TRANSFORM_TO_DRAGONHAWK 12095 - -const char* YELL_TRANSFORM_TO_EAGLE = "Dere be no hidin' from da eagle!"; -#define SOUND_TRANSFORM_TO_EAGLE 12093 - -#define YELL_KILL_ONE "Da Amani de chuka!" -#define SOUND_KILL_ONE 12098 - -#define YELL_KILL_TWO "Lot more gonna fall like you!" -#define SOUND_KILL_TWO 12099 - -#define YELL_FIRE_BREATH "Fire kill you just as quick!" -#define SOUND_FIRE_BRETH 12096 - -#define YELL_AGGRO "Nobody badduh dan me!" -#define SOUND_AGGRO 12091 - -#define YELL_BERSERK "You too slow! Me too strong!" -#define SOUND_BERSERK 12097 - -#define YELL_DEATH "Mebbe me fall...but da Amani empire...never gonna die..." -#define SOUND_DEATH 12100 - -//Still not used, need more info -#define YELL_INTRO "Everybody always wanna take from us. Now we gonna start takin' back. Anybody who get in our way...gonna drown in their own blood! De Amani empire be back now...seekin' vengeance. And we gonna start...with you!" -#define SOUND_INTRO 12090 - -//Spells: -//====== Troll Form -#define SPELL_WHIRLWIND 17207 -#define SPELL_GRIEVOUS_THROW 43093 // remove debuff after full healed -//====== Bear Form -#define SPELL_CREEPING_PARALYSIS 43095 // should cast on the whole raid -#define SPELL_OVERPOWER 43456 // use after melee attack dodged -//====== Eagle Form -#define SPELL_ENERGY_STORM 43983 // enemy area aura, trigger 42577 -#define SPELL_ZAP_INFORM 42577 -#define SPELL_ZAP_DAMAGE 43137 // 1250 damage -#define SPELL_SUMMON_CYCLONE 43112 // summon four feather vortex -#define CREATURE_FEATHER_VORTEX 24136 -#define SPELL_CYCLONE_VISUAL 43119 // trigger 43147 visual -#define SPELL_CYCLONE_PASSIVE 43120 // trigger 43121 (4y aoe) every second -//Lynx Form -#define SPELL_CLAW_RAGE_HASTE 42583 -#define SPELL_CLAW_RAGE_TRIGGER 43149 -#define SPELL_CLAW_RAGE_DAMAGE 43150 -#define SPELL_LYNX_RUSH_HASTE 43152 -#define SPELL_LYNX_RUSH_DAMAGE 43153 -//Dragonhawk Form -#define SPELL_FLAME_WHIRL 43213 // trigger two spells -#define SPELL_FLAME_BREATH 43215 -#define SPELL_SUMMON_PILLAR 43216 // summon 24187 -#define CREATURE_COLUMN_OF_FIRE 24187 -#define SPELL_PILLAR_TRIGGER 43218 // trigger 43217 - -//cosmetic -#define SPELL_SPIRIT_AURA 42466 -#define SPELL_SIPHON_SOUL 43501 - -//Transforms: -#define SPELL_SHAPE_OF_THE_BEAR 42594 // 15% dmg -#define SPELL_SHAPE_OF_THE_EAGLE 42606 -#define SPELL_SHAPE_OF_THE_LYNX 42607 // haste melee 30% -#define SPELL_SHAPE_OF_THE_DRAGONHAWK 42608 - -#define SPELL_BERSERK 45078 - -#define PHASE_BEAR 0 -#define PHASE_EAGLE 1 -#define PHASE_LYNX 2 -#define PHASE_DRAGONHAWK 3 -#define PHASE_TROLL 4 +enum Says +{ + YELL_INTRO = 0, + YELL_AGGRO = 1, + YELL_TRANSFORM_TO_BEAR = 2, + YELL_TRANSFORM_TO_EAGLE = 3, + YELL_TRANSFORM_TO_LYNX = 4, + YELL_TRANSFORM_TO_DRAGONHAWK = 5, + YELL_FIRE_BREATH = 6, + YELL_BERSERK = 7, + YELL_KILL = 8, + YELL_DEATH = 9 +}; + +enum Spells +{ + // Troll Form + SPELL_WHIRLWIND = 17207, + SPELL_GRIEVOUS_THROW = 43093, // remove debuff after full healed + // Bear Form + SPELL_CREEPING_PARALYSIS = 43095, // should cast on the whole raid + SPELL_OVERPOWER = 43456, // use after melee attack dodged + // Eagle Form + SPELL_ENERGY_STORM = 43983, // enemy area aura, trigger 42577 + SPELL_ZAP_INFORM = 42577, + SPELL_ZAP_DAMAGE = 43137, // 1250 damage + SPELL_SUMMON_CYCLONE = 43112, // summon four feather vortex + CREATURE_FEATHER_VORTEX = 24136, + SPELL_CYCLONE_VISUAL = 43119, // trigger 43147 visual + SPELL_CYCLONE_PASSIVE = 43120, // trigger 43121 (4y aoe) every second + // Lynx Form + SPELL_CLAW_RAGE_HASTE = 42583, + SPELL_CLAW_RAGE_TRIGGER = 43149, + SPELL_CLAW_RAGE_DAMAGE = 43150, + SPELL_LYNX_RUSH_HASTE = 43152, + SPELL_LYNX_RUSH_DAMAGE = 43153, + // Dragonhawk Form + SPELL_FLAME_WHIRL = 43213, // trigger two spells + SPELL_FLAME_BREATH = 43215, + SPELL_SUMMON_PILLAR = 43216, // summon 24187 + CREATURE_COLUMN_OF_FIRE = 24187, + SPELL_PILLAR_TRIGGER = 43218, // trigger 43217 + // Cosmetic + SPELL_SPIRIT_AURA = 42466, + SPELL_SIPHON_SOUL = 43501, + // Transforms: + SPELL_SHAPE_OF_THE_BEAR = 42594, // 15% dmg + SPELL_SHAPE_OF_THE_EAGLE = 42606, + SPELL_SHAPE_OF_THE_LYNX = 42607, // haste melee 30% + SPELL_SHAPE_OF_THE_DRAGONHAWK = 42608, + + SPELL_BERSERK = 45078 +}; + +enum Phase +{ + PHASE_BEAR = 0, + PHASE_EAGLE = 1, + PHASE_LYNX = 2, + PHASE_DRAGONHAWK = 3, + PHASE_TROLL = 4 +}; //coords for going for changing form #define CENTER_X 120.148811f @@ -129,17 +111,16 @@ static SpiritInfoStruct SpiritInfo[4] = struct TransformStruct { - uint32 sound; - std::string text; + uint8 text; uint32 spell, unaura; }; static TransformStruct Transform[4] = { - {SOUND_TRANSFORM_TO_BEAR, YELL_TRANSFORM_TO_BEAR, SPELL_SHAPE_OF_THE_BEAR, SPELL_WHIRLWIND}, - {SOUND_TRANSFORM_TO_EAGLE, YELL_TRANSFORM_TO_EAGLE, SPELL_SHAPE_OF_THE_EAGLE, SPELL_SHAPE_OF_THE_BEAR}, - {SOUND_TRANSFORM_TO_LYNX, YELL_TRANSFORM_TO_LYNX, SPELL_SHAPE_OF_THE_LYNX, SPELL_SHAPE_OF_THE_EAGLE}, - {SOUND_TRANSFORM_TO_DRAGONHAWK, YELL_TRANSFORM_TO_DRAGONHAWK, SPELL_SHAPE_OF_THE_DRAGONHAWK, SPELL_SHAPE_OF_THE_LYNX} + {YELL_TRANSFORM_TO_BEAR, SPELL_SHAPE_OF_THE_BEAR, SPELL_WHIRLWIND}, + {YELL_TRANSFORM_TO_EAGLE, SPELL_SHAPE_OF_THE_EAGLE, SPELL_SHAPE_OF_THE_BEAR}, + {YELL_TRANSFORM_TO_LYNX, SPELL_SHAPE_OF_THE_LYNX, SPELL_SHAPE_OF_THE_EAGLE}, + {YELL_TRANSFORM_TO_DRAGONHAWK, SPELL_SHAPE_OF_THE_DRAGONHAWK, SPELL_SHAPE_OF_THE_LYNX} }; class boss_zuljin : public CreatureScript @@ -230,8 +211,7 @@ class boss_zuljin : public CreatureScript DoZoneInCombat(); - me->MonsterYell(YELL_INTRO, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_INTRO); + Talk(YELL_INTRO); SpawnAdds(); EnterPhase(0); } @@ -241,17 +221,7 @@ class boss_zuljin : public CreatureScript if (Intro_Timer) return; - switch (urand(0, 1)) - { - case 0: - me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_KILL_ONE); - break; - case 1: - me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_KILL_TWO); - break; - } + Talk(YELL_KILL); } void JustDied(Unit* /*killer*/) @@ -259,8 +229,7 @@ class boss_zuljin : public CreatureScript if (instance) instance->SetData(DATA_ZULJINEVENT, DONE); - me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_DEATH); + Talk(YELL_DEATH); Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE); if (Unit* Temp = Unit::GetUnit(*me, SpiritGUID[3])) @@ -353,8 +322,7 @@ class boss_zuljin : public CreatureScript me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); me->RemoveAurasDueToSpell(Transform[Phase].unaura); DoCast(me, Transform[Phase].spell); - me->MonsterYell(Transform[Phase].text.c_str(), LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, Transform[Phase].sound); + Talk(Transform[Phase].text); if (Phase > 0) { if (Unit* Temp = Unit::GetUnit(*me, SpiritGUID[Phase - 1])) @@ -409,8 +377,7 @@ class boss_zuljin : public CreatureScript if (Berserk_Timer <= diff) { DoCast(me, SPELL_BERSERK, true); - me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_BERSERK); + Talk(YELL_BERSERK); Berserk_Timer = 60000; } else Berserk_Timer -= diff; @@ -421,8 +388,7 @@ class boss_zuljin : public CreatureScript { if (Intro_Timer <= diff) { - me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_AGGRO); + Talk(YELL_AGGRO); Intro_Timer = 0; } else Intro_Timer -= diff; } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp index 7273ca99c7c..f61861ebb62 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -29,13 +29,14 @@ EndScriptData */ #include "Player.h" #include "TemporarySummon.h" -#define MAX_ENCOUNTER 6 -#define RAND_VENDOR 2 +enum Misc +{ + MAX_ENCOUNTER = 7, + RAND_VENDOR = 2, + WORLDSTATE_SHOW_TIMER = 3104, + WORLDSTATE_TIME_TO_SACRIFICE = 3106 +}; -//187021 //Harkor's Satchel -//186648 //Tanzar's Trunk -//186672 //Ashli's Bag -//186667 //Kraz's Package // Chests spawn at bear/eagle/dragonhawk/lynx bosses // The loots depend on how many bosses have been killed, but not the entries of the chests // But we cannot add loots to gameobject, so we have to use the fixed loot_template @@ -51,9 +52,10 @@ static SHostageInfo HostageInfo[] = {23999, 187021, 400, 1414, 74.36f, 3.3f}, // eagle {24001, 186672, -35, 1134, 18.71f, 1.9f}, // dragonhawk {24024, 186667, 413, 1117, 6.32f, 3.1f} // lynx - }; +Position const HarrisonJonesLoc = {120.687f, 1674.0f, 42.0217f, 1.59044f}; + class instance_zulaman : public InstanceMapScript { public: @@ -70,9 +72,12 @@ class instance_zulaman : public InstanceMapScript uint64 TanzarsTrunkGUID; uint64 AshlisBagGUID; uint64 KrazsPackageGUID; + uint64 StrangeGongGUID; + uint64 HarrisonJonesGUID; uint64 HexLordGateGUID; uint64 ZulJinGateGUID; + uint64 MassiveGateGUID; uint64 AkilzonDoorGUID; uint64 ZulJinDoorGUID; uint64 HalazziDoorGUID; @@ -93,20 +98,25 @@ class instance_zulaman : public InstanceMapScript TanzarsTrunkGUID = 0; AshlisBagGUID = 0; KrazsPackageGUID = 0; - + StrangeGongGUID = 0; HexLordGateGUID = 0; ZulJinGateGUID = 0; + MassiveGateGUID = 0; AkilzonDoorGUID = 0; HalazziDoorGUID = 0; ZulJinDoorGUID = 0; + HarrisonJonesGUID = 0; + QuestTimer = 0; - QuestMinute = 21; + QuestMinute = 0; BossKilled = 0; ChestLooted = 0; for (uint8 i = 0; i < RAND_VENDOR; ++i) RandVendor[i] = NOT_STARTED; + + m_auiEncounter[DATA_GONGEVENT] = NOT_STARTED; } bool IsEncounterInProgress() const @@ -118,16 +128,26 @@ class instance_zulaman : public InstanceMapScript return false; } + void OnPlayerEnter(Player* /*player*/) + { + if (!HarrisonJonesGUID) + instance->SummonCreature(NPC_HARRISON_JONES, HarrisonJonesLoc); + } + void OnCreatureCreate(Creature* creature) { switch (creature->GetEntry()) { - case 23578://janalai - case 23863://zuljin - case 24239://hexlord - case 23577://halazzi - case 23576://nalorakk - default: break; + case NPC_HARRISON_JONES: + HarrisonJonesGUID = creature->GetGUID(); + break; + case NPC_JANALAI: + case NPC_ZULJIN: + case NPC_HEXLORD: + case NPC_HALAZZI: + case NPC_NALORAKK: + default: + break; } } @@ -135,18 +155,19 @@ class instance_zulaman : public InstanceMapScript { switch (go->GetEntry()) { - case 186303: HalazziDoorGUID = go->GetGUID(); break; - case 186304: ZulJinGateGUID = go->GetGUID(); break; - case 186305: HexLordGateGUID = go->GetGUID(); break; - case 186858: AkilzonDoorGUID = go->GetGUID(); break; - case 186859: ZulJinDoorGUID = go->GetGUID(); break; - - case 187021: HarkorsSatchelGUID = go->GetGUID(); break; - case 186648: TanzarsTrunkGUID = go->GetGUID(); break; - case 186672: AshlisBagGUID = go->GetGUID(); break; - case 186667: KrazsPackageGUID = go->GetGUID(); break; - default: break; - + case GO_DOOR_HALAZZI: HalazziDoorGUID = go->GetGUID(); break; + case GO_GATE_ZULJIN: ZulJinGateGUID = go->GetGUID(); break; + case GO_GATE_HEXLORD: HexLordGateGUID = go->GetGUID(); break; + case GO_MASSIVE_GATE: MassiveGateGUID = go->GetGUID(); break; + case GO_DOOR_AKILZON: AkilzonDoorGUID = go->GetGUID(); break; + case GO_DOOR_ZULJIN: ZulJinDoorGUID = go->GetGUID(); break; + + case GO_HARKORS_SATCHEL: HarkorsSatchelGUID = go->GetGUID(); break; + case GO_TANZARS_TRUNK: TanzarsTrunkGUID = go->GetGUID(); break; + case GO_ASHLIS_BAG: AshlisBagGUID = go->GetGUID(); break; + case GO_KRAZS_PACKAGE: KrazsPackageGUID = go->GetGUID(); break; + case GO_STRANGE_GONG: StrangeGongGUID = go->GetGUID(); break; + default: break; } CheckInstanceStatus(); } @@ -173,10 +194,10 @@ class instance_zulaman : public InstanceMapScript void CheckInstanceStatus() { - if (BossKilled >= 4) + if (BossKilled >= DATA_HALAZZIEVENT) HandleGameObject(HexLordGateGUID, true); - if (BossKilled >= 5) + if (BossKilled >= DATA_HEXLORDEVENT) HandleGameObject(ZulJinGateGUID, true); } @@ -214,49 +235,57 @@ class instance_zulaman : public InstanceMapScript { switch (type) { + case DATA_GONGEVENT: + m_auiEncounter[DATA_GONGEVENT] = data; + if (data == IN_PROGRESS) + SaveToDB(); + else if (data == DONE) + QuestMinute = 21; + break; case DATA_NALORAKKEVENT: - m_auiEncounter[0] = data; + m_auiEncounter[DATA_NALORAKKEVENT] = data; if (data == DONE) { if (QuestMinute) { QuestMinute += 15; - DoUpdateWorldState(3106, QuestMinute); + DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, QuestMinute); } SummonHostage(0); } break; case DATA_AKILZONEVENT: - m_auiEncounter[1] = data; + m_auiEncounter[DATA_AKILZONEVENT] = data; HandleGameObject(AkilzonDoorGUID, data != IN_PROGRESS); if (data == DONE) { if (QuestMinute) { QuestMinute += 10; - DoUpdateWorldState(3106, QuestMinute); + DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, QuestMinute); } SummonHostage(1); } break; case DATA_JANALAIEVENT: - m_auiEncounter[2] = data; - if (data == DONE) SummonHostage(2); + m_auiEncounter[DATA_JANALAIEVENT] = data; + if (data == DONE) + SummonHostage(2); break; case DATA_HALAZZIEVENT: - m_auiEncounter[3] = data; + m_auiEncounter[DATA_HALAZZIEVENT] = data; HandleGameObject(HalazziDoorGUID, data != IN_PROGRESS); if (data == DONE) SummonHostage(3); break; case DATA_HEXLORDEVENT: - m_auiEncounter[4] = data; + m_auiEncounter[DATA_HEXLORDEVENT] = data; if (data == IN_PROGRESS) HandleGameObject(HexLordGateGUID, false); else if (data == NOT_STARTED) CheckInstanceStatus(); break; case DATA_ZULJINEVENT: - m_auiEncounter[5] = data; + m_auiEncounter[DATA_ZULJINEVENT] = data; HandleGameObject(ZulJinDoorGUID, data != IN_PROGRESS); break; case DATA_CHESTLOOTED: @@ -274,10 +303,10 @@ class instance_zulaman : public InstanceMapScript if (data == DONE) { ++BossKilled; - if (QuestMinute && BossKilled >= 4) + if (QuestMinute && BossKilled >= DATA_HALAZZIEVENT) { QuestMinute = 0; - DoUpdateWorldState(3104, 0); + DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0); } CheckInstanceStatus(); SaveToDB(); @@ -288,12 +317,13 @@ class instance_zulaman : public InstanceMapScript { switch (type) { - case DATA_NALORAKKEVENT: return m_auiEncounter[0]; - case DATA_AKILZONEVENT: return m_auiEncounter[1]; - case DATA_JANALAIEVENT: return m_auiEncounter[2]; - case DATA_HALAZZIEVENT: return m_auiEncounter[3]; - case DATA_HEXLORDEVENT: return m_auiEncounter[4]; - case DATA_ZULJINEVENT: return m_auiEncounter[5]; + case DATA_GONGEVENT: return m_auiEncounter[DATA_GONGEVENT]; + case DATA_NALORAKKEVENT: return m_auiEncounter[DATA_NALORAKKEVENT]; + case DATA_AKILZONEVENT: return m_auiEncounter[DATA_AKILZONEVENT]; + case DATA_JANALAIEVENT: return m_auiEncounter[DATA_JANALAIEVENT]; + case DATA_HALAZZIEVENT: return m_auiEncounter[DATA_HALAZZIEVENT]; + case DATA_HEXLORDEVENT: return m_auiEncounter[DATA_HEXLORDEVENT]; + case DATA_ZULJINEVENT: return m_auiEncounter[DATA_ZULJINEVENT]; case DATA_CHESTLOOTED: return ChestLooted; case TYPE_RAND_VENDOR_1: return RandVendor[0]; case TYPE_RAND_VENDOR_2: return RandVendor[1]; @@ -312,13 +342,27 @@ class instance_zulaman : public InstanceMapScript QuestTimer += 60000; if (QuestMinute) { - DoUpdateWorldState(3104, 1); - DoUpdateWorldState(3106, QuestMinute); - } else DoUpdateWorldState(3104, 0); + DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 1); + DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, QuestMinute); + } else DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0); } QuestTimer -= diff; } } + + uint64 GetData64(uint32 type) const + { + switch (type) + { + case GO_STRANGE_GONG: + return StrangeGongGUID; + case GO_MASSIVE_GATE: + return MassiveGateGUID; + } + + return 0; + } + }; InstanceScript* GetInstanceScript(InstanceMap* map) const diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index 61c7bda00ac..59997ebaa31 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ EndContentData */ #include "zulaman.h" #include "Player.h" #include "SpellInfo.h" +#include "SpellScript.h" /*###### ## npc_forest_frog @@ -199,9 +200,294 @@ class npc_zulaman_hostage : public CreatureScript } }; +/*###### +## npc_harrison_jones +######*/ + +enum Says +{ + SAY_HARRISON_0 = 0, + SAY_HARRISON_1 = 1, + SAY_HARRISON_2 = 0, + SAY_HARRISON_3 = 1 +}; + +enum Spells +{ + SPELL_BANGING_THE_GONG = 45225, + SPELL_STEALTH = 34189, + SPELL_COSMETIC_SPEAR_THROW = 43647 +}; + +enum Events +{ + GONG_EVENT_1 = 1, + GONG_EVENT_2 = 2, + GONG_EVENT_3 = 3, + GONG_EVENT_4 = 4, + GONG_EVENT_5 = 5, + GONG_EVENT_6 = 6, + GONG_EVENT_7 = 7, + GONG_EVENT_8 = 8, + GONG_EVENT_9 = 9, + GONG_EVENT_10 = 10, + GONG_EVENT_11 = 11 +}; + +enum Waypoints +{ + HARRISON_MOVE_1 = 860440, + HARRISON_MOVE_2 = 860441, + HARRISON_MOVE_3 = 860442 +}; + +enum DisplayIds +{ + MODEL_HARRISON_JONES_0 = 22340, + MODEL_HARRISON_JONES_1 = 22354, + MODEL_HARRISON_JONES_2 = 22347 +}; + +enum EntryIds +{ + NPC_HARRISON_JONES_1 = 24375, + NPC_HARRISON_JONES_2 = 24365, + NPC_AMANISHI_GUARDIAN = 23597, +}; + +enum Weapons +{ + WEAPON_MACE = 5301, + WEAPON_SPEAR = 13631 +}; + +class npc_harrison_jones : public CreatureScript +{ + public: + + npc_harrison_jones() + : CreatureScript("npc_harrison_jones") + { + } + + struct npc_harrison_jonesAI : public ScriptedAI + { + npc_harrison_jonesAI(Creature* creature) : ScriptedAI(creature) + { + instance = creature->GetInstanceScript(); + } + + InstanceScript* instance; + + uint8 _gongEvent; + uint32 _gongTimer; + uint64 uiTargetGUID; + + void Reset() + { + _gongEvent = 0; + _gongTimer = 0; + uiTargetGUID = 0; + } + + void EnterCombat(Unit* /*who*/) {} + + void sGossipSelect(Player* player, uint32 sender, uint32 action) + { + if (me->GetCreatureTemplate()->GossipMenuId == sender && !action) + { + player->CLOSE_GOSSIP_MENU(); + me->SetInFront(player); + me->SendMovementFlagUpdate(true); + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + Talk(SAY_HARRISON_0); + _gongEvent = GONG_EVENT_1; + _gongTimer = 4000; + } + } + + void SpellHit(Unit*, const SpellInfo* spell) + { + if (spell->Id == SPELL_COSMETIC_SPEAR_THROW) + { + me->RemoveAllAuras(); + me->SetEntry(NPC_HARRISON_JONES_2); + me->SetDisplayId(MODEL_HARRISON_JONES_2); + me->SetTarget(0); + me->SetByteValue(UNIT_FIELD_BYTES_1,0,UNIT_STAND_STATE_DEAD); + me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); + if (instance) + instance->SetData(DATA_GONGEVENT, DONE); + } + } + + void UpdateAI(uint32 const diff) + { + if (_gongEvent) + { + if (_gongTimer <= diff) + { + switch (_gongEvent) + { + case GONG_EVENT_1: + me->GetMotionMaster()->MovePath(HARRISON_MOVE_1,false); + _gongEvent = GONG_EVENT_2; + _gongTimer = 12000; + break; + case GONG_EVENT_2: + me->SetFacingTo(6.235659f); + Talk(SAY_HARRISON_1); + DoCast(me, SPELL_BANGING_THE_GONG); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_MACE)); + me->SetSheath(SHEATH_STATE_MELEE); + _gongEvent = GONG_EVENT_3; + _gongTimer = 4000; + break; + case GONG_EVENT_3: + if (GameObject* gong = me->GetMap()->GetGameObject(instance->GetData64(GO_STRANGE_GONG))) + gong->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_NOT_SELECTABLE); + _gongEvent = GONG_EVENT_4; + _gongTimer = 105000; + break; + case GONG_EVENT_4: + me->RemoveAura(SPELL_BANGING_THE_GONG); + if (GameObject* gong = me->GetMap()->GetGameObject(instance->GetData64(GO_STRANGE_GONG))) + gong->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_NOT_SELECTABLE); + + // trigger or gong will need to be scripted to set IN_PROGRESS after enough hits. + // This is temp workaround. + if (instance) + instance->SetData(DATA_GONGEVENT, IN_PROGRESS); // to be removed. + + if (instance->GetData(DATA_GONGEVENT) == IN_PROGRESS) + { + // Players are Now Saved to instance at SPECIAL (Player should be notified?) + me->GetMotionMaster()->MovePath(HARRISON_MOVE_2,false); + _gongEvent = GONG_EVENT_5; + _gongTimer = 5000; + } + else + { + _gongTimer = 1000; + _gongEvent = GONG_EVENT_9; + } + break; + case GONG_EVENT_5: + me->SetEntry(NPC_HARRISON_JONES_1); + me->SetDisplayId(MODEL_HARRISON_JONES_1); + Talk(SAY_HARRISON_2); + _gongTimer = 12000; + _gongEvent = GONG_EVENT_6; + break; + case GONG_EVENT_6: + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING); + Talk(SAY_HARRISON_3); + _gongTimer = 7000; + _gongEvent = GONG_EVENT_7; + break; + case GONG_EVENT_7: + if (!uiTargetGUID) + { + std::list<Creature*> targetList; + GetCreatureListWithEntryInGrid(targetList, me, NPC_AMANISHI_GUARDIAN, 26.0f); + if (!targetList.empty()) + { + for (std::list<Creature*>::const_iterator itr = targetList.begin(); itr != targetList.end(); ++itr) + { + if (Creature* ptarget = *itr) + { + if (ptarget->GetPositionX() > 120) + { + ptarget->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_SPEAR)); + ptarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + ptarget->SetReactState(REACT_PASSIVE); + ptarget->AI()->SetData(0,1); + } + else + ptarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + ptarget->SetReactState(REACT_PASSIVE); + ptarget->AI()->SetData(0,2); + } + } + } + } + + if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_MASSIVE_GATE))) + gate->SetGoState(GO_STATE_ACTIVE); + _gongTimer = 2000; + _gongEvent = GONG_EVENT_8; + break; + case GONG_EVENT_8: + DoCast(me, SPELL_STEALTH); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(0)); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + me->GetMotionMaster()->MovePath(HARRISON_MOVE_3,false); + _gongTimer = 1000; + _gongEvent = 0; + break; + case GONG_EVENT_9: + me->GetMotionMaster()->MovePoint(0, 120.687f, 1674.0f, 42.0217f); + _gongTimer = 12000; + _gongEvent = GONG_EVENT_10; + break; + case GONG_EVENT_10: + me->SetFacingTo(1.59044f); + _gongEvent = 11; + _gongTimer = 6000; + break; + case GONG_EVENT_11: + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + if (instance) + instance->SetData(DATA_GONGEVENT, NOT_STARTED); + _gongEvent = 0; + _gongTimer = 1000; + break; + } + } + else + _gongTimer -= diff; + } + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_harrison_jonesAI(creature); + } +}; + +class spell_banging_the_gong : public SpellScriptLoader +{ + public: + spell_banging_the_gong() : SpellScriptLoader("spell_banging_the_gong") { } + + class spell_banging_the_gong_SpellScript : public SpellScript + { + PrepareSpellScript(spell_banging_the_gong_SpellScript); + + void Activate(SpellEffIndex index) + { + PreventHitDefaultEffect(index); + GetHitGObj()->SendCustomAnim(0); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_banging_the_gong_SpellScript::Activate, EFFECT_1, SPELL_EFFECT_ACTIVATE_OBJECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_banging_the_gong_SpellScript(); + } +}; + + void AddSC_zulaman() { new npc_forest_frog(); new npc_zulaman_hostage(); + new npc_harrison_jones(); + new spell_banging_the_gong(); } - diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h index daad916c0aa..c3386f8c996 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -19,15 +19,43 @@ #ifndef DEF_ZULAMAN_H #define DEF_ZULAMAN_H -#define DATA_NALORAKKEVENT 1 -#define DATA_AKILZONEVENT 2 -#define DATA_JANALAIEVENT 3 -#define DATA_HALAZZIEVENT 4 -#define DATA_HEXLORDEVENT 5 -#define DATA_ZULJINEVENT 6 -#define DATA_CHESTLOOTED 7 -#define TYPE_RAND_VENDOR_1 8 -#define TYPE_RAND_VENDOR_2 9 +enum DataTypes +{ + DATA_GONGEVENT = 0, + DATA_NALORAKKEVENT = 1, + DATA_AKILZONEVENT = 2, + DATA_JANALAIEVENT = 3, + DATA_HALAZZIEVENT = 4, + DATA_HEXLORDEVENT = 5, + DATA_ZULJINEVENT = 6, + DATA_CHESTLOOTED = 7, + TYPE_RAND_VENDOR_1 = 8, + TYPE_RAND_VENDOR_2 = 9 +}; -#endif +enum CreatureIds +{ + NPC_HARRISON_JONES = 24358, + NPC_JANALAI = 23578, + NPC_ZULJIN = 23863, + NPC_HEXLORD = 24239, + NPC_HALAZZI = 23577, + NPC_NALORAKK = 23576 +}; + +enum GameobjectIds +{ + GO_DOOR_HALAZZI = 186303, + GO_GATE_ZULJIN = 186304, + GO_GATE_HEXLORD = 186305, + GO_MASSIVE_GATE = 186728, + GO_DOOR_AKILZON = 186858, + GO_DOOR_ZULJIN = 186859, + GO_HARKORS_SATCHEL = 187021, + GO_TANZARS_TRUNK = 186648, + GO_ASHLIS_BAG = 186672, + GO_KRAZS_PACKAGE = 186667, + GO_STRANGE_GONG = 187359 +}; +#endif diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp index c5639a68860..54a5f5c706c 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp index 5e553c7396f..e7d54aecb31 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp index 8c71ea6d48d..4ccdbceb466 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp index 7d80de88beb..781b68bfcb0 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp index bb3e0b14e0e..bbdc2905874 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp index 3a2da6fdba9..10431ec84bd 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp index 844a2b16800..7c4c9626f9a 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 9f3aa315efa..bcc080bb8a5 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp index 17b268b92ef..56aeee93ee2 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp index 32a8f209917..d562b7cdf9b 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -27,10 +27,16 @@ EndScriptData */ #include "ScriptedCreature.h" #include "zulgurub.h" -#define SPELL_AMBUSH 24337 -#define SPELL_THOUSANDBLADES 24649 +enum Spells +{ + SPELL_AMBUSH = 34794, + SPELL_THOUSANDBLADES = 34799 +}; -#define EQUIP_ID_MAIN_HAND 0 //was item display id 31818, but this id does not exist +enum Misc +{ + EQUIP_ID_MAIN_HAND = 0 //was item display id 31818, but this id does not exist +}; class boss_renataki : public CreatureScript { diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index 3ea5d932ab0..d91b8f0b483 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp index 06448032dff..ff63e4a8adb 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp index 6cdb00236df..810ee5e900e 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -27,8 +27,11 @@ EndScriptData */ #include "ScriptedCreature.h" #include "zulgurub.h" -#define SPELL_LIGHTNINGCLOUD 25033 -#define SPELL_LIGHTNINGWAVE 24819 +enum Spells +{ + SPELL_LIGHTNINGCLOUD = 25033, + SPELL_LIGHTNINGWAVE = 24819 +}; class boss_wushoolay : public CreatureScript { diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp index 8d17a18bb1b..cfaf19642f2 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h index d127680cec5..22637315066 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h +++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/boss_kruul.cpp b/src/server/scripts/EasternKingdoms/boss_kruul.cpp index 6a1ba633660..226ff794a9f 100644 --- a/src/server/scripts/EasternKingdoms/boss_kruul.cpp +++ b/src/server/scripts/EasternKingdoms/boss_kruul.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/alterac_mountains.cpp b/src/server/scripts/EasternKingdoms/zone_alterac_mountains.cpp index b56727b18e1..9b9af494554 100644 --- a/src/server/scripts/EasternKingdoms/alterac_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/zone_alterac_mountains.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp index 7f96706f48e..d638a435936 100644 --- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/blasted_lands.cpp b/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp index 47fb8298ca7..4f76edf4406 100644 --- a/src/server/scripts/EasternKingdoms/blasted_lands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/burning_steppes.cpp b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp index ba1d339730a..b6899c534e4 100644 --- a/src/server/scripts/EasternKingdoms/burning_steppes.cpp +++ b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/duskwood.cpp b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp index fbb98979e77..1ce83d31a63 100644 --- a/src/server/scripts/EasternKingdoms/duskwood.cpp +++ b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp index c9b60f847e8..a2522fd9495 100644 --- a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp index c5f9522b23d..432768a51de 100644 --- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp index ddd3b0f423a..9e00ceb2aa5 100644 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp index 544ea0fd175..ffd31937677 100644 --- a/src/server/scripts/EasternKingdoms/hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/ironforge.cpp b/src/server/scripts/EasternKingdoms/zone_ironforge.cpp index fdd9f5f9a86..f9e8d4d16c6 100644 --- a/src/server/scripts/EasternKingdoms/ironforge.cpp +++ b/src/server/scripts/EasternKingdoms/zone_ironforge.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp index 5625b6994d7..bfd4d24cec6 100644 --- a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp +++ b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/loch_modan.cpp b/src/server/scripts/EasternKingdoms/zone_loch_modan.cpp index 0937e3cbb30..30f12718d64 100644 --- a/src/server/scripts/EasternKingdoms/loch_modan.cpp +++ b/src/server/scripts/EasternKingdoms/zone_loch_modan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp index 9fa8ac70eed..5ff95f83f25 100644 --- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp b/src/server/scripts/EasternKingdoms/zone_silvermoon_city.cpp index d8e9a9ae49a..e750faefbf5 100644 --- a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp +++ b/src/server/scripts/EasternKingdoms/zone_silvermoon_city.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp index 1960d90f28f..290f7fa6882 100644 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp index f7d896a7cdb..e81567a1a7a 100644 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -470,8 +470,8 @@ enum eTyrionSpybot SAY_SPYBOT_3 = 3, SAY_SPYBOT_4 = 4, SAY_TYRION_1 = 0, - SAY_GUARD_1 = 0, - SAY_LESCOVAR_1 = 0, + SAY_GUARD_1 = 1, + SAY_LESCOVAR_1 = 3, NPC_PRIESTESS_TYRIONA = 7779, NPC_LORD_GREGOR_LESCOVAR = 1754, diff --git a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp index 2217eba7d1b..6e14ef840a3 100644 --- a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp +++ b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp b/src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp index 099bc0770b7..f686de5d88f 100644 --- a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp +++ b/src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp index 22cd971a081..f36220dec0f 100644 --- a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp +++ b/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/zone_undercity.cpp index 05938452520..2c3017a2f1a 100644 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ b/src/server/scripts/EasternKingdoms/zone_undercity.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp index 79b49b6a438..ee22b766154 100644 --- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/westfall.cpp b/src/server/scripts/EasternKingdoms/zone_westfall.cpp index 16ba171928c..1b93cf1be71 100644 --- a/src/server/scripts/EasternKingdoms/westfall.cpp +++ b/src/server/scripts/EasternKingdoms/zone_westfall.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/EasternKingdoms/wetlands.cpp b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp index 98f7b0ac967..c8a1fc2b2b4 100644 --- a/src/server/scripts/EasternKingdoms/wetlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Events/CMakeLists.txt b/src/server/scripts/Events/CMakeLists.txt index 00bdaa9cb0c..8f40bbd75a9 100644 --- a/src/server/scripts/Events/CMakeLists.txt +++ b/src/server/scripts/Events/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # 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/Events/childrens_week.cpp b/src/server/scripts/Events/childrens_week.cpp index 28d033f9d48..26f83922f87 100644 --- a/src/server/scripts/Events/childrens_week.cpp +++ b/src/server/scripts/Events/childrens_week.cpp @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> -* -* 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 <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> + * + * 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 <http://www.gnu.org/licenses/>. + */ #include "ScriptMgr.h" #include "ScriptedCreature.h" @@ -150,7 +150,7 @@ class npc_winterfin_playmate : public CreatureScript struct npc_winterfin_playmateAI : public ScriptedAI { - npc_winterfin_playmateAI(Creature* creature) : ScriptedAI (creature) {} + npc_winterfin_playmateAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { @@ -167,7 +167,8 @@ class npc_winterfin_playmate : public CreatureScript if (player->GetQuestStatus(QUEST_PLAYMATE_ORACLE) == QUEST_STATUS_INCOMPLETE) { playerGUID = player->GetGUID(); - if ((orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE))) + orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE); + if (orphanGUID) phase = 1; } } @@ -247,7 +248,7 @@ class npc_snowfall_glade_playmate : public CreatureScript struct npc_snowfall_glade_playmateAI : public ScriptedAI { - npc_snowfall_glade_playmateAI(Creature* creature) : ScriptedAI (creature) {} + npc_snowfall_glade_playmateAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { @@ -264,7 +265,8 @@ class npc_snowfall_glade_playmate : public CreatureScript if (player->GetQuestStatus(QUEST_PLAYMATE_WOLVAR) == QUEST_STATUS_INCOMPLETE) { playerGUID = player->GetGUID(); - if ((orphanGUID = getOrphanGUID(player, ORPHAN_WOLVAR))) + orphanGUID = getOrphanGUID(player, ORPHAN_WOLVAR); + if (orphanGUID) phase = 1; } } @@ -343,7 +345,7 @@ class npc_the_biggest_tree : public CreatureScript struct npc_the_biggest_treeAI : public ScriptedAI { - npc_the_biggest_treeAI(Creature* creature) : ScriptedAI (creature) + npc_the_biggest_treeAI(Creature* creature) : ScriptedAI(creature) { me->SetDisplayId(DISPLAY_INVISIBLE); } @@ -363,7 +365,8 @@ class npc_the_biggest_tree : public CreatureScript if (player->GetQuestStatus(QUEST_THE_BIGGEST_TREE_EVER) == QUEST_STATUS_INCOMPLETE) { playerGUID = player->GetGUID(); - if ((orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE))) + orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE); + if (orphanGUID) phase = 1; } } @@ -431,7 +434,7 @@ class npc_high_oracle_soo_roo : public CreatureScript struct npc_high_oracle_soo_rooAI : public ScriptedAI { - npc_high_oracle_soo_rooAI(Creature* creature) : ScriptedAI (creature) {} + npc_high_oracle_soo_rooAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { @@ -448,7 +451,8 @@ class npc_high_oracle_soo_roo : public CreatureScript if (player->GetQuestStatus(QUEST_THE_BRONZE_DRAGONSHRINE_ORACLE) == QUEST_STATUS_INCOMPLETE) { playerGUID = player->GetGUID(); - if ((orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE))) + orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE); + if (orphanGUID) phase = 1; } } @@ -518,7 +522,7 @@ class npc_elder_kekek : public CreatureScript struct npc_elder_kekekAI : public ScriptedAI { - npc_elder_kekekAI(Creature* creature) : ScriptedAI (creature) {} + npc_elder_kekekAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { @@ -535,7 +539,8 @@ class npc_elder_kekek : public CreatureScript if (player->GetQuestStatus(QUEST_THE_BRONZE_DRAGONSHRINE_WOLVAR) == QUEST_STATUS_INCOMPLETE) { playerGUID = player->GetGUID(); - if ((orphanGUID = getOrphanGUID(player, ORPHAN_WOLVAR))) + orphanGUID = getOrphanGUID(player, ORPHAN_WOLVAR); + if (orphanGUID) phase = 1; } } @@ -605,7 +610,7 @@ class npc_the_etymidian : public CreatureScript struct npc_the_etymidianAI : public ScriptedAI { - npc_the_etymidianAI(Creature* creature) : ScriptedAI (creature) {} + npc_the_etymidianAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { @@ -622,7 +627,8 @@ class npc_the_etymidian : public CreatureScript if (player->GetQuestStatus(QUEST_MEETING_A_GREAT_ONE) == QUEST_STATUS_INCOMPLETE) { playerGUID = player->GetGUID(); - if ((orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE))) + orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE); + if (orphanGUID) phase = 1; } } @@ -700,7 +706,7 @@ class npc_alexstraza_the_lifebinder : public CreatureScript struct npc_alexstraza_the_lifebinderAI : public ScriptedAI { - npc_alexstraza_the_lifebinderAI(Creature* creature) : ScriptedAI (creature) {} + npc_alexstraza_the_lifebinderAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { @@ -734,15 +740,17 @@ class npc_alexstraza_the_lifebinder : public CreatureScript { if (player->GetQuestStatus(QUEST_THE_DRAGON_QUEEN_ORACLE) == QUEST_STATUS_INCOMPLETE) { - if ((orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE))) + playerGUID = player->GetGUID(); + orphanGUID = getOrphanGUID(player, ORPHAN_ORACLE); + if (orphanGUID) phase = 1; - playerGUID = player->GetGUID(); } else if (player->GetQuestStatus(QUEST_THE_DRAGON_QUEEN_WOLVAR) == QUEST_STATUS_INCOMPLETE) { - if ((orphanGUID = getOrphanGUID(player, ORPHAN_WOLVAR))) + playerGUID = player->GetGUID(); + orphanGUID = getOrphanGUID(player, ORPHAN_WOLVAR); + if (orphanGUID) phase = 7; - playerGUID = player->GetGUID(); } } } @@ -915,7 +923,7 @@ class npc_cw_area_trigger : public CreatureScript struct npc_cw_area_triggerAI : public ScriptedAI { - npc_cw_area_triggerAI(Creature* creature) : ScriptedAI (creature) + npc_cw_area_triggerAI(Creature* creature) : ScriptedAI(creature) { me->SetDisplayId(DISPLAY_INVISIBLE); } @@ -1011,7 +1019,7 @@ class npc_grizzlemaw_cw_trigger : public CreatureScript struct npc_grizzlemaw_cw_triggerAI : public ScriptedAI { - npc_grizzlemaw_cw_triggerAI(Creature* creature) : ScriptedAI (creature) + npc_grizzlemaw_cw_triggerAI(Creature* creature) : ScriptedAI(creature) { me->SetDisplayId(DISPLAY_INVISIBLE); } diff --git a/src/server/scripts/Examples/CMakeLists.txt b/src/server/scripts/Examples/CMakeLists.txt index dde6fe2c37c..f69182dd0f4 100644 --- a/src/server/scripts/Examples/CMakeLists.txt +++ b/src/server/scripts/Examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/Examples/example_commandscript.cpp b/src/server/scripts/Examples/example_commandscript.cpp index 28ef021d599..a87b8c5a555 100644 --- a/src/server/scripts/Examples/example_commandscript.cpp +++ b/src/server/scripts/Examples/example_commandscript.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Examples/example_creature.cpp b/src/server/scripts/Examples/example_creature.cpp index 0baa9814970..f82782448ea 100644 --- a/src/server/scripts/Examples/example_creature.cpp +++ b/src/server/scripts/Examples/example_creature.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Examples/example_escort.cpp b/src/server/scripts/Examples/example_escort.cpp index cd680b31577..a7906c4359a 100644 --- a/src/server/scripts/Examples/example_escort.cpp +++ b/src/server/scripts/Examples/example_escort.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Examples/example_gossip_codebox.cpp b/src/server/scripts/Examples/example_gossip_codebox.cpp index b6be4ce3ce1..1cfc1ef23ae 100644 --- a/src/server/scripts/Examples/example_gossip_codebox.cpp +++ b/src/server/scripts/Examples/example_gossip_codebox.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Examples/example_misc.cpp b/src/server/scripts/Examples/example_misc.cpp index 68986b44496..5f329e94a31 100644 --- a/src/server/scripts/Examples/example_misc.cpp +++ b/src/server/scripts/Examples/example_misc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Examples/example_spell.cpp b/src/server/scripts/Examples/example_spell.cpp index 35e61a5300d..97a4f364109 100644 --- a/src/server/scripts/Examples/example_spell.cpp +++ b/src/server/scripts/Examples/example_spell.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp index 959f8a3f690..27a442f302e 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -231,7 +231,7 @@ public: { npc_morriduneAI(Creature* creature) : npc_escortAI(creature) { - creature->AI()->Talk(SAY_MORRIDUNE_1); + Talk(SAY_MORRIDUNE_1); me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); Start(false, false, 0); } diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h index 21768b15895..0d926de79d8 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp index 7071395812e..e3fdc633382 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp index 1488772dc8a..ee87dfa3cf8 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp index 0a4779508e9..61f933d0893 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp index 8df5c5cdfd4..2d64553454d 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt index 7f63c521594..5c44cd7ef27 100644 --- a/src/server/scripts/Kalimdor/CMakeLists.txt +++ b/src/server/scripts/Kalimdor/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -10,9 +10,9 @@ set(scripts_STAT_SRCS ${scripts_STAT_SRCS} - Kalimdor/stonetalon_mountains.cpp - Kalimdor/silithus.cpp - Kalimdor/moonglade.cpp + Kalimdor/zone_stonetalon_mountains.cpp + Kalimdor/zone_silithus.cpp + Kalimdor/zone_moonglade.cpp Kalimdor/RazorfenDowns/razorfen_downs.cpp Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp @@ -58,10 +58,10 @@ set(scripts_STAT_SRCS Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp Kalimdor/BlackfathomDeeps/blackfathom_deeps.h - Kalimdor/azuremyst_isle.cpp - Kalimdor/orgrimmar.cpp - Kalimdor/desolace.cpp - Kalimdor/feralas.cpp + Kalimdor/zone_azuremyst_isle.cpp + Kalimdor/zone_orgrimmar.cpp + Kalimdor/zone_desolace.cpp + Kalimdor/zone_feralas.cpp Kalimdor/Maraudon/boss_princess_theradras.cpp Kalimdor/Maraudon/boss_landslide.cpp Kalimdor/Maraudon/boss_celebras_the_cursed.cpp @@ -78,7 +78,7 @@ set(scripts_STAT_SRCS Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp - Kalimdor/darkshore.cpp + Kalimdor/zone_darkshore.cpp Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp @@ -87,27 +87,27 @@ set(scripts_STAT_SRCS Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp - Kalimdor/mulgore.cpp - Kalimdor/bloodmyst_isle.cpp - Kalimdor/thunder_bluff.cpp - Kalimdor/azshara.cpp + Kalimdor/zone_mulgore.cpp + Kalimdor/zone_bloodmyst_isle.cpp + Kalimdor/zone_thunder_bluff.cpp + Kalimdor/zone_azshara.cpp Kalimdor/RazorfenKraul/razorfen_kraul.h Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp Kalimdor/RazorfenKraul/razorfen_kraul.cpp - Kalimdor/the_barrens.cpp - Kalimdor/ungoro_crater.cpp + Kalimdor/zone_the_barrens.cpp + Kalimdor/zone_ungoro_crater.cpp Kalimdor/WailingCaverns/wailing_caverns.h Kalimdor/WailingCaverns/instance_wailing_caverns.cpp Kalimdor/WailingCaverns/wailing_caverns.cpp - Kalimdor/durotar.cpp - Kalimdor/felwood.cpp + Kalimdor/zone_durotar.cpp + Kalimdor/zone_felwood.cpp Kalimdor/boss_azuregos.cpp - Kalimdor/tanaris.cpp - Kalimdor/dustwallow_marsh.cpp - Kalimdor/winterspring.cpp - Kalimdor/thousand_needles.cpp - Kalimdor/ashenvale.cpp - Kalimdor/teldrassil.cpp + Kalimdor/zone_tanaris.cpp + Kalimdor/zone_dustwallow_marsh.cpp + Kalimdor/zone_winterspring.cpp + Kalimdor/zone_thousand_needles.cpp + Kalimdor/zone_ashenvale.cpp + Kalimdor/zone_teldrassil.cpp Kalimdor/OnyxiasLair/boss_onyxia.cpp Kalimdor/OnyxiasLair/onyxias_lair.h Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index 222626240ea..075d54937c7 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index afd7603a506..e278b3009a0 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index bfdaed35dd4..180aeb0962d 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index 29eff68dfbd..2432be2c31a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index 09c8c1605b3..84ef05779ee 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -25,16 +25,16 @@ enum Spells SPELL_FROST_ARMOR = 31256, SPELL_DEATH_AND_DECAY = 31258, SPELL_FROST_NOVA = 31250, - SPELL_ICEBOLT = 31249, + SPELL_ICEBOLT = 31249 }; enum Texts { - SAY_ONDEATH = 0, - SAY_ONSLAY = 1, - SAY_DECAY = 2, - SAY_NOVA = 3, - SAY_ONAGGRO = 4, + SAY_ONDEATH = 0, + SAY_ONSLAY = 1, + SAY_DECAY = 2, + SAY_NOVA = 3, + SAY_ONAGGRO = 4 }; class boss_rage_winterchill : public CreatureScript diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp index 3ab06642fb5..5e7c52a8ff3 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h index 6d62072608d..0d23d1c700c 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 70c5bc8b986..aa17fcf6af4 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h index 5fe724c7845..0833dc2bf07 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index 01c1617aba4..36f6f94b324 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h index cb994167641..1a9a4394a3d 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp index df180bf5568..7854322b0c6 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp index 17cae714b58..fad5736e18f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp index 56d07a49dc4..8c2861db299 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -27,9 +27,9 @@ enum Spells enum Yells { - SAY_AGGRO = -1595045, - SAY_FAIL = -1595046, - SAY_DEATH = -1595047 + SAY_AGGRO = 0, + SAY_DEATH = 1, + SAY_FAIL = 2 }; class boss_infinite_corruptor : public CreatureScript @@ -59,11 +59,12 @@ public: void EnterCombat(Unit* /*who*/) { + Talk(SAY_AGGRO); if (instance) instance->SetData(DATA_INFINITE_EVENT, IN_PROGRESS); } - void UpdateAI(const uint32 /*diff*/) + void UpdateAI(uint32 const /*diff*/) { //Return since we have no target if (!UpdateVictim()) @@ -74,6 +75,7 @@ public: void JustDied(Unit* /*killer*/) { + Talk(SAY_DEATH); if (instance) instance->SetData(DATA_INFINITE_EVENT, DONE); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp index b07f4120e97..5aacaf736e0 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp index 05d9fe8b5e4..c7b819dd243 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp index 3a490301e47..d7d9beaedd4 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index 3329ecf88d2..d5d5416f093 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -43,7 +43,7 @@ enum Says SAY_PHASE201 = 10, SAY_PHASE203 = 11, SAY_PHASE205 = 12, - SAY_PHASE208 = 13, + SAY_PHASE208 = 13, SAY_PHASE209 = 14, SAY_PHASE210 = 15, @@ -96,7 +96,7 @@ enum Says SAY_PHASE117 = 1, //Cityman - SAY_PHASE202 = 0, + SAY_PHASE202 = 0, //Crazyman SAY_PHASE204 = 0, diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h index 86014940b91..bd6549d40be 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp index 0467109effc..109ff0f122b 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp index bcf48ccd7be..7643131edf7 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp index 244e22149fc..ea372621026 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp index 02a9f4742b3..6e78e4dae7b 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp index 03bebe35fd9..4c80bc017b7 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -59,7 +59,7 @@ enum MedivhBm SPELL_CORRUPT = 31326, SPELL_CORRUPT_AEONUS = 37853, - + C_COUNCIL_ENFORCER = 17023 }; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.h b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.h index dc208d8ab09..490ac4c2e50 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp index b7820bae920..9c17ed10d9c 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp index 3398395aca6..5e7fc6e66e8 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp index 00204300a51..ad3e6979dfb 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp index 22036899d64..65f496a579f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp index 5f7af55358e..b69b8b38945 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp index fe41ff521d8..4a4ba4f3ce2 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h index 2a7b4703f14..056187d202e 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp index b23d15cd1b5..222937621a8 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp index b4128ea80ee..c6c0387026c 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp index ece3ff83776..3fcd840077f 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp index 26e1f77bf48..eda5f125b00 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index c243682cc61..4724794d03b 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -42,7 +42,7 @@ enum Yells SAY_PHASE_3_TRANS = 3, // Emote - EMOTE_BREATH = 4, + EMOTE_BREATH = 4 }; enum Spells @@ -72,7 +72,7 @@ enum Spells //SPELL_BREATH = 21131, // 8x in "array", different initial cast than the other arrays // Phase 3 spells - SPELL_BELLOWING_ROAR = 18431, + SPELL_BELLOWING_ROAR = 18431 }; struct OnyxMove diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp index adcec659fa3..a779186a5c8 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h index 26fd9284ea2..91faf6dedb0 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h +++ b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp index b3690ab14c7..d272b3cc84c 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp index f7161638909..b7419d53db2 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp index 443c9f73cfb..b90d5a760d3 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h index fde1e7b277d..3b132561deb 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp index 152c38a6b58..e661ce42198 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp +++ b/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp index b0953c73e57..7cb78718e2a 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp +++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h index abc1afb58d8..eaf6ef69267 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h +++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp index d729764ae01..e72e6dff9cf 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -21,20 +21,22 @@ #include "ScriptedCreature.h" #include "ruins_of_ahnqiraj.h" -enum eAyamiss +enum Spells { SPELL_STINGERSPRAY = 25749, - SPELL_POISONSTINGER = 25748, //only used in phase1 + SPELL_POISONSTINGER = 25748, // Only used in phase 1 SPELL_PARALYZE = 25725, SPELL_TRASH = 3391, - SPELL_FRENZY = 8269, + SPELL_FRENZY = 8269, // Not used SPELL_LASH = 25852, - - EMOTE_FRENZY = -1000002, - SPELL_FEED = 25721, }; +enum Says +{ + EMOTE_FRENZY = 0 // Not used +}; + class boss_ayamiss : public CreatureScript { public: diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp index 40d4d5d54b4..e26cba9cb6e 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -16,20 +16,48 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Buru -SD%Complete: 0 -SDComment: Place Holder -SDCategory: Ruins of Ahn'Qiraj -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" #include "ruins_of_ahnqiraj.h" -enum Yells +enum Emotes +{ + EMOTE_TARGET = 0 +}; + +enum Spells +{ + SPELL_CREEPING_PLAGUE = 20512, + SPELL_DISMEMBER = 96, + SPELL_GATHERING_SPEED = 1834, + SPELL_FULL_SPEED = 1557, + SPELL_THORNS = 25640, + SPELL_BURU_TRANSFORM = 24721, + SPELL_SUMMON_HATCHLING = 1881, + SPELL_EXPLODE = 19593, + SPELL_EXPLODE_2 = 5255, + SPELL_BURU_EGG_TRIGGER = 26646 +}; + +enum Events +{ + EVENT_DISMEMBER = 0, + EVENT_GATHERING_SPEED = 1, + EVENT_FULL_SPEED = 2, + EVENT_CREEPING_PLAGUE = 3, + EVENT_RESPAWN_EGG = 4 +}; + +enum Phases { - EMOTE_TARGET = -1509002 + PHASE_EGG = 0, + PHASE_TRANSFORM = 1 +}; + +enum Actions +{ + ACTION_EXPLODE = 0 }; class boss_buru : public CreatureScript @@ -37,11 +65,125 @@ class boss_buru : public CreatureScript public: boss_buru() : CreatureScript("boss_buru") { } - struct boss_buruAI : public ScriptedAI + struct boss_buruAI : public BossAI { - boss_buruAI(Creature* creature) : ScriptedAI(creature) + boss_buruAI(Creature* creature) : BossAI(creature, DATA_BURU) + { + } + + void EnterEvadeMode() + { + BossAI::EnterEvadeMode(); + + for (std::list<uint64>::iterator i = Eggs.begin(); i != Eggs.end(); ++i) + if (Creature* egg = me->GetMap()->GetCreature(*Eggs.begin())) + egg->Respawn(); + + Eggs.clear(); + } + + void EnterCombat(Unit* who) + { + _EnterCombat(); + Talk(EMOTE_TARGET, who->GetGUID()); + DoCast(me, SPELL_THORNS); + + events.ScheduleEvent(EVENT_DISMEMBER, 5000); + events.ScheduleEvent(EVENT_GATHERING_SPEED, 9000); + events.ScheduleEvent(EVENT_FULL_SPEED, 60000); + + _phase = PHASE_EGG; + } + + void DoAction(int32 const action) + { + if (action == ACTION_EXPLODE) + if (_phase == PHASE_EGG) + me->DealDamage(me, 45000); + } + + void KilledUnit(Unit* victim) + { + if (victim->GetTypeId() == TYPEID_PLAYER) + ChaseNewVictim(); + } + + void ChaseNewVictim() { + if (_phase != PHASE_EGG) + return; + + me->RemoveAurasDueToSpell(SPELL_FULL_SPEED); + me->RemoveAurasDueToSpell(SPELL_GATHERING_SPEED); + events.ScheduleEvent(EVENT_GATHERING_SPEED, 9000); + events.ScheduleEvent(EVENT_FULL_SPEED, 60000); + + if (Unit* victim = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) + { + DoResetThreat(); + AttackStart(victim); + Talk(EMOTE_TARGET, victim->GetGUID()); + } } + + void ManageRespawn(uint64 EggGUID) + { + ChaseNewVictim(); + Eggs.push_back(EggGUID); + events.ScheduleEvent(EVENT_RESPAWN_EGG, 100000); + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_DISMEMBER: + DoCastVictim(SPELL_DISMEMBER); + events.ScheduleEvent(EVENT_DISMEMBER, 5000); + break; + case EVENT_GATHERING_SPEED: + DoCast(me, SPELL_GATHERING_SPEED); + events.ScheduleEvent(EVENT_GATHERING_SPEED, 9000); + break; + case EVENT_FULL_SPEED: + DoCast(me, SPELL_FULL_SPEED); + break; + case EVENT_CREEPING_PLAGUE: + DoCast(me, SPELL_CREEPING_PLAGUE); + events.ScheduleEvent(EVENT_CREEPING_PLAGUE, 6000); + break; + case EVENT_RESPAWN_EGG: + if (Creature* egg = me->GetMap()->GetCreature(*Eggs.begin())) + { + egg->Respawn(); + Eggs.pop_front(); + } + break; + default: + break; + } + } + + if (me->GetHealthPct() < 20.0f && _phase == PHASE_EGG) + { + DoCast(me, SPELL_BURU_TRANSFORM); // Enrage + DoCast(me, SPELL_FULL_SPEED, true); + me->RemoveAurasDueToSpell(SPELL_THORNS); + _phase = PHASE_TRANSFORM; + } + + DoMeleeAttackIfReady(); + } + private: + uint8 _phase; + std::list<uint64> Eggs; }; CreatureAI* GetAI(Creature* creature) const @@ -50,7 +192,90 @@ class boss_buru : public CreatureScript } }; +class npc_buru_egg : public CreatureScript +{ + public: + npc_buru_egg() : CreatureScript("npc_buru_egg") { } + + struct npc_buru_eggAI : public Scripted_NoMovementAI + { + npc_buru_eggAI(Creature* creature) : Scripted_NoMovementAI(creature) + { + _instance = me->GetInstanceScript(); + } + + void EnterCombat(Unit* attacker) + { + if (Creature* buru = me->GetMap()->GetCreature(_instance->GetData64(DATA_BURU))) + if (!buru->isInCombat()) + buru->AI()->AttackStart(attacker); + } + + void JustSummoned(Creature* who) + { + if (who->GetEntry() == NPC_HATCHLING) + if (Creature* buru = me->GetMap()->GetCreature(_instance->GetData64(DATA_BURU))) + if (Unit* target = buru->AI()->SelectTarget(SELECT_TARGET_RANDOM)) + who->AI()->AttackStart(target); + } + + void JustDied(Unit* /*killer*/) + { + DoCastAOE(SPELL_EXPLODE, true); + DoCastAOE(SPELL_EXPLODE_2, true); // Unknown purpose + DoCast(me, SPELL_SUMMON_HATCHLING, true); + + if (Creature* buru = me->GetMap()->GetCreature(_instance->GetData64(DATA_BURU))) + if (boss_buru::boss_buruAI* buruAI = dynamic_cast<boss_buru::boss_buruAI*>(buru->AI())) + buruAI->ManageRespawn(me->GetGUID()); + } + private: + InstanceScript* _instance; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_buru_eggAI(creature); + } +}; + +class spell_egg_explosion : public SpellScriptLoader +{ + public: + spell_egg_explosion() : SpellScriptLoader("spell_egg_explosion") { } + + class spell_egg_explosion_SpellScript : public SpellScript + { + PrepareSpellScript(spell_egg_explosion_SpellScript); + + void HandleAfterCast() + { + if (Creature* buru = GetCaster()->FindNearestCreature(NPC_BURU, 5.f)) + buru->AI()->DoAction(ACTION_EXPLODE); + } + + void HandleDummyHitTarget(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + GetCaster()->DealDamage(target, -16 * GetCaster()->GetDistance(target) + 500); + } + + void Register() + { + AfterCast += SpellCastFn(spell_egg_explosion_SpellScript::HandleAfterCast); + OnEffectHitTarget += SpellEffectFn(spell_egg_explosion_SpellScript::HandleDummyHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_egg_explosion_SpellScript(); + } +}; + void AddSC_boss_buru() { new boss_buru(); + new npc_buru_egg(); + new spell_egg_explosion(); } diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp index e6c5243819a..ddb9017f3dd 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp index 4abbf99d4ef..70db1213394 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -21,8 +21,8 @@ enum Texts { - EMOTE_AGGRO = -1509000, - EMOTE_MANA_FULL = -1509001 + EMOTE_AGGRO = 0, + EMOTE_MANA_FULL = 1 }; enum Spells diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp index 2bbdaa389ad..fcb6364244e 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -29,7 +29,7 @@ enum Texts SAY_INTRO = 1, SAY_AGGRO = 2, SAY_SLAY = 3, - SAY_DEATH = 4, + SAY_DEATH = 4 }; enum Spells @@ -40,12 +40,12 @@ enum Spells SPELL_SUPREME = 25176, SPELL_SUMMON = 20477, SPELL_SAND_STORM = 25160, - SPELL_SUMMON_CRYSTAL = 25192, + SPELL_SUMMON_CRYSTAL = 25192 }; enum Actions { - ACTION_TRIGGER_WEAKNESS = 1, + ACTION_TRIGGER_WEAKNESS = 1 }; enum Events @@ -199,7 +199,7 @@ class boss_ossirian : public CreatureScript CrystalCoordinates[CrystalIterator].GetPositionX(), CrystalCoordinates[CrystalIterator].GetPositionY(), CrystalCoordinates[CrystalIterator].GetPositionZ(), - 0, 0, 0, 0, 0, -1)) + 0, 0, 0, 0, 0, uint32(-1))) { CrystalGUID = Crystal->GetGUID(); ++CrystalIterator; diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp index da67f93f968..dae447e43d2 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -23,22 +23,22 @@ enum Yells { // The time of our retribution is at hand! Let darkness reign in the hearts of our enemies! Sound: 8645 Emote: 35 - SAY_ANDOROV_INTRO = -1509003, // Before for the first wave - SAY_ANDOROV_ATTACK = -1509004, // Beginning the event - SAY_ANDOROV_WAVE_1 = -1509001, // When the first wave comes text: Kill first, ask questions later... Incoming! emote: 45 sound: 8653 - SAY_WAVE3 = -1509005, - SAY_WAVE4 = -1509006, - SAY_WAVE5 = -1509007, - SAY_WAVE6 = -1509008, - SAY_WAVE7 = -1509009, - SAY_INTRO = -1509010, - SAY_UNK1 = -1509011, - SAY_UNK2 = -1509012, - SAY_UNK3 = -1509013, - SAY_DEATH = -1509014, - SAY_CHANGEAGGRO = -1509015, - SAY_KILLS_ANDOROV = -1509016, - SAY_COMPLETE_QUEST = -1509017 // Yell when realm complete quest 8743 for world event + SAY_ANDOROV_INTRO = 0, // Before for the first wave + SAY_ANDOROV_ATTACK = 1, // Beginning the event + + SAY_WAVE3 = 0, + SAY_WAVE4 = 1, + SAY_WAVE5 = 2, + SAY_WAVE6 = 3, + SAY_WAVE7 = 4, + SAY_INTRO = 5, + SAY_UNK1 = 6, + SAY_UNK2 = 7, + SAY_UNK3 = 8, + SAY_DEATH = 9, + SAY_CHANGEAGGRO = 10, + SAY_KILLS_ANDOROV = 11, + SAY_COMPLETE_QUEST = 12 // Yell when realm complete quest 8743 for world event // Warriors, Captains, continue the fight! Sound: 8640 }; diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp index d61d9416ac6..6dbeaed9e5d 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h index 7f7efc83eb5..6ece21f627b 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -42,6 +42,7 @@ enum Creatures NPC_HIVEZARA_LARVA = 15555, NPC_SAND_VORTEX = 15428, NPC_OSSIRIAN_TRIGGER = 15590, + NPC_HATCHLING = 15521 }; enum GameObjects diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index 0b78b5f9ab2..2a9ea4ba4fc 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index 1cb69689b67..3da1fc1dc5c 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -58,8 +58,6 @@ EndScriptData */ * - the current phase is stored in the instance data to be easily shared between the eye and cthun. */ -#define PI 3.14 - enum Phases { PHASE_NOT_STARTED = 0, @@ -76,24 +74,6 @@ enum Phases PHASE_CTHUN_DONE = 6, }; -enum Creatures -{ - MOB_CTHUN_PORTAL = 15896, - - // ***** Main Phase 1 ******** - BOSS_EYE_OF_CTHUN = 15589, - MOB_CLAW_TENTACLE = 15725, - MOB_EYE_TENTACLE = 15726, - MOB_SMALL_PORTAL = 15904, - - // ***** Main Phase 2 ******** - MOB_BODY_OF_CTHUN = 15809, - MOB_GIANT_CLAW_TENTACLE = 15728, - MOB_GIANT_EYE_TENTACLE = 15334, - MOB_FLESH_TENTACLE = 15802, - MOB_GIANT_PORTAL = 15910, -}; - enum Spells { // ***** Main Phase 1 ******** diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp index 5ebce2f04e2..80fdc111911 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp index ab4968e3bf7..5493e9d76b0 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index f7acf28dba3..53242d4cdc6 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -27,12 +27,14 @@ EndScriptData */ #include "ScriptedCreature.h" #include "temple_of_ahnqiraj.h" -#define SPELL_SWEEP 26103 -#define SPELL_SANDBLAST 26102 -#define SPELL_GROUND_RUPTURE 26100 -#define SPELL_BIRTH 26262 //The Birth Animation - -#define SPELL_DIRTMOUND_PASSIVE 26092 +enum Spells +{ + SPELL_SWEEP = 26103, + SPELL_SANDBLAST = 26102, + SPELL_GROUND_RUPTURE = 26100, + SPELL_BIRTH = 26262, // The Birth Animation + SPELL_DIRTMOUND_PASSIVE = 26092 +}; class boss_ouro : public CreatureScript { diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp index 2ac9358b976..3915a7655c5 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index 4ebdc408963..1186459218c 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -16,287 +16,226 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Skeram -SD%Complete: 75 -SDComment: Mind Control buggy. -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" #include "temple_of_ahnqiraj.h" -#include "Group.h" -#include "Player.h" -enum Skeram +enum Yells { SAY_AGGRO = 0, SAY_SLAY = 1, SAY_SPLIT = 2, - SAY_DEATH = 3, - - SPELL_ARCANE_EXPLOSION = 25679, + SAY_DEATH = 3 +}; + +enum Spells +{ + SPELL_ARCANE_EXPLOSION = 26192, SPELL_EARTH_SHOCK = 26194, SPELL_TRUE_FULFILLMENT = 785, - SPELL_BLINK = 28391 + SPELL_INITIALIZE_IMAGE = 3730, + SPELL_SUMMON_IMAGES = 747 }; -class ov_mycoordinates +enum Events { - public: - float x, y, z, r; - ov_mycoordinates(float cx, float cy, float cz, float cr) - { - x = cx; y = cy; z = cz; r = cr; - } + EVENT_ARCANE_EXPLOSION = 0, + EVENT_FULLFILMENT = 1, + EVENT_BLINK = 2, + EVENT_EARTH_SHOCK = 3 }; +uint32 const BlinkSpells[3] = { 4801, 8195, 20449 }; + class boss_skeram : public CreatureScript { -public: - boss_skeram() : CreatureScript("boss_skeram") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_skeramAI (creature); - } - - struct boss_skeramAI : public ScriptedAI - { - boss_skeramAI(Creature* creature) : ScriptedAI(creature) - { - IsImage = false; - } - - uint32 ArcaneExplosion_Timer; - uint32 EarthShock_Timer; - uint32 FullFillment_Timer; - uint32 Blink_Timer; - uint32 Invisible_Timer; - - bool Images75; - bool Images50; - bool Images25; - bool IsImage; - bool Invisible; - - void Reset() - { - ArcaneExplosion_Timer = urand(6000, 12000); - EarthShock_Timer = 2000; - FullFillment_Timer = 15000; - Blink_Timer = urand(8000, 20000); - Invisible_Timer = 500; - - Images75 = false; - Images50 = false; - Images25 = false; - Invisible = false; - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetVisible(true); - - if (IsImage) - me->setDeathState(JUST_DIED); - } - - void KilledUnit(Unit* /*victim*/) - { - Talk(SAY_SLAY); - } - - void JustDied(Unit* /*killer*/) - { - if (!IsImage) - Talk(SAY_DEATH); - } - - void EnterCombat(Unit* /*who*/) - { - if (IsImage || Images75) - return; - Talk(SAY_AGGRO); - } + public: + boss_skeram() : CreatureScript("boss_skeram") { } - void UpdateAI(const uint32 diff) + struct boss_skeramAI : public BossAI { - //Return since we have no target - if (!UpdateVictim()) - return; + boss_skeramAI(Creature* creature) : BossAI(creature, DATA_SKERAM) { } - //ArcaneExplosion_Timer - if (ArcaneExplosion_Timer <= diff) + void Reset() { - DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION); - ArcaneExplosion_Timer = urand(8000, 18000); - } else ArcaneExplosion_Timer -= diff; + _flag = 0; + _hpct = 75.0f; + me->SetVisible(true); + } - //If we are within range melee the target - if (me->IsWithinMeleeRange(me->getVictim())) + void KilledUnit(Unit* /*victim*/) { - //Make sure our attack is ready and we arn't currently casting - if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false)) - { - me->AttackerStateUpdate(me->getVictim()); - me->resetAttackTimer(); - } - }else + Talk(SAY_SLAY); + } + + void EnterEvadeMode() { - //EarthShock_Timer - if (EarthShock_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_EARTH_SHOCK); - EarthShock_Timer = 1000; - } else EarthShock_Timer -= diff; + ScriptedAI::EnterEvadeMode(); + if (me->isSummon()) + ((TempSummon*)me)->UnSummon(); } - //Blink_Timer - if (Blink_Timer <= diff) + void JustSummoned(Creature* creature) { - //DoCast(me, SPELL_BLINK); - switch (urand(0, 2)) + // Shift the boss and images (Get it? *Shift*?) + uint8 rand = 0; + if (_flag != 0) { - case 0: - me->SetPosition(-8340.782227f, 2083.814453f, 125.648788f, 0.0f); - DoResetThreat(); - break; - case 1: - me->SetPosition(-8341.546875f, 2118.504639f, 133.058151f, 0.0f); - DoResetThreat(); - break; - case 2: - me->SetPosition(-8318.822266f, 2058.231201f, 133.058151f, 0.0f); - DoResetThreat(); - break; + while (_flag & (1 << rand)) + rand = urand(0, 2); + DoCast(me, BlinkSpells[rand]); + _flag |= (1 << rand); + _flag |= (1 << 7); } - DoStopAttack(); - Blink_Timer= urand(20000, 40000); - } else Blink_Timer -= diff; - - int procent = (int) (me->GetHealthPct() + 0.5f); - - //Summoning 2 Images and teleporting to a random position on 75% health - if ((!Images75 && !IsImage) && (procent <= 75 && procent > 70)) - DoSplit(75); - - //Summoning 2 Images and teleporting to a random position on 50% health - if ((!Images50 && !IsImage) && (procent <= 50 && procent > 45)) - DoSplit(50); - - //Summoning 2 Images and teleporting to a random position on 25% health - if ((!Images25 && !IsImage) && (procent <= 25 && procent > 20)) - DoSplit(25); + while (_flag & (1 << rand)) + rand = urand(0, 2); + creature->CastSpell(creature, BlinkSpells[rand]); + _flag |= (1 << rand); + + if (_flag & (1 << 7)) + _flag = 0; + + if (Unit* Target = SelectTarget(SELECT_TARGET_RANDOM)) + creature->AI()->AttackStart(Target); + + float ImageHealthPct; + + if (me->GetHealthPct() < 25.0f) + ImageHealthPct = 0.50f; + else if (me->GetHealthPct() < 50.0f) + ImageHealthPct = 0.20f; + else + ImageHealthPct = 0.10f; + + creature->SetMaxHealth(me->GetMaxHealth() * ImageHealthPct); + creature->SetHealth(creature->GetMaxHealth() * (me->GetHealthPct() / 100.0f)); + } - //Invisible_Timer - if (Invisible) + void JustDied(Unit* /*killer*/) { - if (Invisible_Timer <= diff) - { - //Making Skeram visible after telporting - me->SetVisible(true); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - Invisible_Timer = 2500; - Invisible = false; - } else Invisible_Timer -= diff; + if (!me->isSummon()) + Talk(SAY_DEATH); + else + me->RemoveCorpse(); } - DoMeleeAttackIfReady(); - } - - void DoSplit(int atPercent /* 75 50 25 */) - { - Talk(SAY_SPLIT); - - ov_mycoordinates *place1 = new ov_mycoordinates(-8340.782227f, 2083.814453f, 125.648788f, 0); - ov_mycoordinates *place2 = new ov_mycoordinates(-8341.546875f, 2118.504639f, 133.058151f, 0); - ov_mycoordinates *place3 = new ov_mycoordinates(-8318.822266f, 2058.231201f, 133.058151f, 0); + void EnterCombat(Unit* /*who*/) + { + _EnterCombat(); + events.Reset(); - ov_mycoordinates *bossc=place1, *i1=place2, *i2=place3; + events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(6000, 12000)); + events.ScheduleEvent(EVENT_FULLFILMENT, 15000); + events.ScheduleEvent(EVENT_BLINK, urand(30000, 45000)); + events.ScheduleEvent(EVENT_EARTH_SHOCK, 2000); - switch (urand(0, 2)) - { - case 0: - bossc=place1; - i1=place2; - i2=place3; - break; - case 1: - bossc=place2; - i1=place1; - i2=place3; - break; - case 2: - bossc=place3; - i1=place1; - i2=place2; - break; + Talk(SAY_AGGRO); } - for (uint16 i = 0; i < 41; ++i) + void UpdateAI(uint32 const diff) { - if (Player* target = CAST_PLR(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))) + if (!UpdateVictim()) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) { - if (Group* pGrp = target->GetGroup()) - for (uint8 ico = 0; ico < TARGETICONCOUNT; ++ico) - { - //if (grp->m_targetIcons[ico] == me->GetGUID()) -- private member :( - pGrp->SetTargetIcon(ico, 0, 0); - } + switch (eventId) + { + case EVENT_ARCANE_EXPLOSION: + DoCastAOE(SPELL_ARCANE_EXPLOSION, true); + events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(8000, 18000)); + break; + case EVENT_FULLFILMENT: + // TODO: For some weird reason boss does not cast this + // Spell actually works, tested in duel + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true), SPELL_TRUE_FULFILLMENT, true); + events.ScheduleEvent(EVENT_FULLFILMENT, urand(20000, 30000)); + break; + case EVENT_BLINK: + DoCast(me, BlinkSpells[urand(0, 2)]); + DoResetThreat(); + me->SetVisible(true); + events.ScheduleEvent(EVENT_BLINK, urand(10000, 30000)); + break; + case EVENT_EARTH_SHOCK: + DoCastVictim(SPELL_EARTH_SHOCK); + events.ScheduleEvent(EVENT_EARTH_SHOCK, 2000); + break; + } + } - break; + if (!me->isSummon() && me->GetHealthPct() < _hpct) + { + DoCast(me, SPELL_SUMMON_IMAGES); + Talk(SAY_SPLIT); + _hpct -= 25.0f; + me->SetVisible(false); + events.RescheduleEvent(EVENT_BLINK, 2000); + } + + if (me->IsWithinMeleeRange(me->getVictim())) + { + events.RescheduleEvent(EVENT_EARTH_SHOCK, 2000); + DoMeleeAttackIfReady(); } } + + private: + float _hpct; + uint8 _flag; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_skeramAI(creature); + } +}; - me->RemoveAllAuras(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetVisible(false); - me->SetPosition(bossc->x, bossc->y, bossc->z, bossc->r); - Invisible = true; - DoResetThreat(); - DoStopAttack(); +class PlayerOrPetCheck +{ + public: + bool operator()(WorldObject* object) const + { + if (object->GetTypeId() != TYPEID_PLAYER) + if (!object->ToCreature()->isPet()) + return true; - switch (atPercent) - { - case 75: Images75 = true; break; - case 50: Images50 = true; break; - case 25: Images25 = true; break; - } + return false; + } +}; + +class spell_skeram_arcane_explosion : public SpellScriptLoader +{ + public: + spell_skeram_arcane_explosion() : SpellScriptLoader("spell_skeram_arcane_explosion") { } - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); + class spell_skeram_arcane_explosion_SpellScript : public SpellScript + { + PrepareSpellScript(spell_skeram_arcane_explosion_SpellScript); - Creature* Image1 = me->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); - if (Image1) + void FilterTargets(std::list<WorldObject*>& targets) { - Image1->SetMaxHealth(me->GetMaxHealth() / 5); - Image1->SetHealth(me->GetHealth() / 5); - if (target) - Image1->AI()->AttackStart(target); - CAST_AI(boss_skeram::boss_skeramAI, Image1->AI())->IsImage = true; + targets.remove_if(PlayerOrPetCheck()); } - Creature* Image2 = me->SummonCreature(15263, i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); - if (Image2) + void Register() { - Image2->SetMaxHealth(me->GetMaxHealth() / 5); - Image2->SetHealth(me->GetHealth() / 5); - if (target) - Image2->AI()->AttackStart(target); - CAST_AI(boss_skeram::boss_skeramAI, Image2->AI())->IsImage = true; + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_skeram_arcane_explosion_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } - Invisible = true; - delete place1; - delete place2; - delete place3; - } - - }; + }; + SpellScript* GetSpellScript() const + { + return new spell_skeram_arcane_explosion_SpellScript(); + } }; void AddSC_boss_skeram() { new boss_skeram(); + new spell_skeram_arcane_explosion(); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index b85999042dd..d623963e929 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -27,38 +27,43 @@ EndScriptData */ #include "ScriptedCreature.h" #include "temple_of_ahnqiraj.h" #include "WorldPacket.h" - #include "Item.h" #include "Spell.h" -#define SPELL_HEAL_BROTHER 7393 -#define SPELL_TWIN_TELEPORT 800 // CTRA watches for this spell to start its teleport timer -#define SPELL_TWIN_TELEPORT_VISUAL 26638 // visual - -#define SPELL_EXPLODEBUG 804 -#define SPELL_MUTATE_BUG 802 - -#define SOUND_VN_DEATH 8660 //8660 - Death - Feel -#define SOUND_VN_AGGRO 8661 //8661 - Aggro - Let none -#define SOUND_VN_KILL 8662 //8661 - Kill - your fate - -#define SOUND_VL_AGGRO 8657 //8657 - Aggro - To Late -#define SOUND_VL_KILL 8658 //8658 - Kill - You will not -#define SOUND_VL_DEATH 8659 //8659 - Death +enum Spells +{ + SPELL_HEAL_BROTHER = 7393, + SPELL_TWIN_TELEPORT = 800, // CTRA watches for this spell to start its teleport timer + SPELL_TWIN_TELEPORT_VISUAL = 26638, // visual + SPELL_EXPLODEBUG = 804, + SPELL_MUTATE_BUG = 802, + SPELL_BERSERK = 26662, + SPELL_UPPERCUT = 26007, + SPELL_UNBALANCING_STRIKE = 26613, + SPELL_SHADOWBOLT = 26006, + SPELL_BLIZZARD = 26607, + SPELL_ARCANEBURST = 568, +}; -#define PULL_RANGE 50 -#define ABUSE_BUG_RANGE 20 -#define SPELL_BERSERK 26662 -#define TELEPORTTIME 30000 +enum Sound +{ + SOUND_VL_AGGRO = 8657, //8657 - Aggro - To Late + SOUND_VL_KILL = 8658, //8658 - Kill - You will not + SOUND_VL_DEATH = 8659, //8659 - Death + SOUND_VN_DEATH = 8660, //8660 - Death - Feel + SOUND_VN_AGGRO = 8661, //8661 - Aggro - Let none + SOUND_VN_KILL = 8662, //8661 - Kill - your fate +}; -#define SPELL_UPPERCUT 26007 -#define SPELL_UNBALANCING_STRIKE 26613 +enum Misc +{ + PULL_RANGE = 50, + ABUSE_BUG_RANGE = 20, + VEKLOR_DIST = 20, // VL will not come to melee when attacking + TELEPORTTIME = 30000 +}; -#define VEKLOR_DIST 20 // VL will not come to melee when attacking -#define SPELL_SHADOWBOLT 26006 -#define SPELL_BLIZZARD 26607 -#define SPELL_ARCANEBURST 568 struct boss_twinemperorsAI : public ScriptedAI { diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp index d0e97bc36c8..fcbe3a84d62 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp @@ -1,6 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,18 +15,293 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Viscidus -SD%Complete: 0 -SDComment: place holder -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellInfo.h" +#include "temple_of_ahnqiraj.h" + +enum Spells +{ + SPELL_POISON_SHOCK = 25993, + SPELL_POISONBOLT_VOLLEY = 25991, + SPELL_TOXIN = 26575, + SPELL_VISCIDUS_SLOWED = 26034, + SPELL_VISCIDUS_SLOWED_MORE = 26036, + SPELL_VISCIDUS_FREEZE = 25937, + SPELL_REJOIN_VISCIDUS = 25896, + SPELL_VISCIDUS_EXPLODE = 25938, + SPELL_VISCIDUS_SUICIDE = 26003, + SPELL_VISCIDUS_SHRINKS = 25893, // Removed from client, in world.spell_dbc + + SPELL_MEMBRANE_VISCIDUS = 25994, // damage reduction spell - removed from DBC + SPELL_VISCIDUS_WEAKNESS = 25926, // aura which procs at damage - should trigger the slow spells - removed from DBC + SPELL_VISCIDUS_GROWS = 25897, // removed from DBC + SPELL_SUMMON_GLOBS = 25885, // summons npc 15667 using spells from 25865 to 25884; All spells have target coords - removed from DBC + SPELL_VISCIDUS_TELEPORT = 25904, // removed from DBC +}; + +enum Events +{ + EVENT_POISONBOLT_VOLLEY = 1, + EVENT_POISON_SHOCK = 2, + EVENT_RESET_PHASE = 3 +}; + +enum Phases +{ + PHASE_FROST = 1, + PHASE_MELEE = 2, + PHASE_GLOB = 3 +}; + +enum Emotes +{ + EMOTE_SLOW = 0, + EMOTE_FREEZE = 1, + EMOTE_FROZEN = 2, + + EMOTE_CRACK = 3, + EMOTE_SHATTER = 4, + EMOTE_EXPLODE = 5 +}; + +enum HitCounter +{ + HITCOUNTER_SLOW = 100, + HITCOUNTER_SLOW_MORE = 150, + HITCOUNTER_FREEZE = 200, + + HITCOUNTER_CRACK = 50, + HITCOUNTER_SHATTER = 100, + HITCOUNTER_EXPLODE = 150, +}; + +enum MovePoints +{ + ROOM_CENTER = 1 +}; + +Position const ViscidusCoord = { -7992.36f, 908.19f, -52.62f, 1.68f }; // TODO: Visci isn't in room middle +float const RoomRadius = 40.0f; // TODO: Not sure if its correct + +class boss_viscidus : public CreatureScript +{ + public: + boss_viscidus() : CreatureScript("boss_viscidus") { } + + struct boss_viscidusAI : public BossAI + { + boss_viscidusAI(Creature* creature) : BossAI(creature, DATA_VISCIDUS) { } + + void Reset() + { + _Reset(); + _hitcounter = 0; + _phase = PHASE_FROST; + } + + void DamageTaken(Unit* attacker, uint32& /*damage*/) + { + if (_phase != PHASE_MELEE) + return; + + ++_hitcounter; + + if (attacker->HasUnitState(UNIT_STATE_MELEE_ATTACKING) && _hitcounter >= HITCOUNTER_EXPLODE) + { + Talk(EMOTE_EXPLODE); + events.Reset(); + _phase = PHASE_GLOB; + DoCast(me, SPELL_VISCIDUS_EXPLODE); + me->SetVisible(false); + me->RemoveAura(SPELL_TOXIN); + me->RemoveAura(SPELL_VISCIDUS_FREEZE); + + uint8 NumGlobes = me->GetHealthPct() / 5.0f; + for (uint8 i = 0; i < NumGlobes; ++i) + { + float Angle = i * 2 * M_PI / NumGlobes; + float X = ViscidusCoord.GetPositionX() + std::cos(Angle) * RoomRadius; + float Y = ViscidusCoord.GetPositionY() + std::sin(Angle) * RoomRadius; + float Z = -35.0f; + + if (TempSummon* Glob = me->SummonCreature(NPC_GLOB_OF_VISCIDUS, X, Y, Z)) + { + Glob->UpdateAllowedPositionZ(X, Y, Z); + Glob->NearTeleportTo(X, Y, Z, 0.0f); + Glob->GetMotionMaster()->MovePoint(ROOM_CENTER, ViscidusCoord); + } + } + } + else if (_hitcounter == HITCOUNTER_SHATTER) + Talk(EMOTE_SHATTER); + else if (_hitcounter == HITCOUNTER_CRACK) + Talk(EMOTE_CRACK); + } + + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) + { + if ((spell->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) && _phase == PHASE_FROST && me->GetHealthPct() > 5.0f) + { + ++_hitcounter; + + if (_hitcounter >= HITCOUNTER_FREEZE) + { + _hitcounter = 0; + Talk(EMOTE_FROZEN); + _phase = PHASE_MELEE; + DoCast(me, SPELL_VISCIDUS_FREEZE); + me->RemoveAura(SPELL_VISCIDUS_SLOWED_MORE); + events.ScheduleEvent(EVENT_RESET_PHASE, 15000); + } + else if (_hitcounter >= HITCOUNTER_SLOW_MORE) + { + Talk(EMOTE_FREEZE); + me->RemoveAura(SPELL_VISCIDUS_SLOWED); + DoCast(me, SPELL_VISCIDUS_SLOWED_MORE); + } + else if (_hitcounter >= HITCOUNTER_SLOW) + { + Talk(EMOTE_SLOW); + DoCast(me, SPELL_VISCIDUS_SLOWED); + } + } + } + + void EnterCombat(Unit* /*who*/) + { + _EnterCombat(); + events.Reset(); + InitSpells(); + } + + void InitSpells() + { + DoCast(me, SPELL_TOXIN); + events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, urand(10000, 15000)); + events.ScheduleEvent(EVENT_POISON_SHOCK, urand(7000, 12000)); + } + + void EnterEvadeMode() + { + summons.DespawnAll(); + ScriptedAI::EnterEvadeMode(); + } + + void JustDied(Unit* /*killer*/) + { + DoCast(me, SPELL_VISCIDUS_SUICIDE); + summons.DespawnAll(); + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + if (_phase == PHASE_GLOB && summons.empty()) + { + DoResetThreat(); + me->NearTeleportTo(ViscidusCoord.GetPositionX(), + ViscidusCoord.GetPositionY(), + ViscidusCoord.GetPositionZ(), + ViscidusCoord.GetOrientation()); + + _hitcounter = 0; + _phase = PHASE_FROST; + InitSpells(); + me->SetVisible(true); + } + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_POISONBOLT_VOLLEY: + DoCast(me, SPELL_POISONBOLT_VOLLEY); + events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, urand(10000, 15000)); + break; + case EVENT_POISON_SHOCK: + DoCast(me, SPELL_POISON_SHOCK); + events.ScheduleEvent(EVENT_POISON_SHOCK, urand(7000, 12000)); + break; + case EVENT_RESET_PHASE: + _hitcounter = 0; + _phase = PHASE_FROST; + break; + default: + break; + } + } + + if (_phase != PHASE_GLOB) + DoMeleeAttackIfReady(); + } + + private: + uint8 _hitcounter; + Phases _phase; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_viscidusAI(creature); + } +}; + +class npc_glob_of_viscidus : public CreatureScript +{ + public: + npc_glob_of_viscidus() : CreatureScript("boss_glob_of_viscidus") { } + + struct npc_glob_of_viscidusAI : public ScriptedAI + { + npc_glob_of_viscidusAI(Creature* creature) : ScriptedAI(creature) { } + + void JustDied(Unit* /*killer*/) + { + InstanceScript* Instance = me->GetInstanceScript(); + if (!Instance) + return; + + if (Creature* Viscidus = me->GetMap()->GetCreature(Instance->GetData64(DATA_VISCIDUS))) + { + if (BossAI* ViscidusAI = dynamic_cast<BossAI*>(Viscidus->GetAI())) + ViscidusAI->SummonedCreatureDespawn(me); + + if (Viscidus->isAlive() && Viscidus->GetHealthPct() < 5.0f) + { + Viscidus->SetVisible(true); + Viscidus->getVictim()->Kill(Viscidus); + } + else + { + Viscidus->SetHealth(Viscidus->GetHealth() - Viscidus->GetMaxHealth() / 20); + Viscidus->CastSpell(Viscidus, SPELL_VISCIDUS_SHRINKS); + } + } + } -#define SPELL_POISON_SHOCK 25993 -#define SPELL_POISONBOLT_VOLLEY 25991 + void MovementInform(uint32 /*type*/, uint32 id) + { + if (id == ROOM_CENTER) + { + DoCast(me, SPELL_REJOIN_VISCIDUS); + ((TempSummon*)me)->UnSummon(); + } + } + }; -#define SPELL_TOXIN_CLOUD 25989 + CreatureAI* GetAI(Creature* creature) const + { + return new npc_glob_of_viscidusAI(creature); + } +}; +void AddSC_boss_viscidus() +{ + new boss_viscidus(); + new npc_glob_of_viscidus(); +} 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 c8a1ff63925..894849c5835 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -29,71 +29,86 @@ EndScriptData */ class instance_temple_of_ahnqiraj : public InstanceMapScript { -public: - instance_temple_of_ahnqiraj() : InstanceMapScript("instance_temple_of_ahnqiraj", 531) { } + public: + instance_temple_of_ahnqiraj() : InstanceMapScript("instance_temple_of_ahnqiraj", 531) { } - InstanceScript* GetInstanceScript(InstanceMap* map) const - { - return new instance_temple_of_ahnqiraj_InstanceMapScript(map); - } + InstanceScript* GetInstanceScript(InstanceMap* map) const + { + return new instance_temple_of_ahnqiraj_InstanceMapScript(map); + } - struct instance_temple_of_ahnqiraj_InstanceMapScript : public InstanceScript - { - instance_temple_of_ahnqiraj_InstanceMapScript(Map* map) : InstanceScript(map) {} + struct instance_temple_of_ahnqiraj_InstanceMapScript : public InstanceScript + { + instance_temple_of_ahnqiraj_InstanceMapScript(Map* map) : InstanceScript(map) {} - //If Vem is dead... - bool IsBossDied[3]; + //If Vem is dead... + bool IsBossDied[3]; - //Storing Skeram, Vem and Kri. - uint64 SkeramGUID; - uint64 VemGUID; - uint64 KriGUID; - uint64 VeklorGUID; - uint64 VeknilashGUID; + //Storing Skeram, Vem and Kri. + uint64 SkeramGUID; + uint64 VemGUID; + uint64 KriGUID; + uint64 VeklorGUID; + uint64 VeknilashGUID; + uint64 ViscidusGUID; - uint32 BugTrioDeathCount; + uint32 BugTrioDeathCount; - uint32 CthunPhase; + uint32 CthunPhase; - void Initialize() - { - IsBossDied[0] = false; - IsBossDied[1] = false; - IsBossDied[2] = false; + void Initialize() + { + IsBossDied[0] = false; + IsBossDied[1] = false; + IsBossDied[2] = false; - SkeramGUID = 0; - VemGUID = 0; - KriGUID = 0; - VeklorGUID = 0; - VeknilashGUID = 0; + SkeramGUID = 0; + VemGUID = 0; + KriGUID = 0; + VeklorGUID = 0; + VeknilashGUID = 0; + ViscidusGUID = 0; - BugTrioDeathCount = 0; + BugTrioDeathCount = 0; - CthunPhase = 0; - } + CthunPhase = 0; + } - void OnCreatureCreate(Creature* creature) - { - switch (creature->GetEntry()) + void OnCreatureCreate(Creature* creature) { - case 15263: SkeramGUID = creature->GetGUID(); break; - case 15544: VemGUID = creature->GetGUID(); break; - case 15511: KriGUID = creature->GetGUID(); break; - case 15276: VeklorGUID = creature->GetGUID(); break; - case 15275: VeknilashGUID = creature->GetGUID(); break; + switch (creature->GetEntry()) + { + case NPC_SKERAM: + SkeramGUID = creature->GetGUID(); + break; + case NPC_VEM: + VemGUID = creature->GetGUID(); + break; + case NPC_KRI: + KriGUID = creature->GetGUID(); + break; + case NPC_VEKLOR: + VeklorGUID = creature->GetGUID(); + break; + case NPC_VEKNILASH: + VeknilashGUID = creature->GetGUID(); + break; + case NPC_VISCIDUS: + ViscidusGUID = creature->GetGUID(); + break; + } } - } - bool IsEncounterInProgress() const - { - //not active in AQ40 - return false; - } + bool IsEncounterInProgress() const + { + //not active in AQ40 + return false; + } - uint32 GetData(uint32 type) const - { - switch (type) + uint32 GetData(uint32 type) const { + switch (type) + { case DATA_VEMISDEAD: if (IsBossDied[0]) return 1; @@ -114,14 +129,14 @@ public: case DATA_CTHUN_PHASE: return CthunPhase; + } + return 0; } - return 0; - } - uint64 GetData64(uint32 identifier) const - { - switch (identifier) + uint64 GetData64(uint32 identifier) const { + switch (identifier) + { case DATA_SKERAM: return SkeramGUID; case DATA_VEM: @@ -132,14 +147,16 @@ public: return VeklorGUID; case DATA_VEKNILASH: return VeknilashGUID; - } - return 0; - } // end GetData64 + case DATA_VISCIDUS: + return ViscidusGUID; + } + return 0; + } // end GetData64 - void SetData(uint32 type, uint32 data) - { - switch (type) + void SetData(uint32 type, uint32 data) { + switch (type) + { case DATA_VEM_DEATH: IsBossDied[0] = true; break; @@ -159,9 +176,9 @@ public: case DATA_CTHUN_PHASE: CthunPhase = data; break; + } } - } - }; + }; }; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp index 5bb65454e0a..a9419a727b3 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h index 13c3d56d14c..eecdce51831 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -19,19 +19,45 @@ #ifndef DEF_TEMPLE_OF_AHNQIRAJ_H #define DEF_TEMPLE_OF_AHNQIRAJ_H -#define DATA_SKERAM 1 -#define DATA_KRI 2 -#define DATA_VEM 3 -#define DATA_VEMISDEAD 4 -#define DATA_VEM_DEATH 5 -#define DATA_VEKLOR 6 -#define DATA_VEKLORISDEAD 7 -#define DATA_VEKLOR_DEATH 8 -#define DATA_VEKNILASH 9 -#define DATA_VEKNILASHISDEAD 10 -#define DATA_VEKNILASH_DEATH 11 -#define DATA_BUG_TRIO_DEATH 14 +enum DataTypes +{ + DATA_SKERAM = 1, + DATA_KRI = 2, + DATA_VEM = 3, + DATA_VEMISDEAD = 4, + DATA_VEM_DEATH = 5, + DATA_VEKLOR = 6, + DATA_VEKLORISDEAD = 7, + DATA_VEKLOR_DEATH = 8, + DATA_VEKNILASH = 9, + DATA_VEKNILASHISDEAD = 10, + DATA_VEKNILASH_DEATH = 11, + DATA_BUG_TRIO_DEATH = 14, + DATA_CTHUN_PHASE = 20, + DATA_VISCIDUS = 21 +}; -#define DATA_CTHUN_PHASE 20 +enum Creatures +{ + BOSS_EYE_OF_CTHUN = 15589, + MOB_CTHUN_PORTAL = 15896, + MOB_CLAW_TENTACLE = 15725, + MOB_EYE_TENTACLE = 15726, + MOB_SMALL_PORTAL = 15904, + MOB_BODY_OF_CTHUN = 15809, + MOB_GIANT_CLAW_TENTACLE = 15728, + MOB_GIANT_EYE_TENTACLE = 15334, + MOB_FLESH_TENTACLE = 15802, + MOB_GIANT_PORTAL = 15910, + + NPC_VISCIDUS = 15299, + NPC_GLOB_OF_VISCIDUS = 15667, + + NPC_SKERAM = 15263, + NPC_VEM = 15544, + NPC_KRI = 15511, + NPC_VEKLOR = 15276, + NPC_VEKNILASH = 15275 +}; #endif diff --git a/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp index afd4d834f07..e09a7611f21 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp index 6cc8d5931d3..7189abcc4fa 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h index a39de54ee06..c8a1d4b3159 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp index 4cdddb2d9da..8fd0d2e3621 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index 0a948e4a5f0..ee89c9b6cad 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp index 7bc2e96e0dc..4f37cacac02 100644 --- a/src/server/scripts/Kalimdor/boss_azuregos.cpp +++ b/src/server/scripts/Kalimdor/boss_azuregos.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/ashenvale.cpp b/src/server/scripts/Kalimdor/zone_ashenvale.cpp index 40ac1609fee..94c68a1d3ec 100644 --- a/src/server/scripts/Kalimdor/ashenvale.cpp +++ b/src/server/scripts/Kalimdor/zone_ashenvale.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/zone_azshara.cpp index b38d1ac2c3b..44f7e1e8172 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/zone_azshara.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp index e7c34e591fc..4b03cd65cad 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -412,14 +412,14 @@ enum Geezle SPELL_TREE_DISGUISE = 30298, GEEZLE_SAY_1 = 0, - SPARK_SAY_2 = 0, - SPARK_SAY_3 = 1, + SPARK_SAY_2 = 3, + SPARK_SAY_3 = 4, GEEZLE_SAY_4 = 1, - SPARK_SAY_5 = 2, - SPARK_SAY_6 = 3, + SPARK_SAY_5 = 5, + SPARK_SAY_6 = 6, GEEZLE_SAY_7 = 2, - EMOTE_SPARK = 4, + EMOTE_SPARK = 7, MOB_SPARK = 17243, GO_NAGA_FLAG = 181694 @@ -491,23 +491,23 @@ public: Spark->SetInFront(me); me->SetInFront(Spark); return 5000; - case 3: - Spark->AI()->Talk(SPARK_SAY_2); + case 3: + Spark->AI()->Talk(SPARK_SAY_2); return 7000; - case 4: + case 4: Spark->AI()->Talk(SPARK_SAY_3); return 8000; - case 5: + case 5: Talk(GEEZLE_SAY_4, SparkGUID); return 8000; - case 6: + case 6: Spark->AI()->Talk(SPARK_SAY_5); return 9000; - case 7: - Spark->AI()->Talk(SPARK_SAY_6); + case 7: + Spark->AI()->Talk(SPARK_SAY_6); return 8000; - case 8: - Talk(GEEZLE_SAY_7, SparkGUID); + case 8: + Talk(GEEZLE_SAY_7, SparkGUID); return 2000; case 9: me->GetMotionMaster()->MoveTargetedHome(); @@ -586,6 +586,7 @@ public: bool OnGossipHello(Player* player, GameObject* go) { + go->UseDoorOrButton(); if (player->GetQuestStatus(QUEST_STRENGTH_ONE) == QUEST_STATUS_INCOMPLETE) { if (Creature* ravager = go->FindNearestCreature(NPC_DEATH_RAVAGER, 5.0f, true)) @@ -741,6 +742,7 @@ class go_bristlelimb_cage : public GameObjectScript bool OnGossipHello(Player* player, GameObject* go) { + go->SetGoState(GO_STATE_READY); if (player->GetQuestStatus(QUEST_THE_PROPHECY_OF_AKIDA) == QUEST_STATUS_INCOMPLETE) { if (Creature* capitive = go->FindNearestCreature(NPC_STILLPINE_CAPITIVE, 5.0f, true)) diff --git a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp index 3b77ee34275..102a9494a65 100644 --- a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -168,9 +168,9 @@ public: bool OnGossipHello(Player* player, GameObject* go) { + go->SetGoState(GO_STATE_READY); if (Creature* stillpine = go->FindNearestCreature(NPC_PRINCESS_STILLPINE, 25, true)) { - go->SetGoState(GO_STATE_ACTIVE); stillpine->GetMotionMaster()->MovePoint(1, go->GetPositionX(), go->GetPositionY()-15, go->GetPositionZ()); player->CastedCreatureOrGO(NPC_PRINCESS_STILLPINE, 0, SPELL_OPENING_PRINCESS_STILLPINE_CREDIT); } diff --git a/src/server/scripts/Kalimdor/darkshore.cpp b/src/server/scripts/Kalimdor/zone_darkshore.cpp index 921cc6aaf97..09f061148d3 100644 --- a/src/server/scripts/Kalimdor/darkshore.cpp +++ b/src/server/scripts/Kalimdor/zone_darkshore.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/desolace.cpp b/src/server/scripts/Kalimdor/zone_desolace.cpp index 8c56714e614..8f55bb6102c 100644 --- a/src/server/scripts/Kalimdor/desolace.cpp +++ b/src/server/scripts/Kalimdor/zone_desolace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/zone_durotar.cpp index 04e65693154..fa6b830c1ae 100644 --- a/src/server/scripts/Kalimdor/durotar.cpp +++ b/src/server/scripts/Kalimdor/zone_durotar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp index 018b39c58e8..37941227c78 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -751,9 +751,9 @@ public: bool OnGossipHello(Player* player, GameObject* go) { + go->UseDoorOrButton(); if (Creature* prisoner = go->FindNearestCreature(NPC_THERAMORE_PRISONER, 1.0f)) { - go->UseDoorOrButton(); if (player) player->KilledMonsterCredit(NPC_THERAMORE_PRISONER, 0); diff --git a/src/server/scripts/Kalimdor/felwood.cpp b/src/server/scripts/Kalimdor/zone_felwood.cpp index f1d9a9028e1..e23eaa961bb 100644 --- a/src/server/scripts/Kalimdor/felwood.cpp +++ b/src/server/scripts/Kalimdor/zone_felwood.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/feralas.cpp b/src/server/scripts/Kalimdor/zone_feralas.cpp index 148f53c9e57..b2326de86ab 100644 --- a/src/server/scripts/Kalimdor/feralas.cpp +++ b/src/server/scripts/Kalimdor/zone_feralas.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/zone_moonglade.cpp index 9485048da8c..e41ffae03e6 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/zone_moonglade.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -37,6 +37,9 @@ EndContentData */ #include "ScriptedGossip.h" #include "Player.h" #include "SpellInfo.h" +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" /*###### ## npc_bunthen_plainswind @@ -319,6 +322,28 @@ public: } } + void IsSummonedBy(Unit* /*summoner*/) + { + std::list<Player*> playerOnQuestList; + Trinity::AnyPlayerInObjectRangeCheck checker(me, 5.0f); + Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(me, playerOnQuestList, checker); + me->VisitNearbyWorldObject(5.0f, searcher); + for (std::list<Player*>::const_iterator itr = playerOnQuestList.begin(); itr != playerOnQuestList.end(); ++itr) + { + // Check if found player target has active quest + if (Player* player = (*itr)) + { + if (player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) + { + StartEvent(player); + break; + } + } + else + break; + } + } + void JustDied(Unit* /*killer*/) { if (!PlayerGUID) @@ -358,7 +383,7 @@ public: return; } - void UpdateAI(const uint32 diff) + void UpdateAI(uint32 const diff) { npc_escortAI::UpdateAI(diff); @@ -533,30 +558,6 @@ public: }; /*#### -# npc_clintar_dreamwalker -####*/ - -enum Clintar -{ - CLINTAR_SPIRIT = 22916 -}; - -class npc_clintar_dreamwalker : public CreatureScript -{ -public: - npc_clintar_dreamwalker() : CreatureScript("npc_clintar_dreamwalker") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == 10965) - if (Creature* clintar_spirit = creature->SummonCreature(CLINTAR_SPIRIT, ClintarSpiritSummon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100000)) - CAST_AI(npc_clintar_spirit::npc_clintar_spiritAI, clintar_spirit->AI())->StartEvent(player); - return true; - } - -}; - -/*#### # npc_omen ####*/ @@ -707,7 +708,6 @@ void AddSC_moonglade() new npc_bunthen_plainswind(); new npc_great_bear_spirit(); new npc_silva_filnaveth(); - new npc_clintar_dreamwalker(); new npc_clintar_spirit(); new npc_omen(); new npc_giant_spotlight(); diff --git a/src/server/scripts/Kalimdor/mulgore.cpp b/src/server/scripts/Kalimdor/zone_mulgore.cpp index a86f891c6c0..aca55284b67 100644 --- a/src/server/scripts/Kalimdor/mulgore.cpp +++ b/src/server/scripts/Kalimdor/zone_mulgore.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/orgrimmar.cpp b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp index 5080daefbf9..42ef9843a4e 100644 --- a/src/server/scripts/Kalimdor/orgrimmar.cpp +++ b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp index f9b16b907eb..58665224bdd 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/zone_silithus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp index 033274f8561..26c92c7404c 100644 --- a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp index b7644395571..0648e40416d 100644 --- a/src/server/scripts/Kalimdor/tanaris.cpp +++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/teldrassil.cpp b/src/server/scripts/Kalimdor/zone_teldrassil.cpp index dfd42d132d8..d7983c2cbe6 100644 --- a/src/server/scripts/Kalimdor/teldrassil.cpp +++ b/src/server/scripts/Kalimdor/zone_teldrassil.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp index 9417e7993f7..8f7ab09260b 100644 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/thousand_needles.cpp b/src/server/scripts/Kalimdor/zone_thousand_needles.cpp index 53751cb8278..9c47991a5d5 100644 --- a/src/server/scripts/Kalimdor/thousand_needles.cpp +++ b/src/server/scripts/Kalimdor/zone_thousand_needles.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -406,6 +406,7 @@ public: bool OnGossipHello(Player* player, GameObject* go) { + go->UseDoorOrButton(); if (player->GetQuestStatus(5151) == QUEST_STATUS_INCOMPLETE) { if (Creature* panther = go->FindNearestCreature(ENRAGED_PANTHER, 5, true)) diff --git a/src/server/scripts/Kalimdor/thunder_bluff.cpp b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp index 1b10a3a204b..0d915dc7c44 100644 --- a/src/server/scripts/Kalimdor/thunder_bluff.cpp +++ b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/ungoro_crater.cpp b/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp index 801855e7249..e72c82bee97 100644 --- a/src/server/scripts/Kalimdor/ungoro_crater.cpp +++ b/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Kalimdor/winterspring.cpp b/src/server/scripts/Kalimdor/zone_winterspring.cpp index 73b8bfe9af1..06f01033a25 100644 --- a/src/server/scripts/Kalimdor/winterspring.cpp +++ b/src/server/scripts/Kalimdor/zone_winterspring.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h index 92d5c782e27..3a97117f520 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp index b34a990d39d..02245c92efd 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp index 9b48d7a9e1c..cd583603734 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp index b4756a33b38..7f6709b34fa 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp index e6bb23b61d7..c36bcf9708f 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp index 4729f68680e..8f77cc7ec6f 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -57,7 +57,7 @@ enum Yells SAY_SLAY = 3, SAY_DEATH = 4, SAY_FEED = 5, - SAY_VANISH = 6, + SAY_VANISH = 6 }; enum CombatPhase { diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp index 7eaf8368c21..db4959ae670 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h index 6e865860403..344b0dfe03a 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp index 11ef00775d0..1442ff265f4 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp index 2690ea13ab1..6c707a8388f 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp index 4c817fa9465..aa329f12f6a 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp index 10575ae288c..7873cadd096 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/CMakeLists.txt b/src/server/scripts/Northrend/CMakeLists.txt index 22d0f37a37f..1da1e4ab178 100644 --- a/src/server/scripts/Northrend/CMakeLists.txt +++ b/src/server/scripts/Northrend/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -10,9 +10,9 @@ set(scripts_STAT_SRCS ${scripts_STAT_SRCS} - Northrend/wintergrasp.cpp + Northrend/zone_wintergrasp.cpp Northrend/isle_of_conquest.cpp - Northrend/storm_peaks.cpp + Northrend/zone_storm_peaks.cpp Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h @@ -78,8 +78,8 @@ set(scripts_STAT_SRCS Northrend/Nexus/Oculus/boss_urom.cpp Northrend/Nexus/Oculus/oculus.cpp Northrend/Nexus/Oculus/instance_oculus.cpp - Northrend/Nexus/Nexus/commander_kolurg.cpp - Northrend/Nexus/Nexus/commander_stoutbeard.cpp + Northrend/Nexus/Nexus/boss_commander_kolurg.cpp + Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp Northrend/Nexus/Nexus/boss_ormorok.cpp Northrend/Nexus/Nexus/boss_magus_telestra.cpp Northrend/Nexus/Nexus/instance_nexus.cpp @@ -117,14 +117,14 @@ set(scripts_STAT_SRCS Northrend/Naxxramas/instance_naxxramas.cpp Northrend/Naxxramas/boss_grobbulus.cpp Northrend/Naxxramas/boss_noth.cpp - Northrend/crystalsong_forest.cpp + Northrend/zone_crystalsong_forest.cpp Northrend/VaultOfArchavon/boss_archavon.cpp Northrend/VaultOfArchavon/boss_koralon.cpp Northrend/VaultOfArchavon/vault_of_archavon.h Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp Northrend/VaultOfArchavon/boss_emalon.cpp Northrend/VaultOfArchavon/boss_toravon.cpp - Northrend/sholazar_basin.cpp + Northrend/zone_sholazar_basin.cpp Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp @@ -137,8 +137,8 @@ set(scripts_STAT_SRCS Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp - Northrend/dragonblight.cpp - Northrend/grizzly_hills.cpp + Northrend/zone_dragonblight.cpp + Northrend/zone_grizzly_hills.cpp Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp @@ -176,8 +176,8 @@ set(scripts_STAT_SRCS Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp Northrend/IcecrownCitadel/boss_sindragosa.cpp Northrend/IcecrownCitadel/boss_the_lich_king.cpp - Northrend/zuldrak.cpp - Northrend/icecrown.cpp + Northrend/zone_zuldrak.cpp + Northrend/zone_icecrown.cpp Northrend/Gundrak/boss_slad_ran.cpp Northrend/Gundrak/instance_gundrak.cpp Northrend/Gundrak/boss_drakkari_colossus.cpp @@ -185,9 +185,9 @@ set(scripts_STAT_SRCS Northrend/Gundrak/boss_gal_darah.cpp Northrend/Gundrak/boss_moorabi.cpp Northrend/Gundrak/boss_eck.cpp - Northrend/borean_tundra.cpp - Northrend/howling_fjord.cpp - Northrend/dalaran.cpp + Northrend/zone_borean_tundra.cpp + Northrend/zone_howling_fjord.cpp + Northrend/zone_dalaran.cpp Northrend/DraktharonKeep/boss_trollgore.cpp Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp Northrend/DraktharonKeep/boss_novos.cpp diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp index 6d4b4bc9379..f5864fe7b8f 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp index c39d7fbeb09..c602e0b1a9e 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h index a363758f953..7318e73dea1 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp index e848c29c466..205a0b10d69 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp index 531e5d9268e..ab53351cd6b 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index 2bb2b1c3cd7..781dd86cb86 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp index 61d693104fa..06743858ec0 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -21,10 +21,10 @@ enum Texts { - SAY_AGGRO = 0, // You will sssuffer for this intrusion! (17528) - SAY_CONFLAGRATION = 1, // Burn in the master's flame! (17532) - EMOTE_ENRAGED = 2, // %s becomes enraged! - SAY_KILL = 3, // Halion will be pleased. (17530) - As it should be.... (17529) + SAY_AGGRO = 0, // You will sssuffer for this intrusion! (17528) + SAY_CONFLAGRATION = 1, // Burn in the master's flame! (17532) + EMOTE_ENRAGED = 2, // %s becomes enraged! + SAY_KILL = 3, // Halion will be pleased. (17530) - As it should be.... (17529) }; enum Spells @@ -38,28 +38,28 @@ enum Spells enum Events { - EVENT_ENRAGE = 1, - EVENT_FLIGHT = 2, - EVENT_FLAME_BREATH = 3, - EVENT_CONFLAGRATION = 4, - EVENT_LAND_GROUND = 5, - EVENT_AIR_MOVEMENT = 6, + EVENT_ENRAGE = 1, + EVENT_FLIGHT = 2, + EVENT_FLAME_BREATH = 3, + EVENT_CONFLAGRATION = 4, + EVENT_LAND_GROUND = 5, + EVENT_AIR_MOVEMENT = 6, // Event group - EVENT_GROUP_LAND_PHASE = 1, + EVENT_GROUP_LAND_PHASE = 1, }; enum MovementPoints { - POINT_FLIGHT = 1, - POINT_LAND = 2, - POINT_TAKEOFF = 3, - POINT_LAND_GROUND = 4 + POINT_FLIGHT = 1, + POINT_LAND = 2, + POINT_TAKEOFF = 3, + POINT_LAND_GROUND = 4 }; enum Misc { - SOUND_ID_DEATH = 17531, + SOUND_ID_DEATH = 17531, }; Position const SavianaRagefireFlyOutPos = {3155.51f, 683.844f, 95.0f, 4.69f}; diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp index 939c22325d7..c373c2340ff 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp index ce543b95fd5..5baae66e65b 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h index 47a55f9035f..f50b10fb513 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp index d77c84b2978..fb0f0fbaee1 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -27,10 +27,34 @@ EndScriptData */ #include "SpellScript.h" #include "trial_of_the_champion.h" #include "ScriptedEscortAI.h" - -enum eSpells +/* +enum Yells +{ + // Eadric the Pure + SAY_INTRO = 0, + SAY_AGGRO = 1, + EMOTE_RADIANCE = 2, + EMOTE_HAMMER_RIGHTEOUS = 3, + SAY_HAMMER_RIGHTEOUS = 4, + SAY_KILL_PLAYER = 5, + SAY_DEFEATED = 6, + + // Argent Confessor Paletress + SAY_INTRO_1 = 0, + SAY_INTRO_2 = 1, + SAY_AGGRO = 2, + SAY_MEMORY_SUMMON = 3, + SAY_MEMORY_DEATH = 4, + SAY_KILL_PLAYER = 5, + SAY_DEFEATED = 6, + + // Memory of X + EMOTE_WAKING_NIGHTMARE = 0 +}; +*/ +enum Spells { - //Eadric + // Eadric the Pure SPELL_EADRIC_ACHIEVEMENT = 68197, SPELL_HAMMER_JUSTICE = 66863, SPELL_HAMMER_RIGHTEOUS = 66867, diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp index c56d44ceb08..ceb9724a078 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -27,7 +27,7 @@ EndScriptData */ #include "ScriptedEscortAI.h" #include "trial_of_the_champion.h" -enum eSpells +enum Spells { //phase 1 SPELL_PLAGUE_STRIKE = 67884, @@ -61,13 +61,13 @@ enum eSpells SPELL_KILL_CREDIT = 68663 }; -enum eModels +enum Models { MODEL_SKELETON = 29846, MODEL_GHOST = 21300 }; -enum ePhases +enum Phases { PHASE_UNDEAD = 1, PHASE_SKELETON = 2, 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 35a22c6bf37..9299630b3d2 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp index d2a01003324..2cd4c7a9ee4 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp index ffda3d12e2f..7e4a740cb13 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -33,6 +33,18 @@ EndContentData */ #include "Vehicle.h" #include "Player.h" +enum Yells +{ + SAY_INTRO_1 = 0, + SAY_INTRO_2 = 1, + SAY_INTRO_3 = 2, + SAY_AGGRO = 3, + SAY_PHASE_2 = 4, + SAY_PHASE_3 = 5, + SAY_KILL_PLAYER = 6, + SAY_DEATH = 7 +}; + #define GOSSIP_START_EVENT1 "I'm ready to start challenge." #define GOSSIP_START_EVENT2 "I'm ready for the next challenge." diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h index cb3a43acdd0..8812b578827 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -19,7 +19,7 @@ #ifndef DEF_TOC_H #define DEF_TOC_H -enum eData +enum Data { BOSS_GRAND_CHAMPIONS, BOSS_ARGENT_CHALLENGE_E, @@ -46,7 +46,7 @@ enum Data64 DATA_GRAND_CHAMPION_3 }; -enum eNpcs +enum CreatureIds { // Horde Champions NPC_MOKRA = 35572, @@ -78,7 +78,7 @@ enum eNpcs NPC_ARELAS = 35005 }; -enum eGameObjects +enum GameObjects { GO_MAIN_GATE = 195647, @@ -92,7 +92,7 @@ enum eGameObjects GO_PALETRESS_LOOT_H = 195324 }; -enum eVehicles +enum Vehicles { //Grand Champions Alliance Vehicles VEHICLE_MARSHAL_JACOB_ALERIUS_MOUNT = 35637, 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 f618d0e04e7..e44f5fba1b8 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2010 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ #include "ScriptedCreature.h" #include "trial_of_the_crusader.h" #include "SpellScript.h" +#include "SpellAuraEffects.h" #include <limits> enum Yells @@ -53,54 +54,54 @@ enum Summons enum BossSpells { - SPELL_FREEZE_SLASH = 66012, - SPELL_PENETRATING_COLD = 66013, - SPELL_LEECHING_SWARM = 66118, - SPELL_LEECHING_HEAL = 66125, - SPELL_LEECHING_DAMAGE = 66240, - SPELL_MARK = 67574, - SPELL_SPIKE_CALL = 66169, - SPELL_SUBMERGE_ANUBARAK = 65981, - SPELL_CLEAR_ALL_DEBUFFS = 34098, - SPELL_EMERGE_ANUBARAK = 65982, - SPELL_SUMMON_BEATLES = 66339, - SPELL_SUMMON_BURROWER = 66332, + SPELL_FREEZE_SLASH = 66012, + SPELL_PENETRATING_COLD = 66013, + SPELL_LEECHING_SWARM = 66118, + SPELL_LEECHING_SWARM_HEAL = 66125, + SPELL_LEECHING_SWARM_DMG = 66240, + SPELL_MARK = 67574, + SPELL_SPIKE_CALL = 66169, + SPELL_SUBMERGE_ANUBARAK = 65981, + SPELL_CLEAR_ALL_DEBUFFS = 34098, + SPELL_EMERGE_ANUBARAK = 65982, + SPELL_SUMMON_BEATLES = 66339, + SPELL_SUMMON_BURROWER = 66332, // Burrow - SPELL_CHURNING_GROUND = 66969, + SPELL_CHURNING_GROUND = 66969, // Scarab - SPELL_DETERMINATION = 66092, - SPELL_ACID_MANDIBLE = 65774, //Passive - Triggered + SPELL_DETERMINATION = 66092, + SPELL_ACID_MANDIBLE = 65774, //Passive - Triggered // Burrower - SPELL_SPIDER_FRENZY = 66128, - SPELL_EXPOSE_WEAKNESS = 67720, //Passive - Triggered - SPELL_SHADOW_STRIKE = 66134, - SPELL_SUBMERGE_EFFECT = 68394, - SPELL_AWAKENED = 66311, - SPELL_EMERGE_EFFECT = 65982, + SPELL_SPIDER_FRENZY = 66128, + SPELL_EXPOSE_WEAKNESS = 67720, //Passive - Triggered + SPELL_SHADOW_STRIKE = 66134, + SPELL_SUBMERGE_EFFECT = 68394, + SPELL_AWAKENED = 66311, + SPELL_EMERGE_EFFECT = 65982, - SPELL_PERSISTENT_DIRT = 68048, + SPELL_PERSISTENT_DIRT = 68048, - SUMMON_SCARAB = NPC_SCARAB, - SUMMON_FROSTSPHERE = NPC_FROST_SPHERE, - SPELL_BERSERK = 26662, + SUMMON_SCARAB = NPC_SCARAB, + SUMMON_FROSTSPHERE = NPC_FROST_SPHERE, + SPELL_BERSERK = 26662, //Frost Sphere - SPELL_FROST_SPHERE = 67539, - SPELL_PERMAFROST = 66193, - SPELL_PERMAFROST_VISUAL = 65882, - SPELL_PERMAFROST_MODEL = 66185, + SPELL_FROST_SPHERE = 67539, + SPELL_PERMAFROST = 66193, + SPELL_PERMAFROST_VISUAL = 65882, + SPELL_PERMAFROST_MODEL = 66185, //Spike - SPELL_SUMMON_SPIKE = 66169, - SPELL_SPIKE_SPEED1 = 65920, - SPELL_SPIKE_TRAIL = 65921, - SPELL_SPIKE_SPEED2 = 65922, - SPELL_SPIKE_SPEED3 = 65923, - SPELL_SPIKE_FAIL = 66181, - SPELL_SPIKE_TELE = 66170 + SPELL_SUMMON_SPIKE = 66169, + SPELL_SPIKE_SPEED1 = 65920, + SPELL_SPIKE_TRAIL = 65921, + SPELL_SPIKE_SPEED2 = 65922, + SPELL_SPIKE_SPEED3 = 65923, + SPELL_SPIKE_FAIL = 66181, + SPELL_SPIKE_TELE = 66170 }; #define SPELL_PERMAFROST_HELPER RAID_MODE<uint32>(66193, 67855, 67856, 67857) @@ -841,6 +842,49 @@ class spell_impale : public SpellScriptLoader } }; +class spell_anubarak_leeching_swarm : public SpellScriptLoader +{ + public: + spell_anubarak_leeching_swarm() : SpellScriptLoader("spell_anubarak_leeching_swarm") { } + + class spell_anubarak_leeching_swarm_AuraScript : public AuraScript + { + PrepareAuraScript(spell_anubarak_leeching_swarm_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_LEECHING_SWARM_DMG) || !sSpellMgr->GetSpellInfo(SPELL_LEECHING_SWARM_HEAL)) + return false; + return true; + } + + void HandleEffectPeriodic(AuraEffect const* aurEff) + { + Unit* caster = GetCaster(); + if (Unit* target = GetTarget()) + { + int32 lifeLeeched = target->CountPctFromCurHealth(aurEff->GetAmount()); + if (lifeLeeched < 250) + lifeLeeched = 250; + // Damage + caster->CastCustomSpell(target, SPELL_LEECHING_SWARM_DMG, &lifeLeeched, 0, 0, false); + // Heal + caster->CastCustomSpell(caster, SPELL_LEECHING_SWARM_HEAL, &lifeLeeched, 0, 0, false); + } + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_anubarak_leeching_swarm_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_anubarak_leeching_swarm_AuraScript(); + } +}; + void AddSC_boss_anubarak_trial() { new boss_anubarak_trial(); @@ -850,4 +894,5 @@ void AddSC_boss_anubarak_trial() new mob_frost_sphere(); new spell_impale(); + new spell_anubarak_leeching_swarm(); } 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 a99aa373602..ba554c3703d 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ enum Yells SAY_KILL_PLAYER = 6 }; -enum eAIs +enum AIs { AI_MELEE = 0, AI_RANGED = 1, @@ -1484,8 +1484,11 @@ class mob_toc_hunter : public CreatureScript events.ScheduleEvent(EVENT_STEADY_SHOT, urand(5*IN_MILLISECONDS, 15*IN_MILLISECONDS)); return; case EVENT_WING_CLIP: - if (me->GetDistance2d(me->getVictim()) < 6.0f) - DoCastVictim(SPELL_WING_CLIP); + if (Unit* target = me->getVictim()) + { + if (me->GetDistance2d(target) < 6.0f) + DoCast(target, SPELL_WING_CLIP); + } events.ScheduleEvent(EVENT_WING_CLIP, urand(15*IN_MILLISECONDS, 25*IN_MILLISECONDS)); return; case EVENT_WYVERN_STING: @@ -1670,13 +1673,16 @@ class mob_toc_warrior : public CreatureScript events.ScheduleEvent(EVENT_SUNDER_ARMOR, urand(2*IN_MILLISECONDS, 5*IN_MILLISECONDS)); return; case EVENT_SHATTERING_THROW: - if (me->getVictim()->HasAuraWithMechanic(1<<MECHANIC_IMMUNE_SHIELD)) + if (Unit* target = me->getVictim()) { - DoCastVictim(SPELL_SHATTERING_THROW); - events.RescheduleEvent(EVENT_SHATTERING_THROW, 5*MINUTE*IN_MILLISECONDS); + if (target->HasAuraWithMechanic(1 << MECHANIC_IMMUNE_SHIELD)) + { + DoCast(target, SPELL_SHATTERING_THROW); + events.RescheduleEvent(EVENT_SHATTERING_THROW, 5*MINUTE*IN_MILLISECONDS); + return; + } } - else - events.RescheduleEvent(EVENT_SHATTERING_THROW, 3*IN_MILLISECONDS); + events.RescheduleEvent(EVENT_SHATTERING_THROW, 3*IN_MILLISECONDS); return; case EVENT_RETALIATION: if (HealthBelowPct(50)) @@ -1746,13 +1752,16 @@ class mob_toc_dk : public CreatureScript events.ScheduleEvent(EVENT_DEATH_COIL, urand(5*IN_MILLISECONDS, 15*IN_MILLISECONDS)); return; case EVENT_DEATH_GRIP: - if (me->IsInRange(me->getVictim(), 5.0f, 30.0f, false)) + if (Unit* target = me->getVictim()) { - DoCast(me->getVictim(), SPELL_DEATH_GRIP); - events.RescheduleEvent(EVENT_DEATH_GRIP, 35*IN_MILLISECONDS); + if (me->IsInRange(target, 5.0f, 30.0f, false)) + { + DoCast(target, SPELL_DEATH_GRIP); + events.RescheduleEvent(EVENT_DEATH_GRIP, 35*IN_MILLISECONDS); + return; + } } - else - events.RescheduleEvent(EVENT_DEATH_GRIP, 3*IN_MILLISECONDS); + events.RescheduleEvent(EVENT_DEATH_GRIP, 3*IN_MILLISECONDS); return; case EVENT_FROST_STRIKE: DoCastVictim(SPELL_FROST_STRIKE); @@ -1862,13 +1871,16 @@ class mob_toc_rogue : public CreatureScript events.RescheduleEvent(EVENT_BLADE_FLURRY, 5*IN_MILLISECONDS); return; case EVENT_SHADOWSTEP: - if (me->IsInRange(me->getVictim(), 10.0f, 40.0f, false)) + if (Unit* target = me->getVictim()) { - DoCast(me->getVictim(), SPELL_SHADOWSTEP); - events.RescheduleEvent(EVENT_SHADOWSTEP, 30*IN_MILLISECONDS); + if (me->IsInRange(target, 10.0f, 40.0f, false)) + { + DoCast(target, SPELL_SHADOWSTEP); + events.RescheduleEvent(EVENT_SHADOWSTEP, 30*IN_MILLISECONDS); + return; + } } - else - events.RescheduleEvent(EVENT_SHADOWSTEP, 5*IN_MILLISECONDS); + events.RescheduleEvent(EVENT_SHADOWSTEP, 5*IN_MILLISECONDS); return; case EVENT_HEMORRHAGE: DoCastVictim(SPELL_HEMORRHAGE); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index e2068cabb95..ac520968db8 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2010 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it 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 2d09feef089..03a305356c4 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2010 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -1006,7 +1006,7 @@ class boss_icehowl : public CreatureScript events.ScheduleEvent(EVENT_WHIRL, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS)); return; case EVENT_MASSIVE_CRASH: - me->GetMotionMaster()->MoveJump(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 20.0f, 20.0f); // 1: Middle of the room + me->GetMotionMaster()->MoveJump(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 20.0f, 20.0f, 0); // 1: Middle of the room SetCombatMovement(false); me->AttackStop(); _stage = 7; //Invalid (Do nothing more than move) @@ -1059,7 +1059,7 @@ class boss_icehowl : public CreatureScript _trampleTargetY = target->GetPositionY(); _trampleTargetZ = target->GetPositionZ(); // 2: Hop Backwards - me->GetMotionMaster()->MoveJump(2*me->GetPositionX() - _trampleTargetX, 2*me->GetPositionY() - _trampleTargetY, me->GetPositionZ(), 30.0f, 20.0f); + me->GetMotionMaster()->MoveJump(2*me->GetPositionX() - _trampleTargetX, 2*me->GetPositionY() - _trampleTargetY, me->GetPositionZ(), 30.0f, 20.0f, 0); _stage = 7; //Invalid (Do nothing more than move) } else 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 01d3bcbfe90..9b6f4a6a0da 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2010 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp index fb084ec1e3c..8d2d9f8b4c1 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it 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 b4d35afa8fb..3e3fbf51cd0 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp index 759f8df7153..6cb970f6ab7 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp index 1ad776a0b46..e99128fbbf9 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,229 +16,245 @@ */ #include "ScriptMgr.h" +#include "SpellScript.h" #include "ScriptedCreature.h" #include "drak_tharon_keep.h" -enum Spells +enum Misc { - SPELL_ARCANE_BLAST = 49198, - H_SPELL_ARCANE_BLAST = 59909, - SPELL_ARCANE_FIELD = 47346, - SPELL_BLIZZARD = 49034, - H_SPELL_BLIZZARD = 59854, - SPELL_FROSTBOLT = 49037, - H_SPELL_FROSTBOLT = 59855, - SPELL_WRATH_OF_MISERY = 50089, - H_SPELL_WRATH_OF_MISERY = 59856, - SPELL_SUMMON_MINIONS = 59910 //Summons an army of Fetid Troll Corpses to assist the caster. + ACTION_RESET_CRYSTALS, + ACTION_ACTIVATE_CRYSTAL, + ACTION_DEACTIVATE, + EVENT_ATTACK, + EVENT_SUMMON_MINIONS, + DATA_NOVOS_ACHIEV }; -//not in db -enum Yells +enum Creatures { - SAY_AGGRO = 0, - SAY_KILL = 1, - SAY_DEATH = 2, - SAY_NECRO_ADD = 3, - SAY_REUBBLE = 4 + NPC_CRYSTAL_CHANNEL_TARGET = 26712, + NPC_FETID_TROLL_CORPSE = 27597, + NPC_RISEN_SHADOWCASTER = 27600, + NPC_HULKING_CORPSE = 27597 }; -enum Creatures +enum Spells { - CREATURE_RISEN_SHADOWCASTER = 27600, - CREATURE_FETID_TROLL_CORPSE = 27598, - CREATURE_HULKING_CORPSE = 27597, - CREATURE_CRYSTAL_HANDLER = 26627 + SPELL_BEAM_CHANNEL = 52106, + SPELL_ARCANE_FIELD = 47346, + + SPELL_SUMMON_RISEN_SHADOWCASTER = 49105, + SPELL_SUMMON_FETID_TROLL_CORPSE = 49103, + SPELL_SUMMON_HULKING_CORPSE = 49104, + SPELL_SUMMON_CRYSTAL_HANDLER = 49179, + + SPELL_ARCANE_BLAST = 49198, + SPELL_BLIZZARD = 49034, + SPELL_FROSTBOLT = 49037, + SPELL_WRATH_OF_MISERY = 50089, + SPELL_SUMMON_MINIONS = 59910 }; -enum CombatPhase +struct SummonerInfo { - IDLE, - PHASE_1, - PHASE_2 + uint32 data, spell, timer; }; -#define ACTION_MINION_REACHED 1 -#define DATA_OH_NOVOS 2 +const SummonerInfo summoners[] = +{ + { DATA_NOVOS_SUMMONER_1, SPELL_SUMMON_RISEN_SHADOWCASTER, 15000 }, + { DATA_NOVOS_SUMMONER_2, SPELL_SUMMON_FETID_TROLL_CORPSE, 5000 }, + { DATA_NOVOS_SUMMONER_3, SPELL_SUMMON_HULKING_CORPSE, 30000 }, + { DATA_NOVOS_SUMMONER_4, SPELL_SUMMON_CRYSTAL_HANDLER, 30000 } +}; -static Position AddSpawnPoint = { -379.20f, -816.76f, 59.70f, 0.0f }; -static Position CrystalHandlerSpawnPoint = { -326.626343f, -709.956604f, 27.813314f, 0.0f }; -static Position AddDestinyPoint = { -379.314545f, -772.577637f, 28.58837f, 0.0f }; +#define MAX_Y_COORD_OH_NOVOS -771.95f class boss_novos : public CreatureScript { public: boss_novos() : CreatureScript("boss_novos") { } - struct boss_novosAI : public Scripted_NoMovementAI + struct boss_novosAI : public BossAI { - boss_novosAI(Creature* creature) : Scripted_NoMovementAI(creature), lSummons(me) + boss_novosAI(Creature* creature) : BossAI(creature, DATA_NOVOS_EVENT) {} + + void Reset() { - instance = creature->GetInstanceScript(); + events.Reset(); + summons.DespawnAll(); + instance->SetData(DATA_NOVOS_EVENT, NOT_STARTED); + + _ohNovos = true; + _crystalHandlerCount = 0; + SetCrystalsStatus(false); + SetSummonerStatus(false); + SetBubbled(false); } - uint32 uiTimer; - uint32 uiCrystalHandlerTimer; - uint8 crystalHandlerAmount; + void EnterCombat(Unit* /* victim */) + { + me->setActive(true); + DoZoneInCombat(); + instance->SetData(DATA_NOVOS_EVENT, IN_PROGRESS); - bool ohNovos; + SetCrystalsStatus(true); + SetSummonerStatus(true); + SetBubbled(true); + } - SummonList lSummons; + void AttackStart(Unit* target) + { + if (!target) + return; - std::list<uint64> luiCrystals; + if (me->Attack(target, true)) + DoStartNoMovement(target); + } - CombatPhase Phase; + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim() || _bubbled) + return; - InstanceScript* instance; + events.Update(diff); - void Reset() - { - Phase = IDLE; - luiCrystals.clear(); - ohNovos = true; - me->CastStop(); - lSummons.DespawnAll(); - crystalHandlerAmount = 0; - - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - if (instance) - { - instance->SetData(DATA_NOVOS_EVENT, NOT_STARTED); - for (uint8 n = 0; n < 4; ++n) - luiCrystals.push_back(instance->GetData64(DATA_NOVOS_CRYSTAL_1 + n)); - for (std::list<uint64>::const_iterator itr = luiCrystals.begin(); itr != luiCrystals.end(); ++itr) - { - if (GameObject* temp = instance->instance->GetGameObject(*itr)) - temp->SetGoState(GO_STATE_READY); - } - } - } + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - void EnterCombat(Unit* /*who*/) - { - Talk(SAY_AGGRO); - Phase = PHASE_1; - uiCrystalHandlerTimer = 30*IN_MILLISECONDS; - uiTimer = 1*IN_MILLISECONDS; - DoCast(SPELL_ARCANE_FIELD); - if (instance) + if (uint32 eventId = events.ExecuteEvent()) { - for (std::list<uint64>::const_iterator itr = luiCrystals.begin(); itr != luiCrystals.end(); ++itr) + switch (eventId) { - if (GameObject* temp = instance->instance->GetGameObject(*itr)) - temp->SetGoState(GO_STATE_ACTIVE); + case EVENT_SUMMON_MINIONS: + DoCast(SPELL_SUMMON_MINIONS); + events.ScheduleEvent(EVENT_SUMMON_MINIONS, 15000); + break; + case EVENT_ATTACK: + if (Unit* victim = SelectTarget(SELECT_TARGET_RANDOM)) + DoCast(victim, RAND(SPELL_ARCANE_BLAST, SPELL_BLIZZARD, SPELL_FROSTBOLT, SPELL_WRATH_OF_MISERY)); + events.ScheduleEvent(EVENT_ATTACK, 3000); + break; + default: + break; } - instance->SetData(DATA_NOVOS_EVENT, IN_PROGRESS); } - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } - void UpdateAI(const uint32 diff) + void DoAction(int32 const action) { - switch (Phase) - { - case PHASE_1: - if (uiTimer <= diff) - { - Creature* summon = me->SummonCreature(RAND(CREATURE_FETID_TROLL_CORPSE, CREATURE_HULKING_CORPSE, CREATURE_RISEN_SHADOWCASTER), AddSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20*IN_MILLISECONDS); - summon->GetMotionMaster()->MovePoint(0, AddDestinyPoint); - //If spell is casted stops casting arcane field so no spell casting - //DoCast(me, SPELL_SUMMON_MINIONS); - uiTimer = 3*IN_MILLISECONDS; - } else uiTimer -= diff; - if (crystalHandlerAmount < 4) - { - if (uiCrystalHandlerTimer <= diff) - { - Talk(SAY_NECRO_ADD); - Creature* pCrystalHandler = me->SummonCreature(CREATURE_CRYSTAL_HANDLER, CrystalHandlerSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20*IN_MILLISECONDS); - pCrystalHandler->GetMotionMaster()->MovePoint(0, AddDestinyPoint); - uiCrystalHandlerTimer = urand(20*IN_MILLISECONDS, 30*IN_MILLISECONDS); - } else uiCrystalHandlerTimer -= diff; - } - break; - case PHASE_2: - if (uiTimer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(target, DUNGEON_MODE(RAND(SPELL_ARCANE_BLAST, SPELL_BLIZZARD, SPELL_FROSTBOLT, SPELL_WRATH_OF_MISERY), - RAND(H_SPELL_ARCANE_BLAST, H_SPELL_BLIZZARD, H_SPELL_FROSTBOLT, H_SPELL_WRATH_OF_MISERY))); - uiTimer = urand(1*IN_MILLISECONDS, 3*IN_MILLISECONDS); - } else uiTimer -= diff; - break; - default: - break; - } + if (action == ACTION_CRYSTAL_HANDLER_DIED) + CrystalHandlerDied(); } - void JustDied(Unit* /*killer*/) + + void MoveInLineOfSight(Unit* who) { - Talk(SAY_DEATH); - if (instance) - instance->SetData(DATA_NOVOS_EVENT, DONE); - lSummons.DespawnAll(); + BossAI::MoveInLineOfSight(who); + + if (!_ohNovos || !who || who->GetTypeId() != TYPEID_UNIT || who->GetPositionY() > MAX_Y_COORD_OH_NOVOS) + return; + + uint32 entry = who->GetEntry(); + if (entry == NPC_HULKING_CORPSE || entry == NPC_RISEN_SHADOWCASTER || entry == NPC_FETID_TROLL_CORPSE) + _ohNovos = false; } - void KilledUnit(Unit* victim) + uint32 GetData(uint32 type) const { - if (victim == me) - return; - Talk(SAY_KILL); + return type == DATA_NOVOS_ACHIEV && _ohNovos ? 1 : 0; } void JustSummoned(Creature* summon) { - if (summon->GetEntry() == CREATURE_CRYSTAL_HANDLER) - crystalHandlerAmount++; - - lSummons.Summon(summon); + summons.Summon(summon); } - void DoAction(int32 const action) + private: + void SetBubbled(bool state) { - if (action == ACTION_MINION_REACHED) - ohNovos = false; + _bubbled = state; + if (!state) + { + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + if (me->HasUnitState(UNIT_STATE_CASTING)) + me->CastStop(); + } + else + { + if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + DoCast(SPELL_ARCANE_FIELD); + } } - uint32 GetData(uint32 type) const + void SetSummonerStatus(bool active) { - if (type == DATA_OH_NOVOS) - return ohNovos ? 1 : 0; + for (uint8 i = 0; i < 4; i++) + if (uint64 guid = instance->GetData64(summoners[i].data)) + if (Creature* crystalChannelTarget = instance->instance->GetCreature(guid)) + { + if (active) + crystalChannelTarget->AI()->SetData(summoners[i].spell, summoners[i].timer); + else + crystalChannelTarget->AI()->Reset(); + } + } - return 0; + void SetCrystalsStatus(bool active) + { + for (uint8 i = 0; i < 4; i++) + if (uint64 guid = instance->GetData64(DATA_NOVOS_CRYSTAL_1 + i)) + if (GameObject* crystal = instance->instance->GetGameObject(guid)) + SetCrystalStatus(crystal, active); } - void RemoveCrystal() + void SetCrystalStatus(GameObject* crystal, bool active) { - if (!luiCrystals.empty()) - { - if (instance) - if (GameObject* temp = instance->instance->GetGameObject(luiCrystals.back())) - temp->SetGoState(GO_STATE_READY); - luiCrystals.pop_back(); - } - if (luiCrystals.empty()) + if (!crystal) + return; + + crystal->SetGoState(active ? GO_STATE_ACTIVE : GO_STATE_READY); + if (Creature* crystalChannelTarget = crystal->FindNearestCreature(NPC_CRYSTAL_CHANNEL_TARGET, 5.0f)) { - me->CastStop(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Phase = PHASE_2; - uiTimer = 1*IN_MILLISECONDS; + if (active) + crystalChannelTarget->AI()->DoCastAOE(SPELL_BEAM_CHANNEL); + else if (crystalChannelTarget->HasUnitState(UNIT_STATE_CASTING)) + crystalChannelTarget->CastStop(); } } - Unit* GetRandomTarget() + void CrystalHandlerDied() { - return SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + for (uint8 i = 0; i < 4; i++) + if (uint64 guid = instance->GetData64(DATA_NOVOS_CRYSTAL_1 + i)) + if (GameObject* crystal = instance->instance->GetGameObject(guid)) + if (crystal->GetGoState() == GO_STATE_ACTIVE) + { + SetCrystalStatus(crystal, false); + break; + } + + if (++_crystalHandlerCount >= 4) + { + SetSummonerStatus(false); + SetBubbled(false); + events.ScheduleEvent(EVENT_ATTACK, 3000); + if (IsHeroic()) + events.ScheduleEvent(EVENT_SUMMON_MINIONS, 15000); + } + else if (uint64 guid = instance->GetData64(DATA_NOVOS_SUMMONER_4)) + if (Creature* crystalChannelTarget = instance->instance->GetCreature(guid)) + crystalChannelTarget->AI()->SetData(SPELL_SUMMON_CRYSTAL_HANDLER, 15000); } + + uint8 _crystalHandlerCount; + bool _ohNovos; + bool _bubbled; }; CreatureAI* GetAI(Creature* creature) const @@ -247,126 +263,116 @@ public: } }; -enum CrystalHandlerSpells -{ - SPELL_FLASH_OF_DARKNESS = 49668, - H_SPELL_FLASH_OF_DARKNESS = 59004 -}; - -class mob_crystal_handler : public CreatureScript +class npc_crystal_channel_target : public CreatureScript { public: - mob_crystal_handler() : CreatureScript("mob_crystal_handler") { } + npc_crystal_channel_target() : CreatureScript("npc_crystal_channel_target") {} - struct mob_crystal_handlerAI : public ScriptedAI + struct npc_crystal_channel_targetAI : public ScriptedAI { - mob_crystal_handlerAI(Creature* creature) : ScriptedAI(creature) + npc_crystal_channel_targetAI(Creature* creature) : ScriptedAI(creature) {} + + void Reset() { - instance = creature->GetInstanceScript(); + _spell = 0; + _timer = 0; + _temp = 0; } - uint32 uiFlashOfDarknessTimer; - - InstanceScript* instance; - - void Reset() + void UpdateAI(const uint32 diff) { - uiFlashOfDarknessTimer = 5*IN_MILLISECONDS; + if (_spell) + { + if (_temp <= diff) + { + DoCast(_spell); + _temp = _timer; + } + else + _temp -= diff; + } } - void JustDied(Unit* /*killer*/) + void SetData(uint32 id, uint32 value) { - if (Creature* pNovos = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_NOVOS) : 0)) - CAST_AI(boss_novos::boss_novosAI, pNovos->AI())->RemoveCrystal(); + _spell = id; + _timer = value; + _temp = value; } - void UpdateAI(const uint32 diff) + void JustSummoned(Creature* summon) { - if (!UpdateVictim()) - return; + if (InstanceScript* instance = me->GetInstanceScript()) + if (uint64 guid = instance->GetData64(DATA_NOVOS)) + if (Creature* novos = Creature::GetCreature(*me, guid)) + novos->AI()->JustSummoned(summon); - if (uiFlashOfDarknessTimer <= diff) - { - DoCast(me->getVictim(), DUNGEON_MODE(SPELL_FLASH_OF_DARKNESS, H_SPELL_FLASH_OF_DARKNESS)); - uiFlashOfDarknessTimer = 5*IN_MILLISECONDS; - } else uiFlashOfDarknessTimer -= diff; + if (summon) + summon->GetMotionMaster()->MovePath(summon->GetEntry() * 100, false); - DoMeleeAttackIfReady(); + if (_spell == SPELL_SUMMON_CRYSTAL_HANDLER) + Reset(); } - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE || id != 0) - return; - if (Creature* pNovos = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_NOVOS) : 0)) - if (Unit* target = CAST_AI(boss_novos::boss_novosAI, pNovos->AI())->GetRandomTarget()) - AttackStart(target); - } + private: + uint32 _spell; + uint32 _timer; + uint32 _temp; }; CreatureAI* GetAI(Creature* creature) const { - return new mob_crystal_handlerAI(creature); + return new npc_crystal_channel_targetAI(creature); } }; -class mob_novos_minion : public CreatureScript +class achievement_oh_novos : public AchievementCriteriaScript { public: - mob_novos_minion() : CreatureScript("mob_novos_minion") { } + achievement_oh_novos() : AchievementCriteriaScript("achievement_oh_novos") {} - struct mob_novos_minionAI : public ScriptedAI + bool OnCheck(Player* /*player*/, Unit* target) { - mob_novos_minionAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } + return target && target->GetTypeId() == TYPEID_UNIT && target->ToCreature()->AI()->GetData(DATA_NOVOS_ACHIEV); + } +}; - InstanceScript* instance; +enum SummonMinions +{ + SPELL_COPY_OF_SUMMON_MINIONS = 59933 +}; - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE || id !=0) - return; - if (Creature* Novos = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(DATA_NOVOS) : 0)) - { - Novos->AI()->DoAction(ACTION_MINION_REACHED); - if (Unit* target = CAST_AI(boss_novos::boss_novosAI, Novos->AI())->GetRandomTarget()) - AttackStart(target); - } - } - }; +class spell_summon_minions : public SpellScriptLoader +{ +public: + spell_summon_minions() : SpellScriptLoader("spell_summon_minions") { } - CreatureAI* GetAI(Creature* creature) const + class spell_summon_minions_SpellScript : public SpellScript { - return new mob_novos_minionAI(creature); - } -}; + PrepareSpellScript(spell_summon_minions_SpellScript); -class achievement_oh_novos : public AchievementCriteriaScript -{ - public: - achievement_oh_novos() : AchievementCriteriaScript("achievement_oh_novos") + void HandleScript(SpellEffIndex /*effIndex*/) { + GetCaster()->CastSpell((Unit*)NULL, SPELL_COPY_OF_SUMMON_MINIONS, true); + GetCaster()->CastSpell((Unit*)NULL, SPELL_COPY_OF_SUMMON_MINIONS, true); } - bool OnCheck(Player* /*player*/, Unit* target) + void Register() { - if (!target) - return false; - - if (Creature* Novos = target->ToCreature()) - if (Novos->AI()->GetData(DATA_OH_NOVOS)) - return true; - - return false; + OnEffectHitTarget += SpellEffectFn(spell_summon_minions_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } + }; + + SpellScript* GetSpellScript() const + { + return new spell_summon_minions_SpellScript(); + } }; void AddSC_boss_novos() { new boss_novos(); - new mob_crystal_handler(); - new mob_novos_minion(); + new npc_crystal_channel_target(); + new spell_summon_minions(); new achievement_oh_novos(); } diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp index 4cbabe2449a..1f30b805f8a 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp index 60001e048a3..bcec5fc1547 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h b/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h index 46d6414978f..e17cba4bccd 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h +++ b/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -31,9 +31,16 @@ enum Data64 DATA_NOVOS, DATA_DRED, DATA_THARON_JA, + DATA_NOVOS_CRYSTAL_1, DATA_NOVOS_CRYSTAL_2, DATA_NOVOS_CRYSTAL_3, - DATA_NOVOS_CRYSTAL_4 + DATA_NOVOS_CRYSTAL_4, + DATA_NOVOS_SUMMONER_1, + DATA_NOVOS_SUMMONER_2, + DATA_NOVOS_SUMMONER_3, + DATA_NOVOS_SUMMONER_4, + + ACTION_CRYSTAL_HANDLER_DIED }; #endif 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 552798e96eb..28bea60fb87 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,6 +16,7 @@ */ #include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "InstanceScript.h" #include "drak_tharon_keep.h" @@ -30,17 +31,23 @@ enum Creatures { - NPC_TROLLGORE = 26630, - NPC_NOVOS = 26631, - NPC_KING_DRED = 27483, - NPC_THARON_JA = 26632 + NPC_TROLLGORE = 26630, + NPC_NOVOS = 26631, + NPC_KING_DRED = 27483, + NPC_THARON_JA = 26632, + NPC_CRYSTAL_CHANNEL_TARGET = 26712, + NPC_CRYSTAL_HANDLER = 26627 }; enum GameObjects { - GO_NOVOS_CRYSTAL_1 = 189299, - GO_NOVOS_CRYSTAL_2 = 189300, - GO_NOVOS_CRYSTAL_3 = 189301, - GO_NOVOS_CRYSTAL_4 = 189302 + GO_NOVOS_CRYSTAL_1 = 189299, + GO_NOVOS_CRYSTAL_2 = 189300, + GO_NOVOS_CRYSTAL_3 = 189301, + GO_NOVOS_CRYSTAL_4 = 189302 +}; +enum Achievements +{ + ACM_CRITERIA_OH_NOVOS = 7361 }; class instance_drak_tharon : public InstanceMapScript @@ -52,17 +59,22 @@ public: { instance_drak_tharon_InstanceScript(Map* map) : InstanceScript(map) {} - uint8 uiDredAchievCounter; + uint8 dredAchievCounter; - uint64 uiTrollgore; - uint64 uiNovos; - uint64 uiDred; - uint64 uiTharonJa; + uint64 trollgoreGUID; + uint64 novosGUID; + uint64 dredGUID; + uint64 tharonJaGUID; - uint64 uiNovosCrystal1; - uint64 uiNovosCrystal2; - uint64 uiNovosCrystal3; - uint64 uiNovosCrystal4; + uint64 novosCrystalGUID1; + uint64 novosCrystalGUID2; + uint64 novosCrystalGUID3; + uint64 novosCrystalGUID4; + + uint64 novosSummonerGUID1; + uint64 novosSummonerGUID2; + uint64 novosSummonerGUID3; + uint64 novosSummonerGUID4; uint16 m_auiEncounter[MAX_ENCOUNTER]; @@ -71,15 +83,23 @@ public: void Initialize() { memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - uiTrollgore = 0; - uiNovos = 0; - uiDred = 0; - uiTharonJa = 0; - uiNovosCrystal1 = 0; - uiNovosCrystal2 = 0; - uiNovosCrystal3 = 0; - uiNovosCrystal4 = 0; - uiDredAchievCounter = 0; + + dredAchievCounter = 0; + + trollgoreGUID = 0; + novosGUID = 0; + dredGUID = 0; + tharonJaGUID = 0; + + novosCrystalGUID1 = 0; + novosCrystalGUID2 = 0; + novosCrystalGUID3 = 0; + novosCrystalGUID4 = 0; + + novosSummonerGUID1 = 0; + novosSummonerGUID2 = 0; + novosSummonerGUID3 = 0; + novosSummonerGUID4 = 0; } bool IsEncounterInProgress() const @@ -96,16 +116,20 @@ public: switch (go->GetEntry()) { case GO_NOVOS_CRYSTAL_1: - uiNovosCrystal1 = go->GetGUID(); + novosCrystalGUID1 = go->GetGUID(); + go->SetGoState(GO_STATE_READY); break; case GO_NOVOS_CRYSTAL_2: - uiNovosCrystal2 = go->GetGUID(); + novosCrystalGUID2 = go->GetGUID(); + go->SetGoState(GO_STATE_READY); break; case GO_NOVOS_CRYSTAL_3: - uiNovosCrystal3 = go->GetGUID(); + novosCrystalGUID3 = go->GetGUID(); + go->SetGoState(GO_STATE_READY); break; case GO_NOVOS_CRYSTAL_4: - uiNovosCrystal4 = go->GetGUID(); + novosCrystalGUID4 = go->GetGUID(); + go->SetGoState(GO_STATE_READY); break; } } @@ -115,32 +139,55 @@ public: switch (creature->GetEntry()) { case NPC_TROLLGORE: - uiTrollgore = creature->GetGUID(); + trollgoreGUID = creature->GetGUID(); break; case NPC_NOVOS: - uiNovos = creature->GetGUID(); + novosGUID = creature->GetGUID(); break; case NPC_KING_DRED: - uiDred = creature->GetGUID(); + dredGUID = creature->GetGUID(); break; case NPC_THARON_JA: - uiTharonJa = creature->GetGUID(); + tharonJaGUID = creature->GetGUID(); + break; + case NPC_CRYSTAL_CHANNEL_TARGET: + InitializeNovosSummoner(creature); break; } } + void InitializeNovosSummoner(Creature* creature) + { + float x = creature->GetPositionX(); + float y = creature->GetPositionY(); + float z = creature->GetPositionZ(); + + if (x < -374.0f && x > -379.0f && y > -820.0f && y < -815.0f && z < 60.0f && z > 58.0f) + novosSummonerGUID1 = creature->GetGUID(); + else if (x < -379.0f && x > -385.0f && y > -820.0f && y < -815.0f && z < 60.0f && z > 58.0f) + novosSummonerGUID2 = creature->GetGUID(); + else if (x < -374.0f && x > -385.0f && y > -827.0f && y < -820.0f && z < 60.0f && z > 58.0f) + novosSummonerGUID3 = creature->GetGUID(); + else if (x < -338.0f && x > -344.0f && y > -727.0f && y < 721.0f && z < 30.0f && z > 26.0f) + novosSummonerGUID4 = creature->GetGUID(); + } + uint64 GetData64(uint32 identifier) const { switch (identifier) { - case DATA_TROLLGORE: return uiTrollgore; - case DATA_NOVOS: return uiNovos; - case DATA_DRED: return uiDred; - case DATA_THARON_JA: return uiTharonJa; - case DATA_NOVOS_CRYSTAL_1: return uiNovosCrystal1; - case DATA_NOVOS_CRYSTAL_2: return uiNovosCrystal2; - case DATA_NOVOS_CRYSTAL_3: return uiNovosCrystal3; - case DATA_NOVOS_CRYSTAL_4: return uiNovosCrystal4; + case DATA_TROLLGORE: return trollgoreGUID; + case DATA_NOVOS: return novosGUID; + case DATA_DRED: return dredGUID; + case DATA_THARON_JA: return tharonJaGUID; + case DATA_NOVOS_CRYSTAL_1: return novosCrystalGUID1; + case DATA_NOVOS_CRYSTAL_2: return novosCrystalGUID2; + case DATA_NOVOS_CRYSTAL_3: return novosCrystalGUID3; + case DATA_NOVOS_CRYSTAL_4: return novosCrystalGUID4; + case DATA_NOVOS_SUMMONER_1: return novosSummonerGUID1; + case DATA_NOVOS_SUMMONER_2: return novosSummonerGUID2; + case DATA_NOVOS_SUMMONER_3: return novosSummonerGUID3; + case DATA_NOVOS_SUMMONER_4: return novosSummonerGUID4; } return 0; @@ -164,7 +211,7 @@ public: break; case DATA_KING_DRED_ACHIEV: - uiDredAchievCounter = data; + dredAchievCounter = data; break; } @@ -182,7 +229,7 @@ public: case DATA_NOVOS_EVENT: return m_auiEncounter[1]; case DATA_DRED_EVENT: return m_auiEncounter[2]; case DATA_THARON_JA_EVENT: return m_auiEncounter[3]; - case DATA_KING_DRED_ACHIEV: return uiDredAchievCounter; + case DATA_KING_DRED_ACHIEV: return dredAchievCounter; } return 0; } @@ -199,6 +246,14 @@ public: return saveStream.str(); } + void OnUnitDeath(Unit* unit) + { + if (unit->GetEntry() == NPC_CRYSTAL_HANDLER) + if (novosGUID) + if (Creature* novos = instance->GetCreature(novosGUID)) + novos->AI()->DoAction(ACTION_CRYSTAL_HANDLER_DIED); + } + void Load(const char* in) { if (!in) diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp index 1940ff4e2af..261eb854aa3 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp index 248fe3c6eb0..caf38fd2418 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp index 895efd84580..b5d95dfb0f6 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.h b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.h index ca68314df18..d404f9daf9c 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.h +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp index 3afc248ab9d..5014f78c9a3 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp index bb3028518ec..2278bfe409a 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp index 697e8cfb664..1d7e405585f 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index d4e3a9e677d..e0a2f90b082 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -70,7 +70,7 @@ enum Yells SAY_FALRIC_INTRO_1 = 5, SAY_FALRIC_INTRO_2 = 6, - SAY_MARWYN_INTRO_1 = 0 + SAY_MARWYN_INTRO_1 = 4 }; enum Events diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h index 1557fd1a56b..a8bd92cc070 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp index 2e0c3364bbd..3b910c39e38 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp index e8557482420..160d45f5140 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp index ed196d2cd0c..f657c8e19b5 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -226,13 +226,13 @@ class boss_ick : public CreatureScript case EVENT_TOXIC_WASTE: if (Creature* krick = GetKrick()) if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - krick->CastSpell(target, SPELL_TOXIC_WASTE, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE); + krick->CastSpell(target, SPELL_TOXIC_WASTE); events.ScheduleEvent(EVENT_TOXIC_WASTE, urand(7000, 10000)); break; case EVENT_SHADOW_BOLT: if (Creature* krick = GetKrick()) if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) - krick->CastSpell(target, SPELL_SHADOW_BOLT, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE); + krick->CastSpell(target, SPELL_SHADOW_BOLT); events.ScheduleEvent(EVENT_SHADOW_BOLT, 15000); return; case EVENT_MIGHTY_KICK: @@ -322,7 +322,7 @@ class boss_krick : public CreatureScript void KilledUnit(Unit* victim) { - if (victim == me) + if (victim->GetTypeId() != TYPEID_PLAYER) return; Talk(SAY_KRICK_SLAY); 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 969a3621e8e..783cc266509 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -29,7 +29,7 @@ enum Yells SAY_GORKUN_INTRO_2 = 0, SAY_GORKUN_OUTRO_1 = 1, SAY_GORKUN_OUTRO_2 = 2, - + //Tyrannus SAY_AMBUSH_1 = 3, SAY_AMBUSH_2 = 4, @@ -43,7 +43,7 @@ enum Yells SAY_MARK_RIMEFANG_2 = 12, SAY_DARK_MIGHT_1 = 13, SAY_DARK_MIGHT_2 = 14, - + //Jaina SAY_JAYNA_OUTRO_3 = 3, SAY_JAYNA_OUTRO_4 = 4, diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp index df0829b3376..fa2805bdb4c 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp index eba19403517..246d389e0e7 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h index 768c3ba40ec..94bca5ffaf7 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp index 3724aaf69e2..58301df4ca2 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp index b75c5cbc2a9..d169fb163b2 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp index a7933fed046..baba9d5396b 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp b/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp index d5e10aedd70..8f325dafc82 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp index cdbce68e337..4acabc3b2b3 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Gundrak/gundrak.h b/src/server/scripts/Northrend/Gundrak/gundrak.h index 4c1c04c5559..0c65b4d16de 100644 --- a/src/server/scripts/Northrend/Gundrak/gundrak.h +++ b/src/server/scripts/Northrend/Gundrak/gundrak.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp index b8b9c2e9053..a9bbffa5fb0 100644 --- a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp +++ b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index f28b94c858e..cb073b1c569 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index 2b240bc93d8..c8caa3976e4 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -62,6 +62,9 @@ enum Spells SPELL_INCITE_TERROR = 73070, SPELL_BLOODBOLT_WHIRL = 71772, SPELL_ANNIHILATE = 71322, + + // Blood Infusion + SPELL_BLOOD_INFUSION_CREDIT = 72934 }; enum Shadowmourne @@ -182,6 +185,10 @@ class boss_blood_queen_lana_thel : public CreatureScript { _JustDied(); Talk(SAY_DEATH); + + if (Is25ManRaid() && me->HasAura(SPELL_SHADOWS_FATE)) + DoCastAOE(SPELL_BLOOD_INFUSION_CREDIT, true); + CleanAuras(); // Blah, credit the quest if (_creditBloodQuickening) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 9ee4bcea4d9..23e4fc19dd2 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -1218,6 +1218,12 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader if (targetsAtRange < minTargets) targetsAtRange = std::min<uint32>(targets.size() - 1, minTargets); + if (!targetsAtRange) + { + targets.clear(); + return; + } + std::list<WorldObject*>::const_iterator itr = targets.begin(); std::advance(itr, urand(0, targetsAtRange)); target = *itr; @@ -1228,10 +1234,10 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader // use the same target for first and second effect void FilterTargetsSubsequent(std::list<WorldObject*>& unitList) { + unitList.clear(); if (!target) return; - unitList.clear(); unitList.push_back(target); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp index 9c0f2139b1b..70cb585422d 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index 8e7f891663e..4e677bf5b0e 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 263d70c6a50..e751ec2bd7b 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 4727504a4bd..05bf7b9794a 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -25,7 +25,7 @@ #include "Vehicle.h" #include "GridNotifiers.h" -enum ScriptTexts +enum Say { // Festergut SAY_FESTERGUT_GASEOUS_BLIGHT = 0, @@ -45,68 +45,71 @@ enum ScriptTexts EMOTE_CHOKING_GAS_BOMB = 10, SAY_KILL = 11, SAY_BERSERK = 12, - SAY_DEATH = 13, + SAY_DEATH = 13 }; enum Spells { // Festergut - SPELL_RELEASE_GAS_VISUAL = 69125, - SPELL_GASEOUS_BLIGHT_LARGE = 69157, - SPELL_GASEOUS_BLIGHT_MEDIUM = 69162, - SPELL_GASEOUS_BLIGHT_SMALL = 69164, - SPELL_MALLABLE_GOO_H = 70852, + SPELL_RELEASE_GAS_VISUAL = 69125, + SPELL_GASEOUS_BLIGHT_LARGE = 69157, + SPELL_GASEOUS_BLIGHT_MEDIUM = 69162, + SPELL_GASEOUS_BLIGHT_SMALL = 69164, + SPELL_MALLABLE_GOO_H = 70852, // Rotface - SPELL_VILE_GAS_H = 69240, + SPELL_VILE_GAS_H = 69240, // Professor Putricide - SPELL_SLIME_PUDDLE_TRIGGER = 70341, - SPELL_MALLEABLE_GOO = 70852, - SPELL_UNSTABLE_EXPERIMENT = 70351, - SPELL_TEAR_GAS = 71617, // phase transition - SPELL_TEAR_GAS_CREATURE = 71618, - SPELL_TEAR_GAS_CANCEL = 71620, - SPELL_TEAR_GAS_PERIODIC_TRIGGER = 73170, - SPELL_CREATE_CONCOCTION = 71621, - SPELL_GUZZLE_POTIONS = 71893, - SPELL_OOZE_TANK_PROTECTION = 71770, // protects the tank - SPELL_CHOKING_GAS_BOMB = 71255, - SPELL_OOZE_VARIABLE = 74118, - SPELL_GAS_VARIABLE = 74119, - SPELL_UNBOUND_PLAGUE = 70911, - SPELL_UNBOUND_PLAGUE_SEARCHER = 70917, - SPELL_PLAGUE_SICKNESS = 70953, - SPELL_UNBOUND_PLAGUE_PROTECTION = 70955, - SPELL_MUTATED_PLAGUE = 72451, - SPELL_MUTATED_PLAGUE_CLEAR = 72618, + SPELL_SLIME_PUDDLE_TRIGGER = 70341, + SPELL_MALLEABLE_GOO = 70852, + SPELL_UNSTABLE_EXPERIMENT = 70351, + SPELL_TEAR_GAS = 71617, // phase transition + SPELL_TEAR_GAS_CREATURE = 71618, + SPELL_TEAR_GAS_CANCEL = 71620, + SPELL_TEAR_GAS_PERIODIC_TRIGGER = 73170, + SPELL_CREATE_CONCOCTION = 71621, + SPELL_GUZZLE_POTIONS = 71893, + SPELL_OOZE_TANK_PROTECTION = 71770, // protects the tank + SPELL_CHOKING_GAS_BOMB = 71255, + SPELL_OOZE_VARIABLE = 74118, + SPELL_GAS_VARIABLE = 74119, + SPELL_UNBOUND_PLAGUE = 70911, + SPELL_UNBOUND_PLAGUE_SEARCHER = 70917, + SPELL_PLAGUE_SICKNESS = 70953, + SPELL_UNBOUND_PLAGUE_PROTECTION = 70955, + SPELL_MUTATED_PLAGUE = 72451, + SPELL_MUTATED_PLAGUE_CLEAR = 72618, // Slime Puddle - SPELL_GROW_STACKER = 70345, - SPELL_GROW = 70347, - SPELL_SLIME_PUDDLE_AURA = 70343, + SPELL_GROW_STACKER = 70345, + SPELL_GROW = 70347, + SPELL_SLIME_PUDDLE_AURA = 70343, // Gas Cloud - SPELL_GASEOUS_BLOAT_PROC = 70215, - SPELL_GASEOUS_BLOAT = 70672, - SPELL_GASEOUS_BLOAT_PROTECTION = 70812, - SPELL_EXPUNGED_GAS = 70701, + SPELL_GASEOUS_BLOAT_PROC = 70215, + SPELL_GASEOUS_BLOAT = 70672, + SPELL_GASEOUS_BLOAT_PROTECTION = 70812, + SPELL_EXPUNGED_GAS = 70701, // Volatile Ooze - SPELL_OOZE_ERUPTION = 70492, - SPELL_VOLATILE_OOZE_ADHESIVE = 70447, - SPELL_OOZE_ERUPTION_SEARCH_PERIODIC = 70457, - SPELL_VOLATILE_OOZE_PROTECTION = 70530, + SPELL_OOZE_ERUPTION = 70492, + SPELL_VOLATILE_OOZE_ADHESIVE = 70447, + SPELL_OOZE_ERUPTION_SEARCH_PERIODIC = 70457, + SPELL_VOLATILE_OOZE_PROTECTION = 70530, // Choking Gas Bomb - SPELL_CHOKING_GAS_BOMB_PERIODIC = 71259, - SPELL_CHOKING_GAS_EXPLOSION_TRIGGER = 71280, + SPELL_CHOKING_GAS_BOMB_PERIODIC = 71259, + SPELL_CHOKING_GAS_EXPLOSION_TRIGGER = 71280, // Mutated Abomination vehicle - SPELL_ABOMINATION_VEHICLE_POWER_DRAIN = 70385, - SPELL_MUTATED_TRANSFORMATION = 70311, - SPELL_MUTATED_TRANSFORMATION_DAMAGE = 70405, - SPELL_MUTATED_TRANSFORMATION_NAME = 72401, + SPELL_ABOMINATION_VEHICLE_POWER_DRAIN = 70385, + SPELL_MUTATED_TRANSFORMATION = 70311, + SPELL_MUTATED_TRANSFORMATION_DAMAGE = 70405, + SPELL_MUTATED_TRANSFORMATION_NAME = 72401, + + // Unholy Infusion + SPELL_UNHOLY_INFUSION_CREDIT = 71518 }; #define SPELL_GASEOUS_BLOAT_HELPER RAID_MODE<uint32>(70672, 72455, 72832, 72833) @@ -132,7 +135,7 @@ enum Events EVENT_CHOKING_GAS_BOMB = 12, EVENT_UNBOUND_PLAGUE = 13, EVENT_MUTATED_PLAGUE = 14, - EVENT_PHASE_TRANSITION = 15, + EVENT_PHASE_TRANSITION = 15 }; enum Phases @@ -145,14 +148,14 @@ enum Phases PHASE_COMBAT_3 = 6, PHASE_MASK_COMBAT = (1 << PHASE_COMBAT_1) | (1 << PHASE_COMBAT_2) | (1 << PHASE_COMBAT_3), - PHASE_MASK_NOT_SELF = (1 << PHASE_FESTERGUT) | (1 << PHASE_ROTFACE), + PHASE_MASK_NOT_SELF = (1 << PHASE_FESTERGUT) | (1 << PHASE_ROTFACE) }; enum Points { POINT_FESTERGUT = 366260, POINT_ROTFACE = 366270, - POINT_TABLE = 366780, + POINT_TABLE = 366780 }; Position const festergutWatchPos = {4324.820f, 3166.03f, 389.3831f, 3.316126f}; //emote 432 (release gas) @@ -166,7 +169,7 @@ enum PutricideData { DATA_EXPERIMENT_STAGE = 1, DATA_PHASE = 2, - DATA_ABOMINATION = 3, + DATA_ABOMINATION = 3 }; #define EXPERIMENT_STATE_OOZE false @@ -293,6 +296,10 @@ class boss_professor_putricide : public CreatureScript { _JustDied(); Talk(SAY_DEATH); + + if (Is25ManRaid() && me->HasAura(SPELL_SHADOWS_FATE)) + DoCastAOE(SPELL_UNHOLY_INFUSION_CREDIT, true); + DoCast(SPELL_MUTATED_PLAGUE_CLEAR); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index 03427a4cfc2..db5f373a753 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 96cabfed918..45c5302bfe8 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -82,6 +82,9 @@ enum Spells SPELL_FOCUS_FIRE = 71350, SPELL_ORDER_WHELP = 71357, SPELL_CONCUSSIVE_SHOCK = 71337, + + // Frost Infusion + SPELL_FROST_INFUSION_CREDIT = 72289 }; enum Events @@ -229,10 +232,14 @@ class boss_sindragosa : public CreatureScript } } - void JustDied(Unit* killer) + void JustDied(Unit* /* killer */) { - BossAI::JustDied(killer); + _JustDied(); Talk(SAY_DEATH); + + if (Is25ManRaid() && me->HasAura(SPELL_SHADOWS_FATE)) + DoCastAOE(SPELL_FROST_INFUSION_CREDIT, true); + } void EnterCombat(Unit* victim) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index ec5172aeb83..452d09cf65f 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index cc40a076300..df23abd8312 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 17e33912a86..12868094b2e 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h index 4e117d9f3e3..1407568686f 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -54,6 +54,9 @@ enum SharedSpells // The Lich King SPELL_ARTHAS_TELEPORTER_CEREMONY = 72915, SPELL_FROSTMOURNE_TELEPORT_VISUAL = 73078, + + // Shadowmourne questline + SPELL_SHADOWS_FATE = 71169 }; enum TeleporterSpells diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp index 7ff995d4bcf..1efee1b45ba 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index 89d7b0f764d..462708360e3 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp index 61ce8817b17..14e2d05a7c1 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp index 58db1d9caea..4d5efe4e89c 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index 7785044e7d1..e037f627bee 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp index 69443b2824e..c735107968a 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index 14043f00939..21f3141393a 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp index 7ed9e950b53..f3f2e587178 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp index 0018c58f4cb..c88ac807421 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -117,12 +117,16 @@ public: events.ScheduleEvent(EVENT_FEVER, urand(15000, 20000)); events.ScheduleEvent(EVENT_PHASE, 90000); events.ScheduleEvent(EVENT_ERUPT, 15000); + me->GetMotionMaster()->MoveChase(me->getVictim()); } else { float x, y, z, o; me->GetHomePosition(x, y, z, o); - me->NearTeleportTo(x, y, z, o); + me->NearTeleportTo(x, y, z, o - G3D::halfPi()); + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveIdle(); + me->SetTarget(0); DoCastAOE(SPELL_PLAGUE_CLOUD); events.ScheduleEvent(EVENT_PHASE, 45000); events.ScheduleEvent(EVENT_ERUPT, 8000); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 183fb40e5a0..35f703e0563 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp b/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp index 183d56a48c0..75fe66b9faf 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp index 8ec9bac7e86..28def13a0d2 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp index b670e36fa96..89b65615a2e 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp index d4b3f5ddce0..e77a9708ba5 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp index d733cac001c..52dfd60f5f8 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index aebd7fdc19c..cd68d7ecac3 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index c86cf1e9f28..6c09e7156fe 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp index b68d8d4a33c..d16252ad05e 100644 --- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp +++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Naxxramas/naxxramas.h b/src/server/scripts/Northrend/Naxxramas/naxxramas.h index 43393aff844..1f4955f4ddb 100644 --- a/src/server/scripts/Northrend/Naxxramas/naxxramas.h +++ b/src/server/scripts/Northrend/Naxxramas/naxxramas.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 5e7104fd83a..952363c6dcf 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -35,10 +35,13 @@ Script Data End */ #include "eye_of_eternity.h" #include "ScriptedEscortAI.h" #include "Player.h" +#include "Vehicle.h" +#include "CombatAI.h" +#include "CreatureTextMgr.h" enum Achievements { - ACHIEV_TIMED_START_EVENT = 20387, + ACHIEV_TIMED_START_EVENT = 20387, }; enum Events @@ -132,25 +135,36 @@ enum MalygosEvents #define TEN_MINUTES 600000 -enum MalygosSays +enum Texts { - SAY_AGGRO_P_ONE, - SAY_KILLED_PLAYER_P_ONE, - SAY_END_P_ONE, - SAY_AGGRO_P_TWO, - SAY_ANTI_MAGIC_SHELL, // not sure when execute it - SAY_MAGIC_BLAST, // not sure when execute it - SAY_KILLED_PLAYER_P_TWO, - SAY_END_P_TWO, - SAY_INTRO_P_THREE, - SAY_AGGRO_P_THREE, - SAY_SURGE_POWER, // not sure when execute it - SAY_BUFF_SPARK, - SAY_KILLED_PLAYER_P_THREE, - SAY_SPELL_CASTING_P_THREE, - SAY_DEATH + // Malygos + SAY_AGGRO_P_ONE = 0, + SAY_KILLED_PLAYER_P_ONE = 1, + SAY_END_P_ONE = 2, + SAY_AGGRO_P_TWO = 3, + SAY_ANTI_MAGIC_SHELL = 4, // not sure when execute it + SAY_MAGIC_BLAST = 5, // not sure when execute it + SAY_KILLED_PLAYER_P_TWO = 6, + SAY_END_P_TWO = 7, + SAY_INTRO_P_THREE = 8, + SAY_AGGRO_P_THREE = 9, + SAY_SURGE_POWER = 10, // not sure when execute it + SAY_BUFF_SPARK = 11, + SAY_KILLED_PLAYER_P_THREE = 12, + SAY_SPELL_CASTING_P_THREE = 13, + SAY_DEATH, + + // Alexstrasza + SAY_ONE = 0, + SAY_TWO = 1, + SAY_THREE = 2, + SAY_FOUR = 3, + + // Power Sparks + EMOTE_POWER_SPARK_SUMMONED = 0 }; + #define MAX_HOVER_DISK_WAYPOINTS 18 // Sniffed data (x, y,z) @@ -178,7 +192,7 @@ const Position HoverDiskWaypoints[MAX_HOVER_DISK_WAYPOINTS] = #define GROUND_Z 268 -// Source: Sniffs (x, y,z) +// Source: Sniffs (x,y,z) #define MALYGOS_MAX_WAYPOINTS 16 const Position MalygosPhaseTwoWaypoints[MALYGOS_MAX_WAYPOINTS] = { @@ -316,6 +330,7 @@ public: // The rest is handled in the AI of the vehicle. target->CastSpell(target, SPELL_SUMMOM_RED_DRAGON, true); + me->Attack(target, false); } } @@ -748,13 +763,18 @@ public: _instance = creature->GetInstanceScript(); } - void Reset() + void SpellHit(Unit* /*caster*/, const SpellInfo* spell) { - _summonTimer = urand(5, 7)*IN_MILLISECONDS; + if (spell->Id == SPELL_PORTAL_OPENED) + { + DoCast(me, SPELL_SUMMON_POWER_PARK, true); + } } - void UpdateAI(uint32 const diff) + void UpdateAI(uint32 const /*diff*/) { + // When duration of oppened riff visual ends, + // closed one should be cast if (!me->HasAura(SPELL_PORTAL_VISUAL_CLOSED) && !me->HasAura(SPELL_PORTAL_OPENED)) DoCast(me, SPELL_PORTAL_VISUAL_CLOSED, true); @@ -770,16 +790,6 @@ public: } } } - - if (!me->HasAura(SPELL_PORTAL_OPENED)) - return; - - if (_summonTimer <= diff) - { - DoCast(SPELL_SUMMON_POWER_PARK); - _summonTimer = urand(5, 7)*IN_MILLISECONDS; - } else - _summonTimer -= diff; } void JustSummoned(Creature* summon) @@ -811,6 +821,8 @@ public: _instance = creature->GetInstanceScript(); MoveToMalygos(); + // Talk range was not enough for this encounter + sCreatureTextMgr->SendChat(me, EMOTE_POWER_SPARK_SUMMONED, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP); } void EnterEvadeMode() @@ -853,14 +865,9 @@ public: } } - void DamageTaken(Unit* /*done_by*/, uint32& damage) + void JustDied(Unit* /*killer*/) { - if (damage > me->GetMaxHealth()) - { - damage = 0; - DoCast(me, SPELL_POWER_SPARK_DEATH, true); - me->DespawnOrUnsummon(1000); - } + me->CastSpell(me, SPELL_POWER_SPARK_DEATH, true); // not supposed to hide the fact it's there by not selectable } private: @@ -903,8 +910,7 @@ public: else { // Error found: This is not called if the passenger is a player - - if (unit->GetTypeId() == TYPEID_UNIT) + if (unit->GetTypeId() == TYPEID_UNIT || unit->GetTypeId() == TYPEID_PLAYER) { // This will only be called if the passenger dies if (_instance) @@ -1012,7 +1018,7 @@ public: }; }; -// SmartAI does not work correctly for this (vehicles) +// SmartAI does not work correctly for vehicles class npc_wyrmrest_skytalon : public CreatureScript { public: @@ -1023,14 +1029,13 @@ public: return new npc_wyrmrest_skytalonAI (creature); } - struct npc_wyrmrest_skytalonAI : public NullCreatureAI + struct npc_wyrmrest_skytalonAI : public VehicleAI { - npc_wyrmrest_skytalonAI(Creature* creature) : NullCreatureAI(creature) - { - _instance = creature->GetInstanceScript(); + npc_wyrmrest_skytalonAI(Creature* creature) : VehicleAI(creature) { } - _timer = 1000; - _entered = false; + void IsSummonedBy(Unit* summoner) + { + summoner->CastSpell(me, SPELL_RIDE_RED_DRAGON, true); } void PassengerBoarded(Unit* /*unit*/, int8 /*seat*/, bool apply) @@ -1038,54 +1043,9 @@ public: if (!apply) me->DespawnOrUnsummon(); } - - // we can't call this in reset function, it fails. - void MakePlayerEnter() - { - if (!_instance) - return; - - if (Unit* summoner = me->ToTempSummon()->GetSummoner()) - { - if (Creature* malygos = Unit::GetCreature(*me, _instance->GetData64(DATA_MALYGOS))) - { - summoner->CastSpell(me, SPELL_RIDE_RED_DRAGON, true); - float victimThreat = malygos->getThreatManager().getThreat(summoner); - malygos->getThreatManager().resetAllAggro(); - malygos->AI()->AttackStart(me); - malygos->AddThreat(me, victimThreat); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!_entered) - { - if (_timer <= diff) - { - MakePlayerEnter(); - _entered = true; - } else - _timer -= diff; - } - } - - private: - InstanceScript* _instance; - uint32 _timer; - bool _entered; }; }; -enum AlexstraszaYells -{ - SAY_ONE, - SAY_TWO, - SAY_THREE, - SAY_FOUR -}; - class npc_alexstrasza_eoe : public CreatureScript { public: diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h b/src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h index b16cbffcd1c..c25feaafaf8 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp index 4ca28943be3..6b1be15f110 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp index 2d89e5db0f0..955c6b801af 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp index 5463f6c9045..fedb1f5cebc 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp index 1af1edcdf71..39c93f15d6f 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp index c110a4a3e85..d1a9227c6fb 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp index c8d3cc6416c..7679ae53c80 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp index 11b1bce9ab7..c9cfe70b8de 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp index f06800cd201..81d5141a6a6 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/Nexus/Nexus/nexus.h b/src/server/scripts/Northrend/Nexus/Nexus/nexus.h index cb88be89afd..7f3c96bcb33 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/nexus.h +++ b/src/server/scripts/Northrend/Nexus/Nexus/nexus.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp index 60f9a3ddc9a..feb801450b1 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp index 4bbb4c1a5ed..0af498f24c6 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -34,9 +34,12 @@ enum Events enum Says { - SAY_AGGRO = 0, - SAY_ENRAGE = 1, - SAY_DEATH = 2 + SAY_SPAWN = 0, + SAY_AGGRO = 1, + SAY_ENRAGE = 2, + SAY_KILL = 3, + SAY_DEATH = 4, + SAY_SHIELD = 5, }; enum Spells @@ -101,6 +104,11 @@ public: DoAction(ACTION_SET_NORMAL_EVENTS); } + void KilledUnit(Unit* /*victim*/) + { + Talk(SAY_KILL); + } + void EnterCombat(Unit* /*who*/) { _EnterCombat(); @@ -176,6 +184,7 @@ public: events.Reset(); _phase = (me->GetHealthPct() < 60.0f && me->GetHealthPct() > 20.0f) ? PHASE_FIRST_PLANAR : PHASE_SECOND_PLANAR; + Talk(SAY_SHIELD); DoCast(SPELL_PLANAR_SHIFT); // not sure about the amount, and if we should despawn previous spawns (dragon trashs) diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp index ffd5e53e787..07f19ce9760 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index 6d9450daf21..ec240db0b69 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp index 7035e0534aa..fcd23b0ce6d 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index 0e73e929aef..f152d0011aa 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.h b/src/server/scripts/Northrend/Nexus/Oculus/oculus.h index c536b43f905..2dd5df3bc3b 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.h +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp index 72ab5259693..16e705e45ab 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp index 6f54ce50a94..6f017884063 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index f42fd87c643..df99ab33467 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp index a7dae9aba78..9b22003bb1c 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h index d5bca9c257d..9968a27da93 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp index e399c5548e3..ddc0b7376ac 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp index 747bd699c81..c9a4d2ba5bd 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp index 4511b8b0f1e..7fbf5f3ee79 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp index 326779661cc..9e4c97ea0fc 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp index 6b51d923517..f1d690f32e0 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h index a6f1eb86178..d7c0b37b14e 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp index 7a2b579dca9..41339c9346d 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index e52f1efcd73..1f96848fa0a 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp index db8c7f38ef7..451ad6ed915 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index bd063877d39..aa8c7a96898 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 921d67d6d65..89ddbb7ac38 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index b894706e0bf..4db3b58c53f 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp index 43d203daedf..6fa2c7127e6 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index 8247236016c..26d15d78e59 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp index 8f68542d462..f525bc874f7 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -208,7 +208,7 @@ class boss_ignis : public CreatureScript switch (eventId) { case EVENT_JET: - me->MonsterTextEmote(EMOTE_JETS, 0, true); + Talk(EMOTE_JETS); DoCast(me, SPELL_FLAME_JETS); events.ScheduleEvent(EVENT_JET, urand(35000, 40000)); break; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index c1fc0a81989..24282340278 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp index b5c907af7f0..fe7f72e3766 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index 9643b2ec9ab..79edede01df 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> -* -* 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 <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> + * + * 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 <http://www.gnu.org/licenses/>. + */ //TODO: Harpoon chain from 62505 should not get removed when other chain is applied @@ -1084,7 +1084,7 @@ class achievement_quick_shave : public AchievementCriteriaScript bool OnCheck(Player* /*source*/, Unit* target) { - if (target) + if (target) if (Creature* razorscale = target->ToCreature()) if (razorscale->AI()->GetData(DATA_QUICK_SHAVE)) return true; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp index 82845d10b8c..564087088d3 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index 09ab35d6589..43d19d78f8a 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp index 20d6a7a40da..4bcb1b9e584 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index b334b8dcbed..7934f6fba72 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h index 4dff89f7b2c..08fd95d0e26 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp index ab2f778ba9d..e5c617ff786 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it 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 4fe56b346b2..1fd84b6f6ce 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp index 9a50e1cbfa3..d709182bf04 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp index aad4c9989c1..05822aa2595 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp index c236b36312d..30521d0d275 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp index e587a864fd6..7103095b252 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h index 971dab98f4d..73ff0075aba 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp index d2772514edf..36506227287 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index 45bab11c46a..2514cb3de78 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index fc82ad1b526..9468a111db5 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp index 96cfee7c2b8..99d987e63a4 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp index a76c5a61109..3024a6e7962 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h index 872314ee25e..37113661dad 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp index 8a5e25e4487..33e0619c7e5 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -21,7 +21,8 @@ enum { - EMOTE_BERSERK = 0 + EMOTE_BERSERK = 0, + EMOTE_LEAP = 1 // Not in use }; //Spells Archavon @@ -38,9 +39,6 @@ enum //4 Warders spawned #define ARCHAVON_WARDER 32353 //npc 32353 -//Yell -#define SAY_LEAP "Archavon the Stone Watcher lunges for $N!" //$N should be the target - enum Events { // Archavon diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp index b61bb20389d..b8b6acce54d 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp index 31003addf1f..fafeba6a570 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp index 9c60673522c..613b8ebf8dc 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp index de557e10e7f..3534330e6f4 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h b/src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h index 9242a5df1eb..03776525174 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h +++ b/src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp index 7b1b9e96baf..1f12685a4b0 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp index 15cd12140cf..6c16bb98ff1 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp index fba7efe43ab..fb4297f595f 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp index 510e9874dd7..dc0b320b307 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp index f368b07077a..d40f3b14f87 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp index 429b2ac32ea..92ced3c702f 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp index 5216ae9f08d..cf0ee82c01c 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp index c1c93c789de..11887e732ed 100644 --- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index 5e326af9891..5ebc2eaf973 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.h b/src/server/scripts/Northrend/VioletHold/violet_hold.h index 2a0032bac95..e6a7553e81b 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.h +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/isle_of_conquest.cpp b/src/server/scripts/Northrend/isle_of_conquest.cpp index 88d262a1579..93886ed0e74 100644 --- a/src/server/scripts/Northrend/isle_of_conquest.cpp +++ b/src/server/scripts/Northrend/isle_of_conquest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index 628de0238e0..8e7507bce61 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -931,7 +931,7 @@ enum eThassarian SAY_LICH_1 = 0, SAY_LICH_2 = 1, SAY_LICH_3 = 2, - + SAY_ARLOS_1 = 0, SAY_ARLOS_2 = 1, diff --git a/src/server/scripts/Northrend/crystalsong_forest.cpp b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp index 09df0acc467..d12b5176b15 100644 --- a/src/server/scripts/Northrend/crystalsong_forest.cpp +++ b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/dalaran.cpp b/src/server/scripts/Northrend/zone_dalaran.cpp index b662442ef93..d16b6fe4588 100644 --- a/src/server/scripts/Northrend/dalaran.cpp +++ b/src/server/scripts/Northrend/zone_dalaran.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index 13a8370690e..a8fb0215902 100644 --- a/src/server/scripts/Northrend/dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -33,6 +33,8 @@ EndContentData */ #include "SpellScript.h" #include "SpellAuraEffects.h" #include "ScriptedEscortAI.h" +#include "Vehicle.h" +#include "CombatAI.h" #include "Player.h" enum eEnums @@ -172,15 +174,27 @@ public: }; /*###### -## wyrmrest_defender +## Quest: Defending Wyrmrest Temple ID: 12372 ######*/ enum WyrmDefenderEnum { - QUEST_DEFENDING_WYRMREST_TEMPLE = 12372, - GOSSIP_TEXTID_DEF1 = 12899, - GOSSIP_TEXTID_DEF2 = 12900, - SPELL_CHARACTER_SCRIPT = 49213 + // Quest data + QUEST_DEFENDING_WYRMREST_TEMPLE = 12372, + GOSSIP_TEXTID_DEF1 = 12899, + + // Gossip data + GOSSIP_TEXTID_DEF2 = 12900, + + // Spells data + SPELL_CHARACTER_SCRIPT = 49213, + SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE = 52421, // ID - 52421 Wyrmrest Defender: On Low Health Boss Emote to Controller - Random /self/ + SPELL_RENEW = 49263, // casted to heal drakes + SPELL_WYRMREST_DEFENDER_MOUNT = 49256, + + // Texts data + WHISPER_MOUNTED = 0, + BOSS_EMOTE_ON_LOW_HEALTH = 2 }; #define GOSSIP_ITEM_1 "We need to get into the fight. Are you ready?" @@ -211,10 +225,79 @@ class npc_wyrmrest_defender : public CreatureScript player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DEF2, creature->GetGUID()); // Makes player cast trigger spell for 49207 on self player->CastSpell(player, SPELL_CHARACTER_SCRIPT, true); + // The gossip should not auto close } return true; } + + struct npc_wyrmrest_defenderAI : public VehicleAI + { + npc_wyrmrest_defenderAI(Creature* creature) : VehicleAI(creature) { } + + bool hpWarningReady; + bool renewRecoveryCanCheck; + + uint32 RenewRecoveryChecker; + + void Reset() + { + hpWarningReady = true; + renewRecoveryCanCheck = false; + + RenewRecoveryChecker = 0; + } + + void UpdateAI(uint32 const diff) + { + // Check system for Health Warning should happen first time whenever get under 30%, + // after it should be able to happen only after recovery of last renew is fully done (20 sec), + // next one used won't interfere + if (hpWarningReady && me->GetHealthPct() <= 30.0f) + { + me->CastSpell(me, SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE); + hpWarningReady = false; + } + + if (renewRecoveryCanCheck) + { + if (RenewRecoveryChecker <= diff) + { + renewRecoveryCanCheck = false; + hpWarningReady = true; + } + else RenewRecoveryChecker -= diff; + } + } + + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) + { + switch (spell->Id) + { + case SPELL_WYRMREST_DEFENDER_MOUNT: + Talk(WHISPER_MOUNTED, me->GetCharmerOrOwnerGUID()); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + break; + // Both below are for checking low hp warning + case SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE: + Talk(BOSS_EMOTE_ON_LOW_HEALTH, me->GetCharmerOrOwnerGUID()); + break; + case SPELL_RENEW: + if (!hpWarningReady && RenewRecoveryChecker <= 100) + { + RenewRecoveryChecker = 20000; + } + renewRecoveryCanCheck = true; + break; + } + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_wyrmrest_defenderAI(creature); + } }; void AddSC_dragonblight() diff --git a/src/server/scripts/Northrend/grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp index 8bcc255b343..fe1f561071c 100644 --- a/src/server/scripts/Northrend/grizzly_hills.cpp +++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp index e04531954ea..ff4d8ec7a79 100644 --- a/src/server/scripts/Northrend/howling_fjord.cpp +++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index e08a9173715..2ec5a3e8164 100644 --- a/src/server/scripts/Northrend/icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index a6d6cda11b1..2aa355084a1 100644 --- a/src/server/scripts/Northrend/sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -18,7 +18,7 @@ /* ScriptData SDName: Sholazar_Basin SD%Complete: 100 -SDComment: Quest support: 12570, 12573, 12621. +SDComment: Quest support: 12570, 12573, 12621, 12726 SDCategory: Sholazar_Basin EndScriptData */ @@ -26,6 +26,7 @@ EndScriptData */ npc_injured_rainspeaker_oracle npc_vekjik avatar_of_freya +npc_haiphoon (Quest: "Song of Wind and Water") EndContentData */ #include "ScriptMgr.h" @@ -34,6 +35,8 @@ EndContentData */ #include "ScriptedEscortAI.h" #include "SpellScript.h" #include "SpellAuras.h" +#include "Vehicle.h" +#include "CombatAI.h" #include "Player.h" /*###### @@ -722,10 +725,17 @@ class npc_adventurous_dwarf : public CreatureScript public: npc_adventurous_dwarf() : CreatureScript("npc_adventurous_dwarf") { } + struct npc_adventurous_dwarfAI : public ScriptedAI + { + npc_adventurous_dwarfAI(Creature* creature) : ScriptedAI(creature) + { + Talk(SAY_DWARF_OUCH); + } + }; + CreatureAI* GetAI(Creature* creature) const { - creature->AI()->Talk(SAY_DWARF_OUCH); - return NULL; + return new npc_adventurous_dwarfAI(creature); } bool OnGossipHello(Player* player, Creature* creature) @@ -750,14 +760,23 @@ public: { player->PlayerTalkClass->ClearMenus(); uint32 spellId = 0; + switch (action) { - case GOSSIP_ACTION_INFO_DEF + 1: spellId = SPELL_ADD_ORANGE; break; - case GOSSIP_ACTION_INFO_DEF + 2: spellId = SPELL_ADD_BANANAS; break; - case GOSSIP_ACTION_INFO_DEF + 3: spellId = SPELL_ADD_PAPAYA; break; + case GOSSIP_ACTION_INFO_DEF + 1: + spellId = SPELL_ADD_ORANGE; + break; + case GOSSIP_ACTION_INFO_DEF + 2: + spellId = SPELL_ADD_BANANAS; + break; + case GOSSIP_ACTION_INFO_DEF + 3: + spellId = SPELL_ADD_PAPAYA; + break; } + if (spellId) player->CastSpell(player, spellId, true); + creature->AI()->Talk(SAY_DWARF_HELP); creature->DespawnOrUnsummon(); return true; @@ -968,6 +987,52 @@ public: } }; +/*###### +## Quest: Song of Wind and Water ID: 12726 +######*/ +/*This quest precisly needs core script since battle vehicles are not well integrated with SAI, +may be easily converted to SAI when they get.*/ +enum SongOfWindAndWater +{ + // Spells + SPELL_DEVOUR_WIND = 52862, + SPELL_DEVOUR_WATER = 52864, + // NPCs + NPC_HAIPHOON_WATER = 28999, + NPC_HAIPHOON_AIR = 28985 +}; + +class npc_haiphoon : public CreatureScript +{ +public: + npc_haiphoon() : CreatureScript("npc_haiphoon") { } + + struct npc_haiphoonAI : public VehicleAI + { + npc_haiphoonAI(Creature* creature) : VehicleAI(creature) { } + + void SpellHitTarget(Unit* target, SpellInfo const* spell) + { + if (target == me) + return; + + if (spell->Id == SPELL_DEVOUR_WIND && me->GetCharmerOrOwnerPlayerOrPlayerItself()) + { + me->UpdateEntry(NPC_HAIPHOON_AIR); + } + else if (spell->Id == SPELL_DEVOUR_WATER && me->GetCharmerOrOwnerPlayerOrPlayerItself()) + { + me->UpdateEntry(NPC_HAIPHOON_WATER); + } + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_haiphoonAI(creature); + } +}; + void AddSC_sholazar_basin() { new npc_injured_rainspeaker_oracle(); @@ -979,4 +1044,5 @@ void AddSC_sholazar_basin() new npc_jungle_punch_target(); new spell_q12620_the_lifewarden_wrath(); new spell_q12589_shoot_rjr(); + new npc_haiphoon(); } diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index f87b24ce639..85ab1dc1127 100644 --- a/src/server/scripts/Northrend/storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Northrend/wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp index 8935c77b30e..8935c77b30e 100644 --- a/src/server/scripts/Northrend/wintergrasp.cpp +++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp index 506c34d40fb..69e8d900435 100644 --- a/src/server/scripts/Northrend/zuldrak.cpp +++ b/src/server/scripts/Northrend/zone_zuldrak.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -1398,12 +1398,12 @@ public: bool OnGossipHello(Player* player, GameObject* go) { + go->UseDoorOrButton(); if (player->GetQuestStatus(QUEST_OUR_ONLY_HOPE) == QUEST_STATUS_INCOMPLETE) { Creature* pGymerDummy = go->FindNearestCreature(NPC_GYMER_DUMMY, 20.0f); if (pGymerDummy) { - go->UseDoorOrButton(); player->KilledMonsterCredit(pGymerDummy->GetEntry(), pGymerDummy->GetGUID()); pGymerDummy->CastSpell(pGymerDummy, 55529, true); pGymerDummy->DisappearAndDie(); diff --git a/src/server/scripts/OutdoorPvP/CMakeLists.txt b/src/server/scripts/OutdoorPvP/CMakeLists.txt index 237b974aa9d..1789cbc1ffe 100644 --- a/src/server/scripts/OutdoorPvP/CMakeLists.txt +++ b/src/server/scripts/OutdoorPvP/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp index 2e911406979..79755c0f57d 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h index 14712e0150d..cdd944107bc 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp index a4b506e9271..55bb61b8c42 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h index 59bce7be298..a477b2af8a4 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp index abf807327e3..bd6fd96451f 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h index ace68034dfc..04555c671bb 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp index 9411bd8a363..242f3fab985 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h index c4975d142f0..bfad558e3e0 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp index fdf6533a64b..bd8b6cfd982 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h index dfab6d12cb8..be6032a82f5 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp index 6644dd3f47f..f8780435996 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h index 8d2124a3791..bab537682ad 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp index 5739aa49549..040ca012902 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp index d6465bfe006..7509f6331f7 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -40,7 +40,10 @@ EndScriptData */ #define SPELL_FIERY_BLAST DUNGEON_MODE(N_SPELL_FIERY_BLAST, H_SPELL_FIERY_BLAST) #define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual -#define EMOTE_FOCUSES_ON "focuses on " +enum Say +{ + EMOTE_FOCUSED = 0 +}; class boss_shirrak_the_dead_watcher : public CreatureScript { @@ -143,13 +146,7 @@ public: { FocusedTargetGUID = target->GetGUID(); me->SummonCreature(ENTRY_FOCUS_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 5500); - - // TODO: Find better way to handle emote - // Emote - std::string emote(EMOTE_FOCUSES_ON); - emote.append(target->GetName()); - emote.push_back('!'); - me->MonsterTextEmote(emote.c_str(), 0, true); + Talk(EMOTE_FOCUSED, FocusedTargetGUID); } FocusFire_Timer = 15000+(rand()%5000); } else FocusFire_Timer -= diff; diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp index f7a2eb87d67..7e1fa41c6da 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp index f174091311b..c8bd6dbb069 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp index 5bb396965a6..1a53a140f28 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it 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 07169f031ab..8a872039e37 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp index f57bed1207b..785ec185941 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h b/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h index 706862ac301..58e6cc685ce 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp index c93143c1c5c..b9163c13413 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp index eb06cce87fc..4ae2d59799a 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp index d7dbb8ef722..80eb7c03819 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp index 9ca9f7d089c..fbe62e2a003 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it 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 9fa90be9765..f65f42762c1 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h index 0dfe9d01de5..9c6ca776dea 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.cpp b/src/server/scripts/Outland/BlackTemple/black_temple.cpp index a100f5848af..ae0a17e1a8c 100644 --- a/src/server/scripts/Outland/BlackTemple/black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/black_temple.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.h b/src/server/scripts/Outland/BlackTemple/black_temple.h index 813070d837c..433624a7d55 100644 --- a/src/server/scripts/Outland/BlackTemple/black_temple.h +++ b/src/server/scripts/Outland/BlackTemple/black_temple.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp index 427c23bafa6..3a56a0bfed2 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 1029648561f..b8003761cc7 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index 88e7c063c69..11569c30f1e 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it 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 00ea405e109..f9c46aa3f77 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it 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 0180281cde3..fe5af2a689e 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp index 388052f0a5e..6bc6633e49e 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index ce17ac48cf5..6c28b058cf7 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp index f56d55c36e3..7a56734bc3b 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index 5a9b6e5a94e..03fa5235d18 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -37,7 +37,7 @@ enum IllidariCouncil SAY_GATH_SLAY = 4, SAY_GATH_COMNT = 5, SAY_GATH_DEATH = 6, - + SAY_MALA_SPECIAL1 = 2, SAY_MALA_SPECIAL2 = 3, SAY_MALA_SLAY = 4, diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp index 8a2e25b176a..6694d93e5d7 100644 --- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/CMakeLists.txt b/src/server/scripts/Outland/CMakeLists.txt index 6056fa8b143..f038af07634 100644 --- a/src/server/scripts/Outland/CMakeLists.txt +++ b/src/server/scripts/Outland/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -10,7 +10,7 @@ set(scripts_STAT_SRCS ${scripts_STAT_SRCS} - Outland/nagrand.cpp + Outland/zone_nagrand.cpp Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -44,7 +44,7 @@ set(scripts_STAT_SRCS Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp - Outland/shattrath_city.cpp + Outland/zone_shattrath_city.cpp Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp @@ -59,6 +59,10 @@ set(scripts_STAT_SRCS Outland/TempestKeep/Eye/boss_alar.cpp Outland/TempestKeep/Eye/boss_kaelthas.cpp Outland/TempestKeep/Eye/the_eye.cpp + Outland/TempestKeep/botanica/the_botanica.h + Outland/TempestKeep/botanica/instance_the_botanica.cpp + Outland/TempestKeep/botanica/boss_commander_sarannis.cpp + Outland/TempestKeep/botanica/boss_thorngrin_the_tender.cpp Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp Outland/TempestKeep/botanica/boss_warp_splinter.cpp Outland/TempestKeep/botanica/boss_laj.cpp @@ -81,8 +85,8 @@ set(scripts_STAT_SRCS Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp Outland/boss_doomwalker.cpp - Outland/terokkar_forest.cpp - Outland/hellfire_peninsula.cpp + Outland/zone_terokkar_forest.cpp + Outland/zone_hellfire_peninsula.cpp Outland/boss_doomlord_kazzak.cpp Outland/BlackTemple/boss_teron_gorefiend.cpp Outland/BlackTemple/black_temple.h @@ -96,14 +100,14 @@ set(scripts_STAT_SRCS Outland/BlackTemple/boss_warlord_najentus.cpp Outland/BlackTemple/boss_bloodboil.cpp Outland/BlackTemple/boss_illidan.cpp - Outland/shadowmoon_valley.cpp - Outland/blades_edge_mountains.cpp + Outland/zone_shadowmoon_valley.cpp + Outland/zone_blades_edge_mountains.cpp Outland/GruulsLair/boss_high_king_maulgar.cpp Outland/GruulsLair/boss_gruul.cpp Outland/GruulsLair/gruuls_lair.h Outland/GruulsLair/instance_gruuls_lair.cpp - Outland/netherstorm.cpp - Outland/zangarmarsh.cpp + Outland/zone_netherstorm.cpp + Outland/zone_zangarmarsh.cpp ) message(" -> Prepared: Outland") 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 5a26ffd9acd..d9ad35f9552 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp index c8589cc05d8..b31292c4b00 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it 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 6c4c51b03fe..b0717d29228 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it 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 6fe1e86551a..2c8d067a865 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -387,7 +387,7 @@ public: { if (victim->GetTypeId() != TYPEID_PLAYER) return; - + Talk(DemonForm ? SAY_DEMON_SLAY : SAY_NIGHTELF_SLAY); } 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 5bc2344fd70..788de7753ff 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp index 9c7fdadc18a..9476bb28f8e 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it 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 4af38888758..207d388f41f 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h index 786db3cb86b..278b8169fca 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp index e2d581128fd..f2ed2560bbf 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp index 6a70cb97759..3897f370b0c 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp index 51c477365a3..23b25da91ea 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp index e8a096a83a1..744888afbd4 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h index b2b25d960ed..ea89ac3c611 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp index 54823687e5e..9fa5a1a51f5 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp index 4006e756ca2..1e8fd8b2676 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -26,15 +26,21 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" -#define SPELL_LEVITATE 31704 -#define SPELL_SUSPENSION 31719 -#define SPELL_LEVITATION_PULSE 31701 -#define SPELL_MAGNETIC_PULL 31705 -#define SPELL_CHAIN_LIGHTNING 31717 -#define SPELL_STATIC_CHARGE 31715 -#define SPELL_SUMMON_SPORE_STRIDER 38755 +enum Spells +{ + SPELL_LEVITATE = 31704, + SPELL_SUSPENSION = 31719, + SPELL_LEVITATION_PULSE = 31701, + SPELL_MAGNETIC_PULL = 31705, + SPELL_CHAIN_LIGHTNING = 31717, + SPELL_STATIC_CHARGE = 31715, + SPELL_SUMMON_SPORE_STRIDER = 38755 +}; -#define ENTRY_SPORE_STRIDER 22299 +enum CreatureIdS +{ + ENTRY_SPORE_STRIDER = 22299 +}; class boss_the_black_stalker : public CreatureScript { diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp index 797d0f0d799..0a5c8b0c8b6 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp index 2d2c36104a2..83596c46936 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/GruulsLair/gruuls_lair.h b/src/server/scripts/Outland/GruulsLair/gruuls_lair.h index 163ab97ed5f..2e9715a7ffe 100644 --- a/src/server/scripts/Outland/GruulsLair/gruuls_lair.h +++ b/src/server/scripts/Outland/GruulsLair/gruuls_lair.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp index 120e550bd4e..e8aa6838d09 100644 --- a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp +++ b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h index ed8c5351493..01f7a2bca98 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp index 4b364d1c0a8..6d3ec669cd5 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it 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 2fe95e1bf4d..7d8885ae0ae 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp index 4dfd7e8a8e8..bab49b95974 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp index 11e75f054ad..4eaf7cc2d6c 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp index a40c2e480bd..b83307d8dcc 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -29,24 +29,24 @@ EndScriptData */ enum eSays { - SAY_AGGRO = 0, - SAY_SUMMON = 1, - SAY_CURSE = 2, - SAY_KILL_1 = 3, - SAY_DIE = 4, - SAY_WIPE = 5, + SAY_AGGRO = 0, + SAY_SUMMON = 1, + SAY_CURSE = 2, + SAY_KILL_1 = 3, + SAY_DIE = 4, + SAY_WIPE = 5 }; enum eSpells { - SPELL_ORBITAL_STRIKE = 30637, - SPELL_SHADOW_WHIP = 30638, - SPELL_TREACHEROUS_AURA = 30695, - H_SPELL_BANE_OF_TREACHERY = 37566, - SPELL_DEMONIC_SHIELD = 31901, - SPELL_SHADOW_BOLT = 30686, - H_SPELL_SHADOW_BOLT = 39297, - SPELL_SUMMON_FIENDISH_HOUND= 30707, + SPELL_ORBITAL_STRIKE = 30637, + SPELL_SHADOW_WHIP = 30638, + SPELL_TREACHEROUS_AURA = 30695, + H_SPELL_BANE_OF_TREACHERY = 37566, + SPELL_DEMONIC_SHIELD = 31901, + SPELL_SHADOW_BOLT = 30686, + H_SPELL_SHADOW_BOLT = 39297, + SPELL_SUMMON_FIENDISH_HOUND = 30707 }; class boss_omor_the_unscarred : public CreatureScript 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 7fa476100d5..30a2813b286 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -53,14 +53,16 @@ enum eUnits ENTRY_REINFORCED_FEL_IRON_CHEST_H = 185169 }; -enum eSays +enum Says { SAY_INTRO = 0, - SAY_WIPE = 1, - SAY_AGGRO = 2, - SAY_KILL = 3, - SAY_DIE = 4, - EMOTE = 5 + + SAY_WIPE = 0, + SAY_AGGRO = 1, + SAY_KILL = 2, + SAY_DIE = 3, + + EMOTE = 0 }; const float VazrudenMiddle[3] = {-1406.5f, 1746.5f, 81.2f}; 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 156d5cbae2c..7aae6cebff9 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ enum eSpells SPELL_MORTAL_WOUND = 30641, H_SPELL_MORTAL_WOUND = 36814, SPELL_SURGE = 34645, - SPELL_RETALIATION = 22857, + SPELL_RETALIATION = 22857 }; class boss_watchkeeper_gargolmar : public CreatureScript diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h index 571071c724a..b67041e93f2 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp index ba7b5afb4c8..477ec70ba86 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index c5f79a2babd..aeec7d14b26 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it 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 0bb949d3b90..3d34d1fd6ae 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h index 6a232264ba2..9a4e4613d59 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp index e5b6ea71eb0..00f0fd8964e 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp index 3d2d39e9817..dd23f89dcfb 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -34,9 +34,9 @@ EndContentData */ enum eEnums { - YELL_DIE_L = -1540039, - YELL_DIE_R = -1540040, - EMOTE_ENRAGE = -1540041, + YELL_DIE_L = 0, + YELL_DIE_R = 1, + EMOTE_ENRAGE = 2, SPELL_BLAST_WAVE = 30600, SPELL_FEAR = 30584, @@ -57,49 +57,49 @@ struct Yell static Yell GoCombat[]= { - {-1540018, NPC_LEFT_HEAD}, - {-1540019, NPC_LEFT_HEAD}, - {-1540020, NPC_LEFT_HEAD}, + {0, NPC_LEFT_HEAD}, + {1, NPC_LEFT_HEAD}, + {2, NPC_LEFT_HEAD}, }; static Yell GoCombatDelay[]= { - {-1540021, NPC_RIGHT_HEAD}, - {-1540022, NPC_RIGHT_HEAD}, - {-1540023, NPC_RIGHT_HEAD}, + {0, NPC_RIGHT_HEAD}, + {1, NPC_RIGHT_HEAD}, + {2, NPC_RIGHT_HEAD}, }; static Yell Threat[]= { - {-1540024, NPC_LEFT_HEAD}, - {-1540025, NPC_RIGHT_HEAD}, - {-1540026, NPC_LEFT_HEAD}, - {-1540027, NPC_LEFT_HEAD}, + {3, NPC_LEFT_HEAD}, + {3, NPC_RIGHT_HEAD}, + {4, NPC_LEFT_HEAD}, + {5, NPC_LEFT_HEAD}, }; static Yell ThreatDelay1[]= { - {-1540028, NPC_RIGHT_HEAD}, - {-1540029, NPC_LEFT_HEAD}, - {-1540030, NPC_RIGHT_HEAD}, - {-1540031, NPC_RIGHT_HEAD}, + {4, NPC_RIGHT_HEAD}, + {6, NPC_LEFT_HEAD}, + {5, NPC_RIGHT_HEAD}, + {6, NPC_RIGHT_HEAD}, }; static Yell ThreatDelay2[]= { - {-1540032, NPC_LEFT_HEAD}, - {-1540033, NPC_RIGHT_HEAD}, - {-1540034, NPC_LEFT_HEAD}, - {-1540035, NPC_LEFT_HEAD}, + {7, NPC_LEFT_HEAD}, + {7, NPC_RIGHT_HEAD}, + {8, NPC_LEFT_HEAD}, + {9, NPC_LEFT_HEAD}, }; static Yell Killing[]= { - {-1540036, NPC_LEFT_HEAD}, - {-1540037, NPC_RIGHT_HEAD}, + {10, NPC_LEFT_HEAD}, + {8, NPC_RIGHT_HEAD}, }; static Yell KillingDelay[]= { - {-1540038, NPC_RIGHT_HEAD}, - {-1000000, NPC_LEFT_HEAD}, + {9, NPC_RIGHT_HEAD}, + {11, NPC_LEFT_HEAD}, }; class mob_omrogg_heads : public CreatureScript @@ -137,7 +137,7 @@ class mob_omrogg_heads : public CreatureScript if (Death_Timer <= diff) { - DoScriptText(YELL_DIE_R, me); + Talk(YELL_DIE_R); Death_Timer = false; me->setDeathState(JUST_DIED); } else Death_Timer -= diff; @@ -222,17 +222,17 @@ class boss_warbringer_omrogg : public CreatureScript void DoYellForThreat() { - Unit* pLeftHead = Unit::GetUnit(*me, LeftHeadGUID); - Unit* pRightHead = Unit::GetUnit(*me, RightHeadGUID); + Creature* pLeftHead = Creature::GetCreature(*me, LeftHeadGUID); + Creature* pRightHead = Unit::GetCreature(*me, RightHeadGUID); if (!pLeftHead || !pRightHead) return; ithreat = rand()%4; - Unit* source = (pLeftHead->GetEntry() == Threat[ithreat].creature ? pLeftHead : pRightHead); + Creature* source = (pLeftHead->GetEntry() == Threat[ithreat].creature ? pLeftHead : pRightHead); - DoScriptText(Threat[ithreat].id, source); + source->AI()->Talk(Threat[ithreat].id); Delay_Timer = 3500; ThreatYell = true; @@ -243,11 +243,11 @@ class boss_warbringer_omrogg : public CreatureScript me->SummonCreature(NPC_LEFT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); me->SummonCreature(NPC_RIGHT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); - if (Unit* pLeftHead = Unit::GetUnit(*me, LeftHeadGUID)) + if (Creature* pLeftHead = Creature::GetCreature(*me, LeftHeadGUID)) { iaggro = rand()%3; - DoScriptText(GoCombat[iaggro].id, pLeftHead); + pLeftHead->AI()->Talk(GoCombat[iaggro].id); Delay_Timer = 3500; AggroYell = true; @@ -272,25 +272,25 @@ class boss_warbringer_omrogg : public CreatureScript void KilledUnit(Unit* /*victim*/) { - Unit* pLeftHead = Unit::GetUnit(*me, LeftHeadGUID); - Unit* pRightHead = Unit::GetUnit(*me, RightHeadGUID); + Creature* pLeftHead = Creature::GetCreature(*me, LeftHeadGUID); + Creature* pRightHead = Creature::GetCreature(*me, RightHeadGUID); if (!pLeftHead || !pRightHead) return; ikilling = rand()%2; - Unit* source = (pLeftHead->GetEntry() == Killing[ikilling].creature ? pLeftHead : pRightHead); + Creature* source = (pLeftHead->GetEntry() == Killing[ikilling].creature ? pLeftHead : pRightHead); switch (ikilling) { case 0: - DoScriptText(Killing[ikilling].id, source); + source->AI()->Talk(Killing[ikilling].id); Delay_Timer = 3500; KillingYell = true; break; case 1: - DoScriptText(Killing[ikilling].id, source); + source->AI()->Talk(Killing[ikilling].id); KillingYell = false; break; } @@ -298,13 +298,13 @@ class boss_warbringer_omrogg : public CreatureScript void JustDied(Unit* /*killer*/) { - Unit* pLeftHead = Unit::GetUnit(*me, LeftHeadGUID); - Unit* pRightHead = Unit::GetUnit(*me, RightHeadGUID); + Creature* pLeftHead = Creature::GetCreature(*me, LeftHeadGUID); + Creature* pRightHead = Creature::GetCreature(*me, RightHeadGUID); if (!pLeftHead || !pRightHead) return; - DoScriptText(YELL_DIE_L, pLeftHead); + pLeftHead->AI()->Talk(YELL_DIE_L); CAST_AI(mob_omrogg_heads::mob_omrogg_headsAI, CAST_CRE(pRightHead)->AI())->DoDeathYell(); @@ -318,40 +318,40 @@ class boss_warbringer_omrogg : public CreatureScript { Delay_Timer = 3500; - Unit* pLeftHead = Unit::GetUnit(*me, LeftHeadGUID); - Unit* pRightHead = Unit::GetUnit(*me, RightHeadGUID); + Creature* pLeftHead = Creature::GetCreature(*me, LeftHeadGUID); + Creature* pRightHead = Creature::GetCreature(*me, RightHeadGUID); if (!pLeftHead || !pRightHead) return; if (AggroYell) { - DoScriptText(GoCombatDelay[iaggro].id, pRightHead); + pRightHead->AI()->Talk(GoCombatDelay[iaggro].id); AggroYell = false; } if (ThreatYell2) { - Unit* source = (pLeftHead->GetEntry() == ThreatDelay2[ithreat].creature ? pLeftHead : pRightHead); + Creature* source = (pLeftHead->GetEntry() == ThreatDelay2[ithreat].creature ? pLeftHead : pRightHead); - DoScriptText(ThreatDelay2[ithreat].id, source); + source->AI()->Talk(ThreatDelay2[ithreat].id); ThreatYell2 = false; } if (ThreatYell) { - Unit* source = (pLeftHead->GetEntry() == ThreatDelay1[ithreat].creature ? pLeftHead : pRightHead); + Creature* source = (pLeftHead->GetEntry() == ThreatDelay1[ithreat].creature ? pLeftHead : pRightHead); - DoScriptText(ThreatDelay1[ithreat].id, source); + source->AI()->Talk(ThreatDelay1[ithreat].id); ThreatYell = false; ThreatYell2 = true; } if (KillingYell) { - Unit* source = (pLeftHead->GetEntry() == KillingDelay[ikilling].creature ? pLeftHead : pRightHead); + Creature* source = (pLeftHead->GetEntry() == KillingDelay[ikilling].creature ? pLeftHead : pRightHead); - DoScriptText(KillingDelay[ikilling].id, source); + source->AI()->Talk(KillingDelay[ikilling].id); KillingYell = false; } } else Delay_Timer -= diff; @@ -373,7 +373,7 @@ class boss_warbringer_omrogg : public CreatureScript if (BurningMaul_Timer <= diff) { - DoScriptText(EMOTE_ENRAGE, me); + Talk(EMOTE_ENRAGE); DoCast(me, SPELL_BURNING_MAUL); BurningMaul_Timer = 40000; BlastWave_Timer = 16000; diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp index 99f7c69aff2..f437018ac4b 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -32,12 +32,9 @@ EndContentData */ enum eSays { - SAY_AGGRO1 = -1540042, - SAY_AGGRO2 = -1540043, - SAY_AGGRO3 = -1540044, - SAY_SLAY1 = -1540045, - SAY_SLAY2 = -1540046, - SAY_DEATH = -1540047, + SAY_AGGRO = 0, + SAY_SLAY = 1, + SAY_DEATH = 2 }; enum eSpells @@ -111,7 +108,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript void EnterCombat(Unit* /*who*/) { - DoScriptText(RAND(SAY_AGGRO1, SAY_AGGRO2, SAY_AGGRO3), me); + Talk(SAY_AGGRO); } void JustSummoned(Creature* summoned) @@ -134,13 +131,13 @@ class boss_warchief_kargath_bladefist : public CreatureScript { if (victim->GetTypeId() == TYPEID_PLAYER) { - DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); + Talk(SAY_SLAY); } } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); removeAdds(); } diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp index c7c1cbba880..95579aba002 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h index 60140704012..f56f844a49a 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index a8be934c710..f0a823472df 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index 5b5c3ff2326..9c4b764fd2a 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -32,15 +32,13 @@ EndScriptData */ enum eEnums { - SAY_AGGRO = -1550007, - SAY_SUMMON1 = -1550008, - SAY_SUMMON2 = -1550009, - SAY_KILL1 = -1550010, - SAY_KILL2 = -1550011, - SAY_KILL3 = -1550012, - SAY_DEATH = -1550013, - SAY_VOIDA = -1550014, - SAY_VOIDB = -1550015, + SAY_AGGRO = 0, + SAY_SUMMON1 = 1, + SAY_SUMMON2 = 2, + SAY_KILL = 3, + SAY_DEATH = 4, + SAY_VOIDA = 5, + SAY_VOIDB = 6, SPELL_ARCANE_MISSILES = 33031, SPELL_WRATH_OF_THE_ASTROMANCER = 42783, @@ -149,21 +147,21 @@ class boss_high_astromancer_solarian : public CreatureScript void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_KILL1, SAY_KILL2, SAY_KILL3), me); + Talk(SAY_KILL); } void JustDied(Unit* /*killer*/) { me->SetObjectScale(defaultsize); me->SetDisplayId(MODEL_HUMAN); - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (instance) instance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, DONE); } void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); DoZoneInCombat(); if (instance) @@ -333,7 +331,7 @@ class boss_high_astromancer_solarian : public CreatureScript for (int j=1; j <= 4; j++) SummonMinion(NPC_SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]); - DoScriptText(SAY_SUMMON1, me); + Talk(SAY_SUMMON1); Phase2_Timer = 10000; } else @@ -360,7 +358,7 @@ class boss_high_astromancer_solarian : public CreatureScript me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetVisible(true); - DoScriptText(SAY_SUMMON2, me); + Talk(SAY_SUMMON2); AppearDelay = true; Phase3_Timer = 15000; } @@ -394,8 +392,8 @@ class boss_high_astromancer_solarian : public CreatureScript //To make sure she wont be invisible or not selecatble me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetVisible(true); - DoScriptText(SAY_VOIDA, me); - DoScriptText(SAY_VOIDB, me); + Talk(SAY_VOIDA); + Talk(SAY_VOIDB); me->SetArmor(WV_ARMOR); me->SetDisplayId(MODEL_VOIDWALKER); me->SetObjectScale(defaultsize*2.5f); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 2dbfb7b46c5..07d563cd762 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -32,42 +32,37 @@ EndScriptData */ enum eEnums { //kael'thas Speech - SAY_INTRO = -1550016, - SAY_INTRO_CAPERNIAN = -1550017, - SAY_INTRO_TELONICUS = -1550018, - SAY_INTRO_THALADRED = -1550019, - SAY_INTRO_SANGUINAR = -1550020, - SAY_PHASE2_WEAPON = -1550021, - SAY_PHASE3_ADVANCE = -1550022, - SAY_PHASE4_INTRO2 = -1550023, - SAY_PHASE5_NUTS = -1550024, - SAY_SLAY1 = -1550025, - SAY_SLAY2 = -1550026, - SAY_SLAY3 = -1550027, - SAY_MINDCONTROL1 = -1550028, - SAY_MINDCONTROL2 = -1550029, - SAY_GRAVITYLAPSE1 = -1550030, - SAY_GRAVITYLAPSE2 = -1550031, - SAY_SUMMON_PHOENIX1 = -1550032, - SAY_SUMMON_PHOENIX2 = -1550033, - SAY_DEATH = -1550034, + SAY_INTRO = 0, + SAY_INTRO_CAPERNIAN = 1, + SAY_INTRO_TELONICUS = 2, + SAY_INTRO_THALADRED = 3, + SAY_INTRO_SANGUINAR = 4, + SAY_PHASE2_WEAPON = 5, + SAY_PHASE3_ADVANCE = 6, + SAY_PHASE4_INTRO2 = 7, + SAY_PHASE5_NUTS = 8, + SAY_SLAY = 9, + SAY_MINDCONTROL = 10, + SAY_GRAVITYLAPSE = 11, + SAY_SUMMON_PHOENIX = 12, + SAY_DEATH = 13, //Thaladred the Darkener speech - SAY_THALADRED_AGGRO = -1550035, - SAY_THALADRED_DEATH = -1550036, - EMOTE_THALADRED_GAZE = -1550037, + SAY_THALADRED_AGGRO = 0, + SAY_THALADRED_DEATH = 1, + EMOTE_THALADRED_GAZE = 2, //Lord Sanguinar speech - SAY_SANGUINAR_AGGRO = -1550038, - SAY_SANGUINAR_DEATH = -1550039, + SAY_SANGUINAR_AGGRO = 0, + SAY_SANGUINAR_DEATH = 1, //Grand Astromancer Capernian speech - SAY_CAPERNIAN_AGGRO = -1550040, - SAY_CAPERNIAN_DEATH = -1550041, + SAY_CAPERNIAN_AGGRO = 0, + SAY_CAPERNIAN_DEATH = 1, //Master Engineer Telonicus speech - SAY_TELONICUS_AGGRO = -1550042, - SAY_TELONICUS_DEATH = -1550043, + SAY_TELONICUS_AGGRO = 0, + SAY_TELONICUS_DEATH = 1, //Phase 2 spells SPELL_SUMMON_WEAPONS = 36976, @@ -369,7 +364,7 @@ class boss_kaelthas : public CreatureScript { sLog->outError(LOG_FILTER_TSCR, "Kael'Thas One or more advisors missing, Skipping Phases 1-3"); - DoScriptText(SAY_PHASE4_INTRO2, me); + Talk(SAY_PHASE4_INTRO2); Phase = 4; @@ -385,7 +380,7 @@ class boss_kaelthas : public CreatureScript { PrepareAdvisors(); - DoScriptText(SAY_INTRO, me); + Talk(SAY_INTRO); instance->SetData(DATA_KAELTHASEVENT, 1); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -431,7 +426,7 @@ class boss_kaelthas : public CreatureScript void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); + Talk(SAY_SLAY); } void JustSummoned(Creature* summoned) @@ -456,7 +451,7 @@ class boss_kaelthas : public CreatureScript me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); summons.DespawnAll(); @@ -487,7 +482,7 @@ class boss_kaelthas : public CreatureScript case 0: if (Phase_Timer <= diff) { - DoScriptText(SAY_INTRO_THALADRED, me); + Talk(SAY_INTRO_THALADRED); //start advisor within 7 seconds Phase_Timer = 7000; @@ -521,7 +516,7 @@ class boss_kaelthas : public CreatureScript if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) { - DoScriptText(SAY_INTRO_SANGUINAR, me); + Talk(SAY_INTRO_SANGUINAR); //start advisor within 12.5 seconds Phase_Timer = 12500; @@ -555,7 +550,7 @@ class boss_kaelthas : public CreatureScript if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) { - DoScriptText(SAY_INTRO_CAPERNIAN, me); + Talk(SAY_INTRO_CAPERNIAN); //start advisor within 7 seconds Phase_Timer = 7000; @@ -589,7 +584,7 @@ class boss_kaelthas : public CreatureScript if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) { - DoScriptText(SAY_INTRO_TELONICUS, me); + Talk(SAY_INTRO_TELONICUS); //start advisor within 8.4 seconds Phase_Timer = 8400; @@ -628,7 +623,7 @@ class boss_kaelthas : public CreatureScript if (instance) instance->SetData(DATA_KAELTHASEVENT, 2); - DoScriptText(SAY_PHASE2_WEAPON, me); + Talk(SAY_PHASE2_WEAPON); PhaseSubphase = 0; Phase_Timer = 3500; @@ -669,7 +664,7 @@ class boss_kaelthas : public CreatureScript { if (Phase_Timer <= diff) { - DoScriptText(SAY_PHASE3_ADVANCE, me); + Talk(SAY_PHASE3_ADVANCE); if (instance) instance->SetData(DATA_KAELTHASEVENT, 3); Phase = 3; @@ -705,7 +700,7 @@ class boss_kaelthas : public CreatureScript if (Phase_Timer <= diff) { - DoScriptText(SAY_PHASE4_INTRO2, me); + Talk(SAY_PHASE4_INTRO2); Phase = 4; if (instance) @@ -801,7 +796,7 @@ class boss_kaelthas : public CreatureScript if (Phoenix_Timer <= diff) { DoCast(me, SPELL_PHOENIX_ANIMATION); - DoScriptText(RAND(SAY_SUMMON_PHOENIX1, SAY_SUMMON_PHOENIX2), me); + Talk(SAY_SUMMON_PHOENIX); Phoenix_Timer = 60000; } @@ -818,7 +813,7 @@ class boss_kaelthas : public CreatureScript Phase = 5; Phase_Timer = 10000; - DoScriptText(SAY_PHASE5_NUTS, me); + Talk(SAY_PHASE5_NUTS); me->StopMoving(); me->GetMotionMaster()->Clear(); @@ -913,7 +908,7 @@ class boss_kaelthas : public CreatureScript break; case 1: - DoScriptText(RAND(SAY_GRAVITYLAPSE1, SAY_GRAVITYLAPSE2), me); + Talk(SAY_GRAVITYLAPSE); // 2) At that point he will put a Gravity Lapse debuff on everyone for (i = threatlist.begin(); i != threatlist.end(); ++i) @@ -1041,14 +1036,14 @@ class boss_thaladred_the_darkener : public CreatureScript if (!who || FakeDeath) return; - DoScriptText(SAY_THALADRED_AGGRO, me); + Talk(SAY_THALADRED_AGGRO); me->AddThreat(who, 5000000.0f); } void JustDied(Unit* /*killer*/) { if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3) - DoScriptText(SAY_THALADRED_DEATH, me); + Talk(SAY_THALADRED_DEATH); } void UpdateAI(const uint32 diff) @@ -1070,7 +1065,7 @@ class boss_thaladred_the_darkener : public CreatureScript { DoResetThreat(); me->AddThreat(target, 5000000.0f); - DoScriptText(EMOTE_THALADRED_GAZE, me, target); + Talk(EMOTE_THALADRED_GAZE, target->GetGUID()); Gaze_Timer = 8500; } } @@ -1134,13 +1129,13 @@ class boss_lord_sanguinar : public CreatureScript if (!who || FakeDeath) return; - DoScriptText(SAY_SANGUINAR_AGGRO, me); + Talk(SAY_SANGUINAR_AGGRO); } void JustDied(Unit* /*killer*/) { if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3) - DoScriptText(SAY_SANGUINAR_DEATH, me); + Talk(SAY_SANGUINAR_DEATH); } void UpdateAI(const uint32 diff) @@ -1205,7 +1200,7 @@ class boss_grand_astromancer_capernian : public CreatureScript void JustDied(Unit* /*killer*/) { if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3) - DoScriptText(SAY_CAPERNIAN_DEATH, me); + Talk(SAY_CAPERNIAN_DEATH); } void AttackStart(Unit* who) @@ -1249,7 +1244,7 @@ class boss_grand_astromancer_capernian : public CreatureScript { if (Yell_Timer <= diff) { - DoScriptText(SAY_CAPERNIAN_AGGRO, me); + Talk(SAY_CAPERNIAN_AGGRO); Yell = true; } else @@ -1344,7 +1339,7 @@ class boss_master_engineer_telonicus : public CreatureScript void JustDied(Unit* /*killer*/) { if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3) - DoScriptText(SAY_TELONICUS_DEATH, me); + Talk(SAY_TELONICUS_DEATH); } void EnterCombat(Unit* who) @@ -1355,7 +1350,7 @@ class boss_master_engineer_telonicus : public CreatureScript if (!who || FakeDeath) return; - DoScriptText(SAY_TELONICUS_AGGRO, me); + Talk(SAY_TELONICUS_AGGRO); } void UpdateAI(const uint32 diff) diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp index 2c778485131..468c9ab1e75 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -29,13 +29,10 @@ EndScriptData */ enum eEnums { - SAY_AGGRO = -1550000, - SAY_SLAY1 = -1550001, - SAY_SLAY2 = -1550002, - SAY_SLAY3 = -1550003, - SAY_DEATH = -1550004, - SAY_POUNDING1 = -1550005, - SAY_POUNDING2 = -1550006, + SAY_AGGRO = 0, + SAY_SLAY = 1, + SAY_DEATH = 2, + SAY_POUNDING = 3, SPELL_POUNDING = 34162, SPELL_ARCANE_ORB = 34172, @@ -83,12 +80,12 @@ class boss_void_reaver : public CreatureScript void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); + Talk(SAY_SLAY); } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); DoZoneInCombat(); if (instance) @@ -97,7 +94,7 @@ class boss_void_reaver : public CreatureScript void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); if (instance) instance->SetData(DATA_VOIDREAVEREVENT, IN_PROGRESS); @@ -111,7 +108,7 @@ class boss_void_reaver : public CreatureScript if (Pounding_Timer <= diff) { DoCast(me->getVictim(), SPELL_POUNDING); - DoScriptText(RAND(SAY_POUNDING1, SAY_POUNDING2), me); + Talk(SAY_POUNDING); Pounding_Timer = 15000; //cast time(3000) + cooldown time(12000) } else 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 e9ee5a62bb8..e43d2f9b13a 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp index a38ad1d734e..d5e39d09301 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h index 9a2bd3425b6..20b920a95d2 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h +++ b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp index 1d816f1eee3..3c72c8353aa 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp index 83acc1258be..09ff6cf8e49 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -28,13 +28,11 @@ EndScriptData */ enum eSays { - SAY_AGGRO_1 = -1554006, - SAY_HAMMER_1 = -1554007, - SAY_HAMMER_2 = -1554008, - SAY_SLAY_1 = -1554009, - SAY_SLAY_2 = -1554010, - SAY_DEATH_1 = -1554011, - EMOTE_HAMMER = -1554012, + SAY_AGGRO = 0, + SAY_HAMMER = 1, + SAY_SLAY = 2, + SAY_DEATH = 3, + EMOTE_HAMMER = 4 }; enum eSpells @@ -76,7 +74,7 @@ class boss_gatewatcher_iron_hand : public CreatureScript } void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO_1, me); + Talk(SAY_AGGRO); } void KilledUnit(Unit* /*victim*/) @@ -84,12 +82,12 @@ class boss_gatewatcher_iron_hand : public CreatureScript if (rand()%2) return; - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); + Talk(SAY_SLAY); } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH_1, me); + Talk(SAY_DEATH); //TODO: Add door check/open code } @@ -112,14 +110,14 @@ class boss_gatewatcher_iron_hand : public CreatureScript if (Jackhammer_Timer <= diff) { //TODO: expect cast this about 5 times in a row (?), announce it by emote only once - DoScriptText(EMOTE_HAMMER, me); + Talk(EMOTE_HAMMER); DoCast(me->getVictim(), SPELL_JACKHAMMER); //chance to yell, but not same time as emote (after spell in fact casted) if (rand()%2) - return; + return; - DoScriptText(RAND(SAY_HAMMER_1, SAY_HAMMER_2), me); + Talk(SAY_HAMMER); Jackhammer_Timer = 30000; } else 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 697d2c9f9f9..f8c44471b30 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp index 02be844711d..5a9e551375b 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -29,13 +29,11 @@ EndScriptData */ enum eSays { - SAY_AGGRO = -1554013, - SAY_SUMMON = -1554014, - SAY_DRAGONS_BREATH_1 = -1554015, - SAY_DRAGONS_BREATH_2 = -1554016, - SAY_SLAY1 = -1554017, - SAY_SLAY2 = -1554018, - SAY_DEATH = -1554019, + SAY_AGGRO = 0, + SAY_SUMMON = 1, + SAY_DRAGONS_BREATH = 2, + SAY_SLAY = 3, + SAY_DEATH = 4 }; enum eSpells @@ -92,19 +90,19 @@ class boss_nethermancer_sepethrea : public CreatureScript if (instance) instance->SetData(DATA_NETHERMANCER_EVENT, IN_PROGRESS); - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); DoCast(who, SPELL_SUMMON_RAGIN_FLAMES); - DoScriptText(SAY_SUMMON, me); + Talk(SAY_SUMMON); } void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); + Talk(SAY_SLAY); } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (instance) instance->SetData(DATA_NETHERMANCER_EVENT, DONE); } @@ -140,7 +138,7 @@ class boss_nethermancer_sepethrea : public CreatureScript { if (rand()%2) return; - DoScriptText(RAND(SAY_DRAGONS_BREATH_1, SAY_DRAGONS_BREATH_2), me); + Talk(SAY_DRAGONS_BREATH); } dragons_breath_Timer = urand(12000, 22000); } diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp index 622e6e6d7e6..41296daf1fa 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -28,14 +28,12 @@ EndScriptData */ enum eSays { - SAY_AGGRO = -1554020, - SAY_DOMINATION_1 = -1554021, - SAY_DOMINATION_2 = -1554022, - SAY_SUMMON = -1554023, - SAY_ENRAGE = -1554024, - SAY_SLAY_1 = -1554025, - SAY_SLAY_2 = -1554026, - SAY_DEATH = -1554027, + SAY_AGGRO = 0, + SAY_DOMINATION = 1, + SAY_SUMMON = 2, + SAY_ENRAGE = 3, + SAY_SLAY = 4, + SAY_DEATH = 5 }; // Spells to be casted enum eSpells @@ -96,17 +94,17 @@ class boss_pathaleon_the_calculator : public CreatureScript } void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); } void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); + Talk(SAY_SLAY); } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); summons.DespawnAll(); } @@ -135,7 +133,7 @@ class boss_pathaleon_the_calculator : public CreatureScript if (target && Wraith) Wraith->AI()->AttackStart(target); } - DoScriptText(SAY_SUMMON, me); + Talk(SAY_SUMMON); Summon_Timer = urand(30000, 45000); } else @@ -161,7 +159,7 @@ class boss_pathaleon_the_calculator : public CreatureScript { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) { - DoScriptText(RAND(SAY_DOMINATION_1, SAY_DOMINATION_2), me); + Talk(SAY_DOMINATION); DoCast(target, SPELL_DOMINATION); } Domination_Timer = urand(25000, 30000); @@ -184,7 +182,7 @@ class boss_pathaleon_the_calculator : public CreatureScript if (!Enraged && HealthBelowPct(21)) { DoCast(me, SPELL_FRENZY); - DoScriptText(SAY_ENRAGE, me); + Talk(SAY_ENRAGE); Enraged = true; } diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp index 37e314b6576..1f9ddfcdd0b 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h b/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h index 1ad436892bb..c933c90afef 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp index f45ece47220..cd3fb897181 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h index 8b897b1b96e..9c852196616 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp index 730bab7e626..141257dae63 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -34,16 +34,13 @@ EndContentData */ enum eSays { - SAY_INTRO = -1552000, - SAY_AGGRO = -1552001, - SAY_KILL_1 = -1552002, - SAY_KILL_2 = -1552003, - SAY_MIND_1 = -1552004, - SAY_MIND_2 = -1552005, - SAY_FEAR_1 = -1552006, - SAY_FEAR_2 = -1552007, - SAY_IMAGE = -1552008, - SAY_DEATH = -1552009, + SAY_INTRO = 0, + SAY_AGGRO = 1, + SAY_KILL = 2, + SAY_MIND = 3, + SAY_FEAR = 4, + SAY_IMAGE = 5, + SAY_DEATH = 6 }; enum eSpells @@ -115,7 +112,7 @@ class boss_harbinger_skyriss : public CreatureScript void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (instance) instance->SetData(TYPE_HARBINGERSKYRISS, DONE); } @@ -139,7 +136,7 @@ class boss_harbinger_skyriss : public CreatureScript if (victim->GetEntry() == 21436) return; - DoScriptText(RAND(SAY_KILL_1, SAY_KILL_2), me); + Talk(SAY_KILL); } void DoSplit(uint32 val) @@ -147,7 +144,7 @@ class boss_harbinger_skyriss : public CreatureScript if (me->IsNonMeleeSpellCasted(false)) me->InterruptNonMeleeSpells(false); - DoScriptText(SAY_IMAGE, me); + Talk(SAY_IMAGE); if (val == 66) DoCast(me, SPELL_66_ILLUSION); @@ -167,13 +164,13 @@ class boss_harbinger_skyriss : public CreatureScript switch (Intro_Phase) { case 1: - DoScriptText(SAY_INTRO, me); + Talk(SAY_INTRO); instance->HandleGameObject(instance->GetData64(DATA_SPHERE_SHIELD), true); ++Intro_Phase; Intro_Timer = 25000; break; case 2: - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); if (Unit* mellic = Unit::GetUnit(*me, instance->GetData64(DATA_MELLICHAR))) { //should have a better way to do this. possibly spell exist. @@ -224,7 +221,7 @@ class boss_harbinger_skyriss : public CreatureScript if (me->IsNonMeleeSpellCasted(false)) return; - DoScriptText(RAND(SAY_FEAR_1, SAY_FEAR_2), me); + Talk(SAY_FEAR); if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) DoCast(target, SPELL_FEAR); @@ -241,7 +238,7 @@ class boss_harbinger_skyriss : public CreatureScript if (me->IsNonMeleeSpellCasted(false)) return; - DoScriptText(RAND(SAY_MIND_1, SAY_MIND_2), me); + Talk(SAY_MIND); if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) DoCast(target, SPELL_DOMINATION); diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp index e956ea0ed85..a70b6fb35b4 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_commander_sarannis.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_commander_sarannis.cpp new file mode 100644 index 00000000000..20531f1f110 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_commander_sarannis.cpp @@ -0,0 +1,186 @@ +/* + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "the_botanica.h" +#include "SpellScript.h" + +enum Says +{ + SAY_AGGRO = 0, + SAY_KILL = 1, + SAY_ARCANE_RESONANCE = 2, + SAY_ARCANE_DEVASTATION = 3, + EMOTE_SUMMON = 4, + SAY_SUMMON = 5, + SAY_DEATH = 6 +}; + +enum Spells +{ + SPELL_ARCANE_RESONANCE = 34794, + SPELL_ARCANE_DEVASTATION = 34799, + SPELL_SUMMON_REINFORCEMENTS = 34803 +}; + +enum Events +{ + EVENT_ARCANE_RESONANCE = 1, + EVENT_ARCANE_DEVASTATION = 2 +}; + +class boss_commander_sarannis : public CreatureScript +{ + public: boss_commander_sarannis() : CreatureScript("boss_commander_sarannis") { } + + struct boss_commander_sarannisAI : public BossAI + { + boss_commander_sarannisAI(Creature* creature) : BossAI(creature, DATA_COMMANDER_SARANNIS) { } + + void Reset() + { + _Reset(); + _phase = true; + } + + void EnterCombat(Unit* /*who*/) + { + _EnterCombat(); + Talk(SAY_AGGRO); + events.ScheduleEvent(EVENT_ARCANE_RESONANCE, 42700); + events.ScheduleEvent(EVENT_ARCANE_DEVASTATION, 15200); + } + + void KilledUnit(Unit* /*victim*/) + { + Talk(SAY_KILL); + } + + void JustDied(Unit* /*killer*/) + { + _JustDied(); + Talk(SAY_DEATH); + } + + void DamageTaken(Unit* /*killer*/, uint32 &damage) + { + if (me->HealthBelowPctDamaged(50, damage) && _phase) + { + _phase = false; + Talk(EMOTE_SUMMON); + Talk(SAY_SUMMON); + DoCast(me, SPELL_SUMMON_REINFORCEMENTS); + } + } + + void JustSummoned(Creature* summon) + { + BossAI::JustSummoned(summon); + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_ARCANE_RESONANCE: + Talk(SAY_ARCANE_RESONANCE); + DoCastVictim(SPELL_ARCANE_RESONANCE, true); + events.ScheduleEvent(EVENT_ARCANE_RESONANCE, 42700); + break; + case EVENT_ARCANE_DEVASTATION: + Talk(SAY_ARCANE_DEVASTATION); + DoCastVictim(SPELL_ARCANE_DEVASTATION, true); + events.ScheduleEvent(EVENT_ARCANE_DEVASTATION, urand(11000, 19200)); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + bool _phase; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_commander_sarannisAI(creature); + } +}; + +Position const PosSummonReinforcements[4] = +{ + { 160.4483f, 287.6435f, -3.887904f, 2.3841f }, + { 153.4406f, 289.9929f, -4.736916f, 2.3841f }, + { 154.4137f, 292.8956f, -4.683603f, 2.3841f }, + { 157.1544f, 294.2599f, -4.726504f, 2.3841f } +}; + +enum Creatures +{ + NPC_SUMMONED_BLOODWARDER_MENDER = 20083, + NPC_SUMMONED_BLOODWARDER_RESERVIST = 20078 +}; + +class spell_commander_sarannis_summon_reinforcements : public SpellScriptLoader +{ + public: + spell_commander_sarannis_summon_reinforcements() : SpellScriptLoader("spell_commander_sarannis_summon_reinforcements") { } + + class spell_commander_sarannis_summon_reinforcements_SpellScript : public SpellScript + { + PrepareSpellScript(spell_commander_sarannis_summon_reinforcements_SpellScript); + + void HandleCast(SpellEffIndex /*effIndex*/) + { + GetCaster()->SummonCreature(NPC_SUMMONED_BLOODWARDER_MENDER, PosSummonReinforcements[0], TEMPSUMMON_CORPSE_DESPAWN); + GetCaster()->SummonCreature(NPC_SUMMONED_BLOODWARDER_RESERVIST, PosSummonReinforcements[1], TEMPSUMMON_CORPSE_DESPAWN); + GetCaster()->SummonCreature(NPC_SUMMONED_BLOODWARDER_RESERVIST, PosSummonReinforcements[2], TEMPSUMMON_CORPSE_DESPAWN); + if (GetCaster()->GetMap()->IsHeroic()) + GetCaster()->SummonCreature(NPC_SUMMONED_BLOODWARDER_RESERVIST, PosSummonReinforcements[3], TEMPSUMMON_CORPSE_DESPAWN); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_commander_sarannis_summon_reinforcements_SpellScript::HandleCast, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_commander_sarannis_summon_reinforcements_SpellScript(); + } +}; + +void AddSC_boss_commander_sarannis() +{ + new boss_commander_sarannis(); + new spell_commander_sarannis_summon_reinforcements(); +} diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp index a53f62c96f4..2ab527c2fd5 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -25,15 +25,16 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "the_botanica.h" enum eSays { - SAY_AGGRO = -1553000, - SAY_KILL_1 = -1553001, - SAY_KILL_2 = -1553002, - SAY_TREE_1 = -1553003, - SAY_TREE_2 = -1553004, - SAY_DEATH = -1553005, + SAY_AGGRO = 0, + SAY_KILL = 1, + SAY_TREE = 2, + SAY_SUMMON = 3, + SAY_DEATH = 4, + SAY_OOC_RANDOM = 5 }; enum eSpells @@ -44,7 +45,7 @@ enum eSpells SPELL_PLANT_WHITE = 34759, SPELL_PLANT_GREEN = 34761, SPELL_PLANT_BLUE = 34762, - SPELL_PLANT_RED = 34763, + SPELL_PLANT_RED = 34763 }; #define ENTRY_FRAYER 19953 @@ -58,9 +59,9 @@ class boss_high_botanist_freywinn : public CreatureScript { } - struct boss_high_botanist_freywinnAI : public ScriptedAI + struct boss_high_botanist_freywinnAI : public BossAI { - boss_high_botanist_freywinnAI(Creature* creature) : ScriptedAI(creature) {} + boss_high_botanist_freywinnAI(Creature* creature) : BossAI(creature, DATA_HIGH_BOTANIST_FREYWINN) { } std::list<uint64> Adds_List; @@ -83,7 +84,7 @@ class boss_high_botanist_freywinn : public CreatureScript void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); } void JustSummoned(Creature* summoned) @@ -105,12 +106,12 @@ class boss_high_botanist_freywinn : public CreatureScript void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_KILL_1, SAY_KILL_2), me); + Talk(SAY_KILL); } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); } void UpdateAI(const uint32 diff) @@ -120,7 +121,7 @@ class boss_high_botanist_freywinn : public CreatureScript if (TreeForm_Timer <= diff) { - DoScriptText(RAND(SAY_TREE_1, SAY_TREE_2), me); + Talk(SAY_TREE); if (me->IsNonMeleeSpellCasted(false)) me->InterruptNonMeleeSpells(true); diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp index ed04c42edc7..bd9195e44f8 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "the_botanica.h" enum eSpells { @@ -38,16 +39,16 @@ enum eSpells SPELL_SUMMON_LASHER_3 = 34686, SPELL_SUMMON_FLAYER_4 = 34687, SPELL_SUMMON_LASHER_4 = 34688, - SPELL_SUMMON_FLAYER_3 = 34690, + SPELL_SUMMON_FLAYER_3 = 34690 }; enum eOthers { - EMOTE_SUMMON = -1553006, + EMOTE_SUMMON = 0, MODEL_DEFAULT = 13109, MODEL_ARCANE = 14213, MODEL_FIRE = 13110, MODEL_FROST = 14112, - MODEL_NATURE = 14214, + MODEL_NATURE = 14214 }; class boss_laj : public CreatureScript @@ -59,9 +60,9 @@ class boss_laj : public CreatureScript { } - struct boss_lajAI : public ScriptedAI + struct boss_lajAI : public BossAI { - boss_lajAI(Creature* creature) : ScriptedAI(creature) {} + boss_lajAI(Creature* creature) : BossAI(creature, DATA_LAJ) { } bool CanSummon; uint32 Teleport_Timer; @@ -175,7 +176,7 @@ class boss_laj : public CreatureScript { if (Summon_Timer <= diff) { - DoScriptText(EMOTE_SUMMON, me); + Talk(EMOTE_SUMMON); DoSummons(); Summon_Timer = 2500; } diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_thorngrin_the_tender.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_thorngrin_the_tender.cpp new file mode 100644 index 00000000000..ffd48f4dcb5 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_thorngrin_the_tender.cpp @@ -0,0 +1,152 @@ +/* + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "the_botanica.h" + +enum Says +{ + SAY_AGGRO = 0, + SAY_20_PERCENT_HP = 1, + SAY_KILL = 2, + SAY_CAST_SACRIFICE = 3, + SAY_50_PERCENT_HP = 4, + SAY_CAST_HELLFIRE = 5, + SAY_DEATH = 6, + EMOTE_ENRAGE = 7 +}; + +enum Spells +{ + SPELL_SACRIFICE = 34661, + SPELL_HELLFIRE_NORMAL = 34659, + SPELL_HELLFIRE_HEROIC = 39131, + SPELL_ENRAGE = 34670 +}; + +enum Events +{ + EVENT_SACRIFICE = 1, + EVENT_HELLFIRE = 2, + EVENT_ENRAGE = 3 +}; + +class boss_thorngrin_the_tender : public CreatureScript +{ + public: boss_thorngrin_the_tender() : CreatureScript("thorngrin_the_tender") { } + + struct boss_thorngrin_the_tenderAI : public BossAI + { + boss_thorngrin_the_tenderAI(Creature* creature) : BossAI(creature, DATA_THORNGRIN_THE_TENDER) { } + + void Reset() + { + _Reset(); + _phase1 = true; + _phase2 = true; + } + + void EnterCombat(Unit* /*who*/) + { + _EnterCombat(); + Talk(SAY_AGGRO); + events.ScheduleEvent(EVENT_SACRIFICE, 5700); + events.ScheduleEvent(EVENT_HELLFIRE, IsHeroic() ? urand(17400, 19300) : 18000); + events.ScheduleEvent(EVENT_ENRAGE, 12000); + } + + void KilledUnit(Unit* /*victim*/) + { + Talk(SAY_KILL); + } + + void JustDied(Unit* /*killer*/) + { + _JustDied(); + Talk(SAY_DEATH); + } + + void DamageTaken(Unit* /*killer*/, uint32 &damage) + { + if (me->HealthBelowPctDamaged(50, damage) && _phase1) + { + _phase1 = false; + Talk(SAY_50_PERCENT_HP); + } + if (me->HealthBelowPctDamaged(20, damage) && _phase2) + { + _phase2 = false; + Talk(SAY_20_PERCENT_HP); + } + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_SACRIFICE: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true)) + { + Talk(SAY_CAST_SACRIFICE); + DoCast(target, SPELL_SACRIFICE, true); + } + events.ScheduleEvent(EVENT_SACRIFICE, 29400); + break; + case EVENT_HELLFIRE: + Talk(SAY_CAST_HELLFIRE); + DoCastVictim(DUNGEON_MODE(SPELL_HELLFIRE_NORMAL, SPELL_HELLFIRE_HEROIC), true); + events.ScheduleEvent(EVENT_HELLFIRE, IsHeroic() ? urand(17400, 19300) : 18000); + break; + case EVENT_ENRAGE: + Talk(EMOTE_ENRAGE); + DoCast(me, SPELL_ENRAGE); + events.ScheduleEvent(EVENT_ENRAGE, 33000); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + bool _phase1; + bool _phase2; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_thorngrin_the_tenderAI(creature); + } +}; + +void AddSC_boss_thorngrin_the_tender() +{ + new boss_thorngrin_the_tender(); +} diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp index 2937a5b9987..d2b6c44ec7b 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -25,15 +25,14 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "the_botanica.h" enum eSays { - SAY_AGGRO = -1553007, - SAY_SLAY_1 = -1553008, - SAY_SLAY_2 = -1553009, - SAY_SUMMON_1 = -1553010, - SAY_SUMMON_2 = -1553011, - SAY_DEATH = -1553012, + SAY_AGGRO = 0, + SAY_SLAY = 1, + SAY_SUMMON = 2, + SAY_DEATH = 3 }; enum eSpells @@ -42,13 +41,13 @@ enum eSpells SUMMON_TREANTS = 34727, // DBC: 34727, 34731, 34733, 34734, 34736, 34739, 34741 (with Ancestral Life spell 34742) // won't work (guardian summon) ARCANE_VOLLEY = 36705, ARCANE_VOLLEY_H = 39133, - SPELL_HEAL_FATHER = 6262, + SPELL_HEAL_FATHER = 6262 }; enum eOthers { CREATURE_TREANT = 19949, - TREANT_SPAWN_DIST = 50, //50 yards from Warp Splinter's spawn point + TREANT_SPAWN_DIST = 50 //50 yards from Warp Splinter's spawn point }; float treant_pos[6][3] = @@ -136,9 +135,9 @@ class boss_warp_splinter : public CreatureScript : CreatureScript("boss_warp_splinter") { } - struct boss_warp_splinterAI : public ScriptedAI + struct boss_warp_splinterAI : public BossAI { - boss_warp_splinterAI(Creature* creature) : ScriptedAI(creature) + boss_warp_splinterAI(Creature* creature) : BossAI(creature, DATA_WARP_SPLINTER) { Treant_Spawn_Pos_X = creature->GetPositionX(); Treant_Spawn_Pos_Y = creature->GetPositionY(); @@ -162,17 +161,17 @@ class boss_warp_splinter : public CreatureScript void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); } void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); + Talk(SAY_SLAY); } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); } void SummonTreants() @@ -188,7 +187,7 @@ class boss_warp_splinter : public CreatureScript if (Creature* pTreant = me->SummonCreature(CREATURE_TREANT, treant_pos[i][0], treant_pos[i][1], treant_pos[i][2], O, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000)) CAST_AI(mob_warp_splinter_treant::mob_warp_splinter_treantAI, pTreant->AI())->WarpGuid = me->GetGUID(); } - DoScriptText(RAND(SAY_SUMMON_1, SAY_SUMMON_2), me); + Talk(SAY_SUMMON); } void UpdateAI(const uint32 diff) diff --git a/src/server/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp b/src/server/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp new file mode 100644 index 00000000000..69b95e8c813 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp @@ -0,0 +1,164 @@ +/* + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#include "ScriptMgr.h" +#include "InstanceScript.h" +#include "the_botanica.h" + +class instance_the_botanica : public InstanceMapScript +{ + public: + instance_the_botanica() : InstanceMapScript("instance_the_botanica", 553) { } + + struct instance_the_botanica_InstanceMapScript : public InstanceScript + { + instance_the_botanica_InstanceMapScript(Map* map) : InstanceScript(map) + { + CommanderSarannisGUID = 0; + HighBotanistFreywinnGUID = 0; + ThorngrinTheTenderGUID = 0; + LajGUID = 0; + WarpSplinterGUID = 0; + } + + void OnCreatureCreate(Creature* creature) + { + switch (creature->GetEntry()) + { + case NPC_COMMANDER_SARANNIS: + CommanderSarannisGUID = creature->GetGUID(); + break; + case NPC_HIGH_BOTANIST_FREYWINN: + HighBotanistFreywinnGUID = creature->GetGUID(); + break; + case NPC_THORNGRIN_THE_TENDER: + ThorngrinTheTenderGUID = creature->GetGUID(); + break; + case NPC_LAJ: + LajGUID = creature->GetGUID(); + break; + case NPC_WARP_SPLINTER: + WarpSplinterGUID = creature->GetGUID(); + break; + default: + break; + } + } + + uint64 GetData64(uint32 type) const + { + switch (type) + { + case DATA_COMMANDER_SARANNIS: + return CommanderSarannisGUID; + case DATA_HIGH_BOTANIST_FREYWINN: + return HighBotanistFreywinnGUID; + case DATA_THORNGRIN_THE_TENDER: + return ThorngrinTheTenderGUID; + case DATA_LAJ: + return LajGUID; + case DATA_WARP_SPLINTER: + return WarpSplinterGUID; + default: + break; + } + + return 0; + } + + bool SetBossState(uint32 type, EncounterState state) + { + if (!InstanceScript::SetBossState(type, state)) + return false; + + switch (type) + { + case DATA_COMMANDER_SARANNIS: + case DATA_HIGH_BOTANIST_FREYWINN: + case DATA_THORNGRIN_THE_TENDER: + case DATA_LAJ: + case DATA_WARP_SPLINTER: + break; + default: + break; + } + + return true; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << "B O " << GetBossSaveData(); + + OUT_SAVE_INST_DATA_COMPLETE; + return saveStream.str(); + } + + void Load(char const* str) + { + if (!str) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(str); + + char dataHead1, dataHead2; + + std::istringstream loadStream(str); + loadStream >> dataHead1 >> dataHead2; + + if (dataHead1 == 'B' && dataHead2 == 'O') + { + for (uint8 i = 0; i < EncounterCount; ++i) + { + uint32 tmpState; + loadStream >> tmpState; + if (tmpState == IN_PROGRESS || tmpState > SPECIAL) + tmpState = NOT_STARTED; + + SetBossState(i, EncounterState(tmpState)); + } + } + else + OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } + + protected: + uint64 CommanderSarannisGUID; + uint64 HighBotanistFreywinnGUID; + uint64 ThorngrinTheTenderGUID; + uint64 LajGUID; + uint64 WarpSplinterGUID; + }; + + InstanceScript* GetInstanceScript(InstanceMap* map) const + { + return new instance_the_botanica_InstanceMapScript(map); + } +}; + +void AddSC_instance_the_botanica() +{ + new instance_the_botanica; +} diff --git a/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h b/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h new file mode 100644 index 00000000000..d5657dc7048 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; 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 <http://www.gnu.org/licenses/>. + */ + +#ifndef DEF_THE_BOTANICA_H +#define DEF_THE_BOTANICA_H + +uint32 const EncounterCount = 5; + +enum DataTypes +{ + DATA_COMMANDER_SARANNIS = 0, + DATA_HIGH_BOTANIST_FREYWINN = 1, + DATA_THORNGRIN_THE_TENDER = 2, + DATA_LAJ = 3, + DATA_WARP_SPLINTER = 4 +}; + +enum CreatureIds +{ + NPC_COMMANDER_SARANNIS = 17976, + NPC_HIGH_BOTANIST_FREYWINN = 17975, + NPC_THORNGRIN_THE_TENDER = 17978, + NPC_LAJ = 17980, + NPC_WARP_SPLINTER = 17977 +}; + +#endif diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp index 8398e48e09f..8886e3e41f0 100644 --- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp +++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/boss_doomwalker.cpp b/src/server/scripts/Outland/boss_doomwalker.cpp index ae3bd283db4..9826900d246 100644 --- a/src/server/scripts/Outland/boss_doomwalker.cpp +++ b/src/server/scripts/Outland/boss_doomwalker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp index 3932b96ad07..d03abc82b9c 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/Outland/hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp index 4da98281eb2..64b484268df 100644 --- a/src/server/scripts/Outland/hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -46,16 +46,14 @@ EndContentData */ enum eAeranas { - SAY_SUMMON = -1000138, - SAY_FREE = -1000139, + SAY_SUMMON = 0, + SAY_FREE = 1, FACTION_HOSTILE = 16, FACTION_FRIENDLY = 35, SPELL_ENVELOPING_WINDS = 15535, - SPELL_SHOCK = 12553, - - C_AERANAS = 17085 + SPELL_SHOCK = 12553 }; class npc_aeranas : public CreatureScript @@ -85,7 +83,7 @@ public: me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); me->setFaction(FACTION_FRIENDLY); - DoScriptText(SAY_SUMMON, me); + Talk(SAY_SUMMON); } void UpdateAI(const uint32 diff) @@ -109,7 +107,7 @@ public: me->RemoveAllAuras(); me->DeleteThreatList(); me->CombatStop(true); - DoScriptText(SAY_FREE, me); + Talk(SAY_FREE); return; } @@ -136,9 +134,9 @@ public: enum eAncestralWolf { - EMOTE_WOLF_LIFT_HEAD = -1000496, - EMOTE_WOLF_HOWL = -1000497, - SAY_WOLF_WELCOME = -1000498, + EMOTE_WOLF_LIFT_HEAD = 0, + EMOTE_WOLF_HOWL = 1, + SAY_WOLF_WELCOME = 2, SPELL_ANCESTRAL_WOLF_BUFF = 29981, @@ -168,7 +166,7 @@ public: Reset(); } - Unit* pRyga; + Creature* pRyga; void Reset() { @@ -178,8 +176,9 @@ public: void MoveInLineOfSight(Unit* who) { - if (!pRyga && who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_RYGA && me->IsWithinDistInMap(who, 15.0f)) - pRyga = who; + if (!pRyga && who->GetEntry() == NPC_RYGA && me->IsWithinDistInMap(who, 15.0f)) + if (Creature* temp = who->ToCreature()) + pRyga = temp; npc_escortAI::MoveInLineOfSight(who); } @@ -189,14 +188,14 @@ public: switch (waypointId) { case 0: - DoScriptText(EMOTE_WOLF_LIFT_HEAD, me); + Talk(EMOTE_WOLF_LIFT_HEAD); break; case 2: - DoScriptText(EMOTE_WOLF_HOWL, me); + Talk(EMOTE_WOLF_HOWL); break; case 50: if (pRyga && pRyga->isAlive() && !pRyga->isInCombat()) - DoScriptText(SAY_WOLF_WELCOME, pRyga); + pRyga->AI()->Talk(SAY_WOLF_WELCOME); break; } } @@ -204,22 +203,6 @@ public: }; /*###### -## go_haaleshi_altar -######*/ - -class go_haaleshi_altar : public GameObjectScript -{ -public: - go_haaleshi_altar() : GameObjectScript("go_haaleshi_altar") { } - - bool OnGossipHello(Player* /*player*/, GameObject* go) - { - go->SummonCreature(C_AERANAS, -1321.79f, 4043.80f, 116.24f, 1.25f, TEMPSUMMON_TIMED_DESPAWN, 180000); - return false; - } -}; - -/*###### ## npc_naladu ######*/ @@ -368,12 +351,12 @@ public: enum eWoundedBloodElf { - SAY_ELF_START = -1000117, - SAY_ELF_SUMMON1 = -1000118, - SAY_ELF_RESTING = -1000119, - SAY_ELF_SUMMON2 = -1000120, - SAY_ELF_COMPLETE = -1000121, - SAY_ELF_AGGRO = -1000122, + SAY_ELF_START = 0, + SAY_ELF_SUMMON1 = 1, + SAY_ELF_RESTING = 2, + SAY_ELF_SUMMON2 = 3, + SAY_ELF_COMPLETE = 4, + SAY_ELF_AGGRO = 5, QUEST_ROAD_TO_FALCON_WATCH = 9375 }; @@ -415,25 +398,25 @@ public: switch (waypointId) { case 0: - DoScriptText(SAY_ELF_START, me, player); + Talk(SAY_ELF_START, player->GetGUID()); break; case 9: - DoScriptText(SAY_ELF_SUMMON1, me, player); + Talk(SAY_ELF_SUMMON1, player->GetGUID()); // Spawn two Haal'eshi Talonguard DoSpawnCreature(16967, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); DoSpawnCreature(16967, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); break; case 13: - DoScriptText(SAY_ELF_RESTING, me, player); + Talk(SAY_ELF_RESTING, player->GetGUID()); break; case 14: - DoScriptText(SAY_ELF_SUMMON2, me, player); + Talk(SAY_ELF_SUMMON2, player->GetGUID()); // Spawn two Haal'eshi Windwalker DoSpawnCreature(16966, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); DoSpawnCreature(16966, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); break; case 27: - DoScriptText(SAY_ELF_COMPLETE, me, player); + Talk(SAY_ELF_COMPLETE, player->GetGUID()); // Award quest credit player->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH, me); break; @@ -445,7 +428,7 @@ public: void EnterCombat(Unit* /*who*/) { if (HasEscortState(STATE_ESCORT_ESCORTING)) - DoScriptText(SAY_ELF_AGGRO, me); + Talk(SAY_ELF_AGGRO); } void JustSummoned(Creature* summoned) @@ -531,7 +514,6 @@ void AddSC_hellfire_peninsula() { new npc_aeranas(); new npc_ancestral_wolf(); - new go_haaleshi_altar(); new npc_naladu(); new npc_tracy_proudwell(); new npc_trollbane(); diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/zone_nagrand.cpp index 0c9a60603f5..0a92b985c95 100644 --- a/src/server/scripts/Outland/nagrand.cpp +++ b/src/server/scripts/Outland/zone_nagrand.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -149,13 +149,13 @@ public: enum eMagharCaptive { - SAY_MAG_START = -1000482, - SAY_MAG_NO_ESCAPE = -1000483, - SAY_MAG_MORE = -1000484, - SAY_MAG_MORE_REPLY = -1000485, - SAY_MAG_LIGHTNING = -1000486, - SAY_MAG_SHOCK = -1000487, - SAY_MAG_COMPLETE = -1000488, + SAY_MAG_START = 0, + SAY_MAG_NO_ESCAPE = 0, + SAY_MAG_MORE = 1, + SAY_MAG_MORE_REPLY = 0, + SAY_MAG_LIGHTNING = 2, + SAY_MAG_SHOCK = 3, + SAY_MAG_COMPLETE = 4, SPELL_CHAIN_LIGHTNING = 16006, SPELL_EARTHBIND_TOTEM = 15786, @@ -189,7 +189,7 @@ public: pEscortAI->Start(true, false, player->GetGUID(), quest); - DoScriptText(SAY_MAG_START, creature); + creature->AI()->Talk(SAY_MAG_START); creature->SummonCreature(NPC_MURK_RAIDER, m_afAmbushA[0]+2.5f, m_afAmbushA[1]-2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); creature->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushA[0]-2.5f, m_afAmbushA[1]+2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); @@ -229,17 +229,17 @@ public: switch (waypointId) { case 7: - DoScriptText(SAY_MAG_MORE, me); + Talk(SAY_MAG_MORE); if (Creature* temp = me->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0], m_afAmbushB[1], m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000)) - DoScriptText(SAY_MAG_MORE_REPLY, temp); + temp->AI()->Talk(SAY_MAG_MORE_REPLY); me->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0]-2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]+2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); break; case 16: - DoScriptText(SAY_MAG_COMPLETE, me); + Talk(SAY_MAG_COMPLETE); if (Player* player = GetPlayerForEscort()) player->GroupEventHappens(QUEST_TOTEM_KARDASH_H, me); @@ -252,7 +252,7 @@ public: void JustSummoned(Creature* summoned) { if (summoned->GetEntry() == NPC_MURK_BRUTE) - DoScriptText(SAY_MAG_NO_ESCAPE, summoned); + summoned->AI()->Talk(SAY_MAG_NO_ESCAPE); if (summoned->isTotem()) return; @@ -270,7 +270,7 @@ public: if (rand()%10) return; - DoScriptText(SAY_MAG_LIGHTNING, me); + Talk(SAY_MAG_LIGHTNING); } } @@ -367,18 +367,18 @@ enum CorkiData NPC_CORKI = 18445, NPC_CORKI_CREDIT_1 = 18369, GO_CORKIS_PRISON = 182349, - CORKI_SAY_THANKS = -1800071, + CORKI_SAY_THANKS = 0, // 2nd quest QUEST_CORKIS_GONE_MISSING_AGAIN = 9924, NPC_CORKI_2 = 20812, GO_CORKIS_PRISON_2 = 182350, - CORKI_SAY_PROMISE = -1800072, + CORKI_SAY_PROMISE = 0, // 3rd quest QUEST_CHOWAR_THE_PILLAGER = 9955, NPC_CORKI_3 = 18369, NPC_CORKI_CREDIT_3 = 18444, GO_CORKIS_PRISON_3 = 182521, - CORKI_SAY_LAST = -1800073 + CORKI_SAY_LAST = 0 }; class go_corkis_prison : public GameObjectScript @@ -388,11 +388,11 @@ public: bool OnGossipHello(Player* player, GameObject* go) { + go->SetGoState(GO_STATE_READY); if (go->GetEntry() == GO_CORKIS_PRISON) { if (Creature* corki = go->FindNearestCreature(NPC_CORKI, 25, true)) { - go->SetGoState(GO_STATE_READY); corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()+5, go->GetPositionY(), go->GetPositionZ()); if (player) player->KilledMonsterCredit(NPC_CORKI_CREDIT_1, 0); @@ -403,7 +403,6 @@ public: { if (Creature* corki = go->FindNearestCreature(NPC_CORKI_2, 25, true)) { - go->SetGoState(GO_STATE_READY); corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()-5, go->GetPositionY(), go->GetPositionZ()); if (player) player->KilledMonsterCredit(NPC_CORKI_2, 0); @@ -414,7 +413,6 @@ public: { if (Creature* corki = go->FindNearestCreature(NPC_CORKI_3, 25, true)) { - go->SetGoState(GO_STATE_READY); corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()+4, go->GetPositionY(), go->GetPositionZ()); if (player) player->KilledMonsterCredit(NPC_CORKI_CREDIT_3, 0); @@ -468,11 +466,11 @@ public: Say_Timer = 5000; ReleasedFromCage = true; if (me->GetEntry() == NPC_CORKI) - DoScriptText(CORKI_SAY_THANKS, me); + Talk(CORKI_SAY_THANKS); if (me->GetEntry() == NPC_CORKI_2) - DoScriptText(CORKI_SAY_PROMISE, me); + Talk(CORKI_SAY_PROMISE); if (me->GetEntry() == NPC_CORKI_3) - DoScriptText(CORKI_SAY_LAST, me); + Talk(CORKI_SAY_LAST); } }; }; @@ -521,7 +519,7 @@ public: { creature->SetStandState(UNIT_STAND_STATE_STAND); EscortAI->Start(true, false, player->GetGUID(), quest); - DoScriptText(SAY_KUR_START, creature); + creature->AI()->Talk(SAY_KUR_START); creature->SummonCreature(NPC_KUR_MURK_RAIDER, kurenaiAmbushA[0]+2.5f, kurenaiAmbushA[1]-2.5f, kurenaiAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); creature->SummonCreature(NPC_KUR_MURK_BRUTE, kurenaiAmbushA[0]-2.5f, kurenaiAmbushA[1]+2.5f, kurenaiAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); @@ -683,12 +681,12 @@ class go_warmaul_prison : public GameObjectScript bool OnGossipHello(Player* player, GameObject* go) { + go->UseDoorOrButton(); if (player->GetQuestStatus(QUEST_FINDING_THE_SURVIVORS) != QUEST_STATUS_INCOMPLETE) return false; if (Creature* prisoner = go->FindNearestCreature(NPC_MAGHAR_PRISONER, 5.0f)) { - go->UseDoorOrButton(); player->KilledMonsterCredit(NPC_MAGHAR_PRISONER, 0); prisoner->AI()->Talk(SAY_FREE, player->GetGUID()); diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp index eaea4960712..769ee7dc68d 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/zone_netherstorm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -45,12 +45,12 @@ EndContentData */ //used by 20209, 20417, 20418, 20440, signed for 20209 enum eManaforgeConsoleData { - EMOTE_START = -1000211, - EMOTE_60 = -1000212, - EMOTE_30 = -1000213, - EMOTE_10 = -1000214, - EMOTE_COMPLETE = -1000215, - EMOTE_ABORT = -1000216, + EMOTE_START = 0, + EMOTE_60 = 1, + EMOTE_30 = 2, + EMOTE_10 = 3, + EMOTE_COMPLETE = 4, + EMOTE_ABORT = 5, ENTRY_BNAAR_C_CONSOLE = 20209, ENTRY_CORUU_C_CONSOLE = 20417, @@ -114,7 +114,7 @@ public: void JustDied(Unit* /*killer*/) { - DoScriptText(EMOTE_ABORT, me); + Talk(EMOTE_ABORT); if (someplayer) { @@ -247,31 +247,32 @@ public: if (someplayer) { Unit* u = Unit::GetUnit(*me, someplayer); - if (u && u->GetTypeId() == TYPEID_PLAYER) DoScriptText(EMOTE_START, me, u); + if (u && u->GetTypeId() == TYPEID_PLAYER) + Talk(EMOTE_START, u->GetGUID()); } Event_Timer = 60000; Wave = true; ++Phase; break; case 2: - DoScriptText(EMOTE_60, me); + Talk(EMOTE_60); Event_Timer = 30000; ++Phase; break; case 3: - DoScriptText(EMOTE_30, me); + Talk(EMOTE_30); Event_Timer = 20000; DoFinalSpawnForCreature(me); ++Phase; break; case 4: - DoScriptText(EMOTE_10, me); + Talk(EMOTE_10); Event_Timer = 10000; Wave = false; ++Phase; break; case 5: - DoScriptText(EMOTE_COMPLETE, me); + Talk(EMOTE_COMPLETE); if (someplayer) { Unit* u = Unit::GetUnit(*me, someplayer); @@ -361,17 +362,19 @@ public: // The Speech of Dawnforge, Ardonis & Pathaleon enum eCommanderDawnforgeData { - SAY_COMMANDER_DAWNFORGE_1 = -1000128, - SAY_ARCANIST_ARDONIS_1 = -1000129, - SAY_COMMANDER_DAWNFORGE_2 = -1000130, - SAY_PATHALEON_CULATOR_IMAGE_1 = -1000131, - SAY_COMMANDER_DAWNFORGE_3 = -1000132, - SAY_PATHALEON_CULATOR_IMAGE_2 = -1000133, - SAY_PATHALEON_CULATOR_IMAGE_2_1 = -1000134, - SAY_PATHALEON_CULATOR_IMAGE_2_2 = -1000135, - SAY_COMMANDER_DAWNFORGE_4 = -1000136, - SAY_ARCANIST_ARDONIS_2 = -1000136, - SAY_COMMANDER_DAWNFORGE_5 = -1000137, + SAY_COMMANDER_DAWNFORGE_1 = 0, + SAY_COMMANDER_DAWNFORGE_2 = 1, + SAY_COMMANDER_DAWNFORGE_3 = 2, + SAY_COMMANDER_DAWNFORGE_4 = 3, + SAY_COMMANDER_DAWNFORGE_5 = 4, + + SAY_ARCANIST_ARDONIS_1 = 0, + SAY_ARCANIST_ARDONIS_2 = 1, + + SAY_PATHALEON_CULATOR_IMAGE_1 = 0, + SAY_PATHALEON_CULATOR_IMAGE_2 = 1, + SAY_PATHALEON_CULATOR_IMAGE_2_1 = 2, + SAY_PATHALEON_CULATOR_IMAGE_2_2 = 3, QUEST_INFO_GATHERING = 10198, SPELL_SUNFURY_DISGUISE = 34603, @@ -516,8 +519,8 @@ public: return; } - Unit* ardonis = Unit::GetUnit(*me, ardonisGUID); - Unit* pathaleon = Unit::GetUnit(*me, pathaleonGUID); + Creature* ardonis = Creature::GetCreature(*me, ardonisGUID); + Creature* pathaleon = Creature::GetCreature(*me, pathaleonGUID); Player* player = Unit::GetPlayer(*me, PlayerGUID); if (!ardonis || !player) @@ -536,19 +539,19 @@ public: switch (Phase) { case 1: - DoScriptText(SAY_COMMANDER_DAWNFORGE_1, me); + Talk(SAY_COMMANDER_DAWNFORGE_1); ++Phase; Phase_Timer = 16000; break; //Phase 2 Ardonis say case 2: - DoScriptText(SAY_ARCANIST_ARDONIS_1, ardonis); + ardonis->AI()->Talk(SAY_ARCANIST_ARDONIS_1); ++Phase; Phase_Timer = 16000; break; //Phase 3 Dawnforge say case 3: - DoScriptText(SAY_COMMANDER_DAWNFORGE_2, me); + Talk(SAY_COMMANDER_DAWNFORGE_2); ++Phase; Phase_Timer = 16000; break; @@ -561,7 +564,7 @@ public: break; //Phase 5 Pathaleon say case 5: - DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_1, pathaleon); + pathaleon->AI()->Talk(SAY_PATHALEON_CULATOR_IMAGE_1); ++Phase; Phase_Timer = 6000; break; @@ -577,7 +580,7 @@ public: break; //Subphase 2 Dawnforge say case 1: - DoScriptText(SAY_COMMANDER_DAWNFORGE_3, me); + Talk(SAY_COMMANDER_DAWNFORGE_3); PhaseSubphase = 0; ++Phase; Phase_Timer = 8000; @@ -590,19 +593,19 @@ public: { //Subphase 1 case 0: - DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2, pathaleon); + pathaleon->AI()->Talk(SAY_PATHALEON_CULATOR_IMAGE_2); ++PhaseSubphase; Phase_Timer = 12000; break; //Subphase 2 case 1: - DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_1, pathaleon); + pathaleon->AI()->Talk(SAY_PATHALEON_CULATOR_IMAGE_2_1); ++PhaseSubphase; Phase_Timer = 16000; break; //Subphase 3 case 2: - DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_2, pathaleon); + pathaleon->AI()->Talk(SAY_PATHALEON_CULATOR_IMAGE_2_2); PhaseSubphase = 0; ++Phase; Phase_Timer = 10000; @@ -611,8 +614,8 @@ public: break; //Phase 8 Dawnforge & Ardonis say case 8: - DoScriptText(SAY_COMMANDER_DAWNFORGE_4, me); - DoScriptText(SAY_ARCANIST_ARDONIS_2, ardonis); + Talk(SAY_COMMANDER_DAWNFORGE_4); + ardonis->AI()->Talk(SAY_ARCANIST_ARDONIS_2); ++Phase; Phase_Timer = 4000; break; @@ -627,7 +630,7 @@ public: break; //Phase 10 Dawnforge say case 10: - DoScriptText(SAY_COMMANDER_DAWNFORGE_5, me); + Talk(SAY_COMMANDER_DAWNFORGE_5); player->AreaExploredOrEventHappens(QUEST_INFO_GATHERING); Reset(); break; @@ -667,7 +670,7 @@ enum eProfessorDabiriData { SPELL_PHASE_DISTRUPTOR = 35780, - WHISPER_DABIRI = -1000522, + //WHISPER_DABIRI = 0, not existing in database QUEST_DIMENSIUS = 10439, QUEST_ON_NETHERY_WINGS = 10438, @@ -680,13 +683,9 @@ class npc_professor_dabiri : public CreatureScript public: npc_professor_dabiri() : CreatureScript("npc_professor_dabiri") { } - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_DIMENSIUS) - DoScriptText(WHISPER_DABIRI, creature, player); - - return true; - } + //OnQuestAccept: + //if (quest->GetQuestId() == QUEST_DIMENSIUS) + //creature->AI()->Talk(WHISPER_DABIRI, player->GetGUID()); bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { @@ -725,7 +724,7 @@ enum ePhaseHunterData NPC_PHASE_HUNTER_ENTRY = 18879, NPC_DRAINED_PHASE_HUNTER_ENTRY = 19595, - EMOTE_WEAK = -1000303, + EMOTE_WEAK = 0, // Spells SPELL_RECHARGING_BATTERY = 34219, @@ -827,7 +826,7 @@ public: if (!Weak && HealthBelowPct(WeakPercent) && player->GetQuestStatus(QUEST_RECHARGING_THE_BATTERIES) == QUEST_STATUS_INCOMPLETE) { - DoScriptText(EMOTE_WEAK, me); + Talk(EMOTE_WEAK); Weak = true; } if (Weak && !Drained && me->HasAura(SPELL_RECHARGING_BATTERY)) @@ -857,8 +856,8 @@ enum eBessyData N_THADELL = 20464, SPAWN_FIRST = 20512, SPAWN_SECOND = 19881, - SAY_THADELL_1 = -1000524, - SAY_THADELL_2 = -1000525, + SAY_THADELL_1 = 0, + SAY_THADELL_2 = 1, }; class npc_bessy : public CreatureScript @@ -912,11 +911,11 @@ public: case 12: player->GroupEventHappens(Q_ALMABTRIEB, me); if (me->FindNearestCreature(N_THADELL, 30)) - DoScriptText(SAY_THADELL_1, me); + Talk(SAY_THADELL_1); break; case 13: if (me->FindNearestCreature(N_THADELL, 30)) - DoScriptText(SAY_THADELL_2, me, player); + Talk(SAY_THADELL_2, player->GetGUID()); break; } } @@ -1053,12 +1052,10 @@ class go_captain_tyralius_prison : public GameObjectScript bool OnGossipHello(Player* player, GameObject* go) { + go->UseDoorOrButton(); if (Creature* tyralius = go->FindNearestCreature(NPC_CAPTAIN_TYRALIUS, 1.0f)) { - go->UseDoorOrButton(); - player->KilledMonsterCredit(NPC_CAPTAIN_TYRALIUS, 0); - tyralius->AI()->Talk(SAY_FREE); tyralius->DespawnOrUnsummon(8000); } diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp index dc91fb2c14f..0a016f0923c 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -55,7 +55,7 @@ EndContentData */ enum eMatureNetherwing { - SAY_JUST_EATEN = -1000175, + SAY_JUST_EATEN = 0, SPELL_PLACE_CARCASS = 38439, SPELL_JUST_EATEN = 38502, @@ -152,7 +152,7 @@ public: else if (bIsEating) { DoCast(me, SPELL_JUST_EATEN); - DoScriptText(SAY_JUST_EATEN, me); + Talk(SAY_JUST_EATEN); if (Player* pPlr = Unit::GetPlayer(*me, uiPlayerGUID)) { @@ -674,25 +674,25 @@ enum eOverlordData SPELL_THREE = 40216, // Dragonaw Faction SPELL_FOUR = 42016, // Dragonaw Trasform - OVERLORD_SAY_1 = -1000606, - OVERLORD_SAY_2 = -1000607, - OVERLORD_SAY_3 = -1000608, //signed for 28315 - OVERLORD_SAY_4 = -1000609, - OVERLORD_SAY_5 = -1000610, - OVERLORD_SAY_6 = -1000611, - - OVERLORD_YELL_1 = -1000612, - OVERLORD_YELL_2 = -1000613, - - LORD_ILLIDAN_SAY_1 = -1000614, - LORD_ILLIDAN_SAY_2 = -1000615, - LORD_ILLIDAN_SAY_3 = -1000616, - LORD_ILLIDAN_SAY_4 = -1000617, - LORD_ILLIDAN_SAY_5 = -1000618, - LORD_ILLIDAN_SAY_6 = -1000619, - LORD_ILLIDAN_SAY_7 = -1000620, - - YARZILL_THE_MERC_SAY = -1000621, + OVERLORD_SAY_1 = 0, + OVERLORD_SAY_2 = 1, + //OVERLORD_SAY_3 = 2, + OVERLORD_SAY_4 = 3, + OVERLORD_SAY_5 = 4, + OVERLORD_SAY_6 = 5, + + OVERLORD_YELL_1 = 6, + OVERLORD_YELL_2 = 7, + + LORD_ILLIDAN_SAY_1 = 0, + LORD_ILLIDAN_SAY_2 = 1, + LORD_ILLIDAN_SAY_3 = 2, + LORD_ILLIDAN_SAY_4 = 3, + LORD_ILLIDAN_SAY_5 = 4, + LORD_ILLIDAN_SAY_6 = 5, + LORD_ILLIDAN_SAY_7 = 6, + + YARZILL_THE_MERC_SAY = 0 }; class npc_overlord_morghor : public CreatureScript @@ -754,7 +754,7 @@ public: { Player* player = Unit::GetPlayer(*me, PlayerGUID); if (player) - DoScriptText(OVERLORD_SAY_1, me, player); + Talk(OVERLORD_SAY_1, player->GetGUID()); } ConversationTimer = 4200; Step = 0; @@ -764,7 +764,7 @@ public: uint32 NextStep(uint32 Step) { Player* player = Unit::GetPlayer(*me, PlayerGUID); - Unit* Illi = Unit::GetUnit(*me, IllidanGUID); + Creature* Illi = Creature::GetCreature(*me, IllidanGUID); if (!player || !Illi) { @@ -782,7 +782,7 @@ public: return 9000; break; case 2: - DoScriptText(OVERLORD_YELL_1, me, player); + Talk(OVERLORD_YELL_1, player->GetGUID()); return 4500; break; case 3: @@ -790,7 +790,7 @@ public: return 3200; break; case 4: - DoScriptText(OVERLORD_SAY_2, me, player); + Talk(OVERLORD_SAY_2, player->GetGUID()); return 2000; break; case 5: @@ -805,31 +805,27 @@ public: return 2000; break; case 7: - DoScriptText(OVERLORD_YELL_2, me); + Talk(OVERLORD_YELL_2); return 4500; break; case 8: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); - return 2500; - break; - case 9: - DoScriptText(OVERLORD_SAY_3, me); - return 6500; + return 9000; break; case 10: - DoScriptText(LORD_ILLIDAN_SAY_1, Illi); + Illi->AI()->Talk(LORD_ILLIDAN_SAY_1); return 5000; break; case 11: - DoScriptText(OVERLORD_SAY_4, me, player); + Talk(OVERLORD_SAY_4, player->GetGUID()); return 6000; break; case 12: - DoScriptText(LORD_ILLIDAN_SAY_2, Illi); + Illi->AI()->Talk(LORD_ILLIDAN_SAY_2); return 5500; break; case 13: - DoScriptText(LORD_ILLIDAN_SAY_3, Illi); + Illi->AI()->Talk(LORD_ILLIDAN_SAY_3); return 4000; break; case 14: @@ -837,7 +833,7 @@ public: return 1500; break; case 15: - DoScriptText(LORD_ILLIDAN_SAY_4, Illi); + Illi->AI()->Talk(LORD_ILLIDAN_SAY_4); return 1500; break; case 16: @@ -847,15 +843,15 @@ public: return 5000; break; case 17: - DoScriptText(LORD_ILLIDAN_SAY_5, Illi); + Illi->AI()->Talk(LORD_ILLIDAN_SAY_5); return 5000; break; case 18: - DoScriptText(LORD_ILLIDAN_SAY_6, Illi); + Illi->AI()->Talk(LORD_ILLIDAN_SAY_6); return 5000; break; case 19: - DoScriptText(LORD_ILLIDAN_SAY_7, Illi); + Illi->AI()->Talk(LORD_ILLIDAN_SAY_7); return 5000; break; case 20: @@ -864,7 +860,7 @@ public: return 500; break; case 21: - DoScriptText(OVERLORD_SAY_5, me); + Talk(OVERLORD_SAY_5); return 500; break; case 22: @@ -881,7 +877,7 @@ public: return 5000; break; case 25: - DoScriptText(OVERLORD_SAY_6, me); + Talk(OVERLORD_SAY_6); return 2000; break; case 26: @@ -905,24 +901,21 @@ public: break; case 29: { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) - DoScriptText(YARZILL_THE_MERC_SAY, Yarzill, player); + if (Creature* Yarzill = me->FindNearestCreature(C_YARZILL, 50.0f)) + Yarzill->AI()->Talk(YARZILL_THE_MERC_SAY, player->GetGUID()); return 5000; } break; case 30: { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) + if (Creature* Yarzill = me->FindNearestCreature(C_YARZILL, 50.0f)) Yarzill->SetTarget(0); return 5000; } break; case 31: { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) + if (Creature* Yarzill = me->FindNearestCreature(C_YARZILL, 50.0f)) Yarzill->CastSpell(player, 41540, true); return 1000; } @@ -960,16 +953,13 @@ public: enum eEarthmender { - SAY_WIL_START = -1000381, - SAY_WIL_AGGRO1 = -1000382, - SAY_WIL_AGGRO2 = -1000383, - SAY_WIL_PROGRESS1 = -1000384, - SAY_WIL_PROGRESS2 = -1000385, - SAY_WIL_FIND_EXIT = -1000386, - SAY_WIL_PROGRESS4 = -1000387, - SAY_WIL_PROGRESS5 = -1000388, - SAY_WIL_JUST_AHEAD = -1000389, - SAY_WIL_END = -1000390, + SAY_WIL_START = 0, + SAY_WIL_AGGRO = 1, + SAY_WIL_PROGRESS1 = 2, + SAY_WIL_PROGRESS2 = 3, + SAY_WIL_FIND_EXIT = 4, + SAY_WIL_JUST_AHEAD = 5, + SAY_WIL_END = 6, SPELL_CHAIN_LIGHTNING = 16006, SPELL_EARTHBING_TOTEM = 15786, @@ -990,7 +980,7 @@ public: { if (quest->GetQuestId() == QUEST_ESCAPE_COILSCAR) { - DoScriptText(SAY_WIL_START, creature, player); + creature->AI()->Talk(SAY_WIL_START, player->GetGUID()); creature->setFaction(FACTION_EARTHEN); if (npc_earthmender_wildaAI* pEscortAI = CAST_AI(npc_earthmender_wilda::npc_earthmender_wildaAI, creature->AI())) @@ -1024,14 +1014,14 @@ public: switch (waypointId) { case 13: - DoScriptText(SAY_WIL_PROGRESS1, me, player); + Talk(SAY_WIL_PROGRESS1, player->GetGUID()); DoSpawnAssassin(); break; case 14: DoSpawnAssassin(); break; case 15: - DoScriptText(SAY_WIL_FIND_EXIT, me, player); + Talk(SAY_WIL_FIND_EXIT, player->GetGUID()); break; case 19: DoRandomSay(); @@ -1058,7 +1048,7 @@ public: DoSpawnAssassin(); break; case 39: - DoScriptText(SAY_WIL_JUST_AHEAD, me, player); + Talk(SAY_WIL_JUST_AHEAD, player->GetGUID()); break; case 43: DoRandomSay(); @@ -1067,7 +1057,7 @@ public: DoSpawnAssassin(); break; case 50: - DoScriptText(SAY_WIL_END, me, player); + Talk(SAY_WIL_END, player->GetGUID()); player->GroupEventHappens(QUEST_ESCAPE_COILSCAR, me); break; } @@ -1082,7 +1072,7 @@ public: //this is very unclear, random say without no real relevance to script/event void DoRandomSay() { - DoScriptText(RAND(SAY_WIL_PROGRESS2, SAY_WIL_PROGRESS4, SAY_WIL_PROGRESS5), me); + Talk(SAY_WIL_PROGRESS2); } void DoSpawnAssassin() @@ -1102,7 +1092,7 @@ public: { //appears to be random if (urand(0, 1)) - DoScriptText(RAND(SAY_WIL_AGGRO1, SAY_WIL_AGGRO2), who); + Talk(SAY_WIL_AGGRO); } } @@ -1140,28 +1130,25 @@ npc_lord_illidan_stormrage : Creature that controls the event. go_crystal_prison : GameObject that begins the event and hands out quest EndContentData */ -#define END_TEXT -1000366 //signed for 10646 - #define QUEST_BATTLE_OF_THE_CRIMSON_WATCH 10781 #define EVENT_AREA_RADIUS 65 //65yds #define EVENT_COOLDOWN 30000 //in ms. appear after event completed or failed (should be = Adds despawn time) struct TorlothCinematic { - int32 TextId; uint32 creature, Timer; }; // Creature 0 - Torloth, 1 - Illidan static TorlothCinematic TorlothAnim[]= { - {-1000367, 0, 2000}, - {-1000368, 1, 7000}, - {-1000369, 0, 3000}, - {0, 0, 2000}, // Torloth stand - {-1000370, 0, 1000}, - {0, 0, 3000}, - {0, 0, 0} + {0, 2000}, + {1, 7000}, + {0, 3000}, + {0, 2000}, // Torloth stand + {0, 1000}, + {0, 3000}, + {0, 0} }; struct Location @@ -1195,15 +1182,14 @@ struct WaveData { uint8 SpawnCount, UsedSpawnPoint; uint32 CreatureId, SpawnTimer, YellTimer; - int32 WaveTextId; }; static WaveData WavesInfo[]= { - {9, 0, 22075, 10000, 7000, -1000371}, //Illidari Soldier - {2, 9, 22074, 10000, 7000, -1000372}, //Illidari Mind Breaker - {4, 11, 19797, 10000, 7000, -1000373}, //Illidari Highlord - {1, 15, 22076, 10000, 7000, -1000374} //Torloth The Magnificent + {9, 0, 22075, 10000, 7000}, //Illidari Soldier + {2, 9, 22074, 10000, 7000}, //Illidari Mind Breaker + {4, 11, 19797, 10000, 7000}, //Illidari Highlord + {1, 15, 22076, 10000, 7000} //Torloth The Magnificent }; struct SpawnSpells @@ -1278,9 +1264,6 @@ public: return; } - if (TorlothAnim[AnimationCount].TextId) - DoScriptText(TorlothAnim[AnimationCount].TextId, creature); - AnimationTimer = TorlothAnim[AnimationCount].Timer; switch (AnimationCount) @@ -1377,7 +1360,6 @@ public: if (Creature* LordIllidan = (Unit::GetCreature(*me, LordIllidanGUID))) { - DoScriptText(END_TEXT, LordIllidan, killer); LordIllidan->AI()->EnterEvadeMode(); } } @@ -1512,14 +1494,17 @@ public: { if (!Announced && AnnounceTimer <= diff) { - DoScriptText(WavesInfo[WaveCount].WaveTextId, me); Announced = true; - } else AnnounceTimer -= diff; + } + else + AnnounceTimer -= diff; if (WaveTimer <= diff) { SummonNextWave(); - } else WaveTimer -= diff; + } + else + WaveTimer -= diff; } CheckEventFail(); diff --git a/src/server/scripts/Outland/shattrath_city.cpp b/src/server/scripts/Outland/zone_shattrath_city.cpp index 76cffa9e1fe..ac26614ae69 100644 --- a/src/server/scripts/Outland/shattrath_city.cpp +++ b/src/server/scripts/Outland/zone_shattrath_city.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -286,28 +286,32 @@ public: # npc_kservant ######*/ -#define SAY1 -1000234 -#define WHISP1 -1000235 -#define WHISP2 -1000236 -#define WHISP3 -1000237 -#define WHISP4 -1000238 -#define WHISP5 -1000239 -#define WHISP6 -1000240 -#define WHISP7 -1000241 -#define WHISP8 -1000242 -#define WHISP9 -1000243 -#define WHISP10 -1000244 -#define WHISP11 -1000245 -#define WHISP12 -1000246 -#define WHISP13 -1000247 -#define WHISP14 -1000248 -#define WHISP15 -1000249 -#define WHISP16 -1000250 -#define WHISP17 -1000251 -#define WHISP18 -1000252 -#define WHISP19 -1000253 -#define WHISP20 -1000254 -#define WHISP21 -1000255 +enum KServant +{ + SAY1 = 0, + WHISP1 = 1, + WHISP2 = 2, + WHISP3 = 3, + WHISP4 = 4, + WHISP5 = 5, + WHISP6 = 6, + WHISP7 = 7, + WHISP8 = 8, + WHISP9 = 9, + WHISP10 = 10, + WHISP11 = 11, + WHISP12 = 12, + WHISP13 = 13, + WHISP14 = 14, + WHISP15 = 15, + WHISP16 = 16, + WHISP17 = 17, + WHISP18 = 18, + WHISP19 = 19, + WHISP20 = 20, + WHISP21 = 21 +}; + class npc_kservant : public CreatureScript { public: @@ -332,70 +336,70 @@ public: switch (waypointId) { case 0: - DoScriptText(SAY1, me, player); + Talk(SAY1, player->GetGUID()); break; case 4: - DoScriptText(WHISP1, me, player); + Talk(WHISP1, player->GetGUID()); break; case 6: - DoScriptText(WHISP2, me, player); + Talk(WHISP2, player->GetGUID()); break; case 7: - DoScriptText(WHISP3, me, player); + Talk(WHISP3, player->GetGUID()); break; case 8: - DoScriptText(WHISP4, me, player); + Talk(WHISP4, player->GetGUID()); break; case 17: - DoScriptText(WHISP5, me, player); + Talk(WHISP5, player->GetGUID()); break; case 18: - DoScriptText(WHISP6, me, player); + Talk(WHISP6, player->GetGUID()); break; case 19: - DoScriptText(WHISP7, me, player); + Talk(WHISP7, player->GetGUID()); break; case 33: - DoScriptText(WHISP8, me, player); + Talk(WHISP8, player->GetGUID()); break; case 34: - DoScriptText(WHISP9, me, player); + Talk(WHISP9, player->GetGUID()); break; case 35: - DoScriptText(WHISP10, me, player); + Talk(WHISP10, player->GetGUID()); break; case 36: - DoScriptText(WHISP11, me, player); + Talk(WHISP11, player->GetGUID()); break; case 43: - DoScriptText(WHISP12, me, player); + Talk(WHISP12, player->GetGUID()); break; case 44: - DoScriptText(WHISP13, me, player); + Talk(WHISP13, player->GetGUID()); break; case 49: - DoScriptText(WHISP14, me, player); + Talk(WHISP14, player->GetGUID()); break; case 50: - DoScriptText(WHISP15, me, player); + Talk(WHISP15, player->GetGUID()); break; case 51: - DoScriptText(WHISP16, me, player); + Talk(WHISP16, player->GetGUID()); break; case 52: - DoScriptText(WHISP17, me, player); + Talk(WHISP17, player->GetGUID()); break; case 53: - DoScriptText(WHISP18, me, player); + Talk(WHISP18, player->GetGUID()); break; case 54: - DoScriptText(WHISP19, me, player); + Talk(WHISP19, player->GetGUID()); break; case 55: - DoScriptText(WHISP20, me, player); + Talk(WHISP20, player->GetGUID()); break; case 56: - DoScriptText(WHISP21, me, player); + Talk(WHISP21, player->GetGUID()); player->GroupEventHappens(10211, me); break; } @@ -429,16 +433,19 @@ public: #define GOSSIP_BOOK "Ezekiel said that you might have a certain book..." -#define SAY_1 -1000274 -#define SAY_2 -1000275 -#define SAY_3 -1000276 -#define SAY_4 -1000277 -#define SAY_5 -1000278 -#define SAY_GIVEUP -1000279 - -#define QUEST_WBI 10231 -#define NPC_CREEPJACK 19726 -#define NPC_MALONE 19725 +enum DirtyLarry +{ + SAY_1 = 0, + SAY_2 = 1, + SAY_3 = 2, + SAY_4 = 3, + SAY_5 = 4, + SAY_GIVEUP = 5, + + QUEST_WBI = 10231, + NPC_CREEPJACK = 19726, + NPC_MALONE = 19725 +}; class npc_dirty_larry : public CreatureScript { @@ -500,11 +507,11 @@ public: if (Malone) Malone->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); }return 2000; - case 1: DoScriptText(SAY_1, me, player); return 3000; - case 2: DoScriptText(SAY_2, me, player); return 5000; - case 3: DoScriptText(SAY_3, me, player); return 2000; - case 4: DoScriptText(SAY_4, me, player); return 2000; - case 5: DoScriptText(SAY_5, me, player); return 2000; + case 1: Talk(SAY_1, player->GetGUID()); return 3000; + case 2: Talk(SAY_2, player->GetGUID()); return 5000; + case 3: Talk(SAY_3, player->GetGUID()); return 2000; + case 4: Talk(SAY_4, player->GetGUID()); return 2000; + case 5: Talk(SAY_5, player->GetGUID()); return 2000; case 6: Attack = true; return 2000; default: return 0; } @@ -572,7 +579,7 @@ public: } me->setFaction(1194); Done = true; - DoScriptText(SAY_GIVEUP, me, NULL); + Talk(SAY_GIVEUP); me->DeleteThreatList(); me->CombatStop(); me->GetMotionMaster()->MoveTargetedHome(); diff --git a/src/server/scripts/Outland/terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp index 2298f676692..2b046a7518e 100644 --- a/src/server/scripts/Outland/terokkar_forest.cpp +++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -45,14 +45,16 @@ EndContentData */ ## mob_unkor_the_ruthless ######*/ -#define SAY_SUBMIT -1000194 +enum UnkorTheRuthless +{ + SAY_SUBMIT = 0, -#define FACTION_HOSTILE 45 -#define FACTION_FRIENDLY 35 -#define QUEST_DONTKILLTHEFATONE 9889 + FACTION_HOSTILE = 45, + FACTION_FRIENDLY = 35, + QUEST_DONTKILLTHEFATONE = 9889, -#define SPELL_PULVERIZE 2676 -//#define SPELL_QUID9889 32174 + SPELL_PULVERIZE = 2676 +}; class mob_unkor_the_ruthless : public CreatureScript { @@ -85,7 +87,7 @@ public: void DoNice() { - DoScriptText(SAY_SUBMIT, me); + Talk(SAY_SUBMIT); me->setFaction(FACTION_FRIENDLY); me->SetStandState(UNIT_STAND_STATE_SIT); me->RemoveAllAuras(); @@ -344,7 +346,7 @@ public: enum eFloon { - SAY_FLOON_ATTACK = -1000195, + SAY_FLOON_ATTACK = 0, SPELL_SILENCE = 6726, SPELL_FROSTBOLT = 9672, @@ -371,7 +373,7 @@ public: { player->CLOSE_GOSSIP_MENU(); creature->setFaction(FACTION_HOSTILE_FL); - DoScriptText(SAY_FLOON_ATTACK, creature, player); + creature->AI()->Talk(SAY_FLOON_ATTACK, player->GetGUID()); creature->AI()->AttackStart(player); } return true; @@ -447,10 +449,10 @@ public: ######*/ enum eIslaStarmaneData { - SAY_PROGRESS_1 = -1000571, - SAY_PROGRESS_2 = -1000572, - SAY_PROGRESS_3 = -1000573, - SAY_PROGRESS_4 = -1000574, + SAY_PROGRESS_1 = 0, + SAY_PROGRESS_2 = 1, + SAY_PROGRESS_3 = 2, + SAY_PROGRESS_4 = 3, QUEST_EFTW_H = 10052, QUEST_EFTW_A = 10051, @@ -480,16 +482,16 @@ public: Cage->SetGoState(GO_STATE_ACTIVE); break; case 2: - DoScriptText(SAY_PROGRESS_1, me, player); + Talk(SAY_PROGRESS_1, player->GetGUID()); break; case 5: - DoScriptText(SAY_PROGRESS_2, me, player); + Talk(SAY_PROGRESS_2, player->GetGUID()); break; case 6: - DoScriptText(SAY_PROGRESS_3, me, player); + Talk(SAY_PROGRESS_3, player->GetGUID()); break; case 29: - DoScriptText(SAY_PROGRESS_4, me, player); + Talk(SAY_PROGRESS_4, player->GetGUID()); if (player->GetTeam() == ALLIANCE) player->GroupEventHappens(QUEST_EFTW_A, me); else if (player->GetTeam() == HORDE) diff --git a/src/server/scripts/Outland/zangarmarsh.cpp b/src/server/scripts/Outland/zone_zangarmarsh.cpp index 03e40b8d7dc..319da372bf8 100644 --- a/src/server/scripts/Outland/zangarmarsh.cpp +++ b/src/server/scripts/Outland/zone_zangarmarsh.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -45,9 +45,24 @@ EndContentData */ #define GOSSIP_ITEM_BLESS_ASH "Grant me your mark, wise ancient." #define GOSSIP_ITEM_BLESS_KEL "Grant me your mark, mighty ancient." -//signed for 17900 but used by 17900, 17901 -#define GOSSIP_REWARD_BLESS -1000359 -//#define TEXT_BLESSINGS "<You need higher standing with Cenarion Expedition to recive a blessing.>" + +enum AshyenAndKeleth +{ + GOSSIP_REWARD_BLESS = 0, + + NPC_ASHYEN = 17900, + NPC_KELETH = 17901, + + SPELL_BLESS_ASH_EXA = 31815, + SPELL_BLESS_ASH_REV = 31811, + SPELL_BLESS_ASH_HON = 31810, + SPELL_BLESS_ASH_FRI = 31808, + + SPELL_BLESS_KEL_EXA = 31814, + SPELL_BLESS_KEL_REV = 31813, + SPELL_BLESS_KEL_HON = 31812, + SPELL_BLESS_KEL_FRI = 31807 +}; class npcs_ashyen_and_keleth : public CreatureScript { @@ -58,10 +73,10 @@ public: { if (player->GetReputationRank(942) > REP_NEUTRAL) { - if (creature->GetEntry() == 17900) + if (creature->GetEntry() == NPC_ASHYEN) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_ASH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - if (creature->GetEntry() == 17901) + if (creature->GetEntry() == NPC_KELETH) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_KEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); } player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); @@ -78,54 +93,60 @@ public: creature->SetMaxPower(POWER_MANA, 200); //set a "fake" mana value, we can't depend on database doing it in this case creature->SetPower(POWER_MANA, 200); - if (creature->GetEntry() == 17900) //check which Creature we are dealing with + if (creature->GetEntry() == NPC_ASHYEN) //check which Creature we are dealing with { + uint32 spell = 0; switch (player->GetReputationRank(942)) { //mark of lore case REP_FRIENDLY: - creature->CastSpell(player, 31808, true); - DoScriptText(GOSSIP_REWARD_BLESS, creature); + spell = SPELL_BLESS_ASH_FRI; break; case REP_HONORED: - creature->CastSpell(player, 31810, true); - DoScriptText(GOSSIP_REWARD_BLESS, creature); + spell = SPELL_BLESS_ASH_HON; break; case REP_REVERED: - creature->CastSpell(player, 31811, true); - DoScriptText(GOSSIP_REWARD_BLESS, creature); + spell = SPELL_BLESS_ASH_REV; break; case REP_EXALTED: - creature->CastSpell(player, 31815, true); - DoScriptText(GOSSIP_REWARD_BLESS, creature); + spell = SPELL_BLESS_ASH_EXA; break; default: break; } + + if (spell) + { + creature->CastSpell(player, spell, true); + creature->AI()->Talk(GOSSIP_REWARD_BLESS); + } } - if (creature->GetEntry() == 17901) + if (creature->GetEntry() == NPC_KELETH) { + uint32 spell = 0; switch (player->GetReputationRank(942)) //mark of war { case REP_FRIENDLY: - creature->CastSpell(player, 31807, true); - DoScriptText(GOSSIP_REWARD_BLESS, creature); + spell = SPELL_BLESS_KEL_FRI; break; case REP_HONORED: - creature->CastSpell(player, 31812, true); - DoScriptText(GOSSIP_REWARD_BLESS, creature); + spell = SPELL_BLESS_KEL_HON; break; case REP_REVERED: - creature->CastSpell(player, 31813, true); - DoScriptText(GOSSIP_REWARD_BLESS, creature); + spell = SPELL_BLESS_KEL_REV; break; case REP_EXALTED: - creature->CastSpell(player, 31814, true); - DoScriptText(GOSSIP_REWARD_BLESS, creature); + spell = SPELL_BLESS_KEL_EXA; break; default: break; } + + if (spell) + { + creature->CastSpell(player, spell, true); + creature->AI()->Talk(GOSSIP_REWARD_BLESS); + } } player->CLOSE_GOSSIP_MENU(); player->TalkedToCreature(creature->GetEntry(), creature->GetGUID()); @@ -304,12 +325,11 @@ public: enum eKayra { - SAY_START = -1000343, - SAY_AMBUSH1 = -1000344, - SAY_PROGRESS = -1000345, - SAY_AMBUSH2 = -1000346, - SAY_NEAR_END = -1000347, - SAY_END = -1000348, //this is signed for 10646 + SAY_START = 0, + SAY_AMBUSH1 = 1, + SAY_PROGRESS = 2, + SAY_AMBUSH2 = 3, + SAY_END = 4, QUEST_ESCAPE_FROM = 9752, NPC_SLAVEBINDER = 18042 @@ -335,25 +355,24 @@ public: switch (waypointId) { case 4: - DoScriptText(SAY_AMBUSH1, me, player); + Talk(SAY_AMBUSH1, player->GetGUID()); DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; case 5: - DoScriptText(SAY_PROGRESS, me, player); + Talk(SAY_PROGRESS, player->GetGUID()); SetRun(); break; case 16: - DoScriptText(SAY_AMBUSH2, me, player); + Talk(SAY_AMBUSH2, player->GetGUID()); DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; case 17: SetRun(false); - DoScriptText(SAY_NEAR_END, me, player); break; case 25: - DoScriptText(SAY_END, me, player); + Talk(SAY_END, player->GetGUID()); player->GroupEventHappens(QUEST_ESCAPE_FROM, me); break; } @@ -364,7 +383,7 @@ public: { if (quest->GetQuestId() == QUEST_ESCAPE_FROM) { - DoScriptText(SAY_START, creature, player); + creature->AI()->Talk(SAY_START, player->GetGUID()); if (npc_escortAI* pEscortAI = CAST_AI(npc_kayra_longmane::npc_kayra_longmaneAI, creature->AI())) pEscortAI->Start(false, false, player->GetGUID()); diff --git a/src/server/scripts/Spells/CMakeLists.txt b/src/server/scripts/Spells/CMakeLists.txt index 2bb695bd8a9..077b4ccab5e 100644 --- a/src/server/scripts/Spells/CMakeLists.txt +++ b/src/server/scripts/Spells/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 224e909ca57..afb9a625761 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -28,21 +28,30 @@ enum DeathKnightSpells { - DK_SPELL_RUNIC_POWER_ENERGIZE = 49088, - DK_SPELL_ANTI_MAGIC_SHELL_TALENT = 51052, - DK_SPELL_CORPSE_EXPLOSION_TRIGGERED = 43999, - DK_SPELL_CORPSE_EXPLOSION_VISUAL = 51270, - DK_SPELL_GHOUL_EXPLODE = 47496, - DK_SPELL_SCOURGE_STRIKE_TRIGGERED = 70890, - DK_SPELL_BLOOD_BOIL_TRIGGERED = 65658, - DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189, - DK_SPELL_WILL_OF_THE_NECROPOLIS_AURA_R1 = 52284, - DK_SPELL_BLOOD_PRESENCE = 48266, - DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED = 63611, - DK_SPELL_UNHOLY_PRESENCE = 48265, - DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED = 63622, + SPELL_DK_ANTI_MAGIC_SHELL_TALENT = 51052, + SPELL_DK_BLACK_ICE_R1 = 49140, + SPELL_DK_BLOOD_BOIL_TRIGGERED = 65658, + SPELL_DK_CORPSE_EXPLOSION_TRIGGERED = 43999, + SPELL_DK_CORPSE_EXPLOSION_VISUAL = 51270, + SPELL_DK_DEATH_COIL_DAMAGE = 47632, + SPELL_DK_DEATH_COIL_HEAL = 47633, + SPELL_DK_DEATH_STRIKE_HEAL = 45470, + SPELL_DK_GHOUL_EXPLODE = 47496, + SPELL_DK_RUNIC_POWER_ENERGIZE = 49088, + SPELL_DK_SCOURGE_STRIKE_TRIGGERED = 70890, + SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189, + SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1 = 52284, + SPELL_DK_BLOOD_PRESENCE = 48266, + SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED = 63611, + SPELL_DK_UNHOLY_PRESENCE = 48265, + SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED = 63622, + SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART = 64962, SPELL_DK_ITEM_T8_MELEE_4P_BONUS = 64736, - DK_SPELL_BLACK_ICE_R1 = 49140, +}; + +enum DeathKnightSpellIcons +{ + DK_ICON_ID_IMPROVED_DEATH_STRIKE = 2751, }; // 50462 - Anti-Magic Shell (on raid member) @@ -71,13 +80,13 @@ class spell_dk_anti_magic_shell_raid : public SpellScriptLoader void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) { - absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct); + absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct); } void Register() { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_anti_magic_shell_raid_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); - OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_anti_magic_shell_raid_AuraScript::Absorb, EFFECT_0); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_anti_magic_shell_raid_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); + OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_anti_magic_shell_raid_AuraScript::Absorb, EFFECT_0); } }; @@ -105,9 +114,9 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader return true; } - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(DK_SPELL_RUNIC_POWER_ENERGIZE)) + if (!sSpellMgr->GetSpellInfo(SPELL_DK_RUNIC_POWER_ENERGIZE)) return false; return true; } @@ -128,14 +137,14 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader // damage absorbed by Anti-Magic Shell energizes the DK with additional runic power. // This, if I'm not mistaken, shows that we get back ~20% of the absorbed damage as runic power. int32 bp = absorbAmount * 2 / 10; - target->CastCustomSpell(target, DK_SPELL_RUNIC_POWER_ENERGIZE, &bp, NULL, NULL, true, NULL, aurEff); + target->CastCustomSpell(target, SPELL_DK_RUNIC_POWER_ENERGIZE, &bp, NULL, NULL, true, NULL, aurEff); } void Register() { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_anti_magic_shell_self_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); - OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_anti_magic_shell_self_AuraScript::Absorb, EFFECT_0); - AfterEffectAbsorb += AuraEffectAbsorbFn(spell_dk_anti_magic_shell_self_AuraScript::Trigger, EFFECT_0); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_anti_magic_shell_self_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); + OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_anti_magic_shell_self_AuraScript::Absorb, EFFECT_0); + AfterEffectAbsorb += AuraEffectAbsorbFn(spell_dk_anti_magic_shell_self_AuraScript::Trigger, EFFECT_0); } }; @@ -165,14 +174,14 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(DK_SPELL_ANTI_MAGIC_SHELL_TALENT)) + if (!sSpellMgr->GetSpellInfo(SPELL_DK_ANTI_MAGIC_SHELL_TALENT)) return false; return true; } void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) { - SpellInfo const* talentSpell = sSpellMgr->GetSpellInfo(DK_SPELL_ANTI_MAGIC_SHELL_TALENT); + SpellInfo const* talentSpell = sSpellMgr->GetSpellInfo(SPELL_DK_ANTI_MAGIC_SHELL_TALENT); amount = talentSpell->Effects[EFFECT_0].CalcValue(GetCaster()); if (Player* player = GetCaster()->ToPlayer()) amount += int32(2 * player->GetTotalAttackPowerValue(BASE_ATTACK)); @@ -196,7 +205,53 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader } }; -// 49158 Corpse Explosion (51325, 51326, 51327, 51328) +// 48721 - Blood Boil +class spell_dk_blood_boil : public SpellScriptLoader +{ + public: + spell_dk_blood_boil() : SpellScriptLoader("spell_dk_blood_boil") { } + + class spell_dk_blood_boil_SpellScript : public SpellScript + { + PrepareSpellScript(spell_dk_blood_boil_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_BOIL_TRIGGERED)) + return false; + return true; + } + + bool Load() + { + _executed = false; + return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCaster()->getClass() == CLASS_DEATH_KNIGHT; + } + + void HandleAfterHit() + { + if (_executed || !GetHitUnit()) + return; + + _executed = true; + GetCaster()->CastSpell(GetCaster(), SPELL_DK_BLOOD_BOIL_TRIGGERED, true); + } + + void Register() + { + AfterHit += SpellHitFn(spell_dk_blood_boil_SpellScript::HandleAfterHit); + } + + bool _executed; + }; + + SpellScript* GetSpellScript() const + { + return new spell_dk_blood_boil_SpellScript(); + } +}; + +// 49158 - Corpse Explosion (51325, 51326, 51327, 51328) class spell_dk_corpse_explosion : public SpellScriptLoader { public: @@ -206,11 +261,11 @@ class spell_dk_corpse_explosion : public SpellScriptLoader { PrepareSpellScript(spell_dk_corpse_explosion_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(DK_SPELL_CORPSE_EXPLOSION_TRIGGERED) || !sSpellMgr->GetSpellInfo(DK_SPELL_GHOUL_EXPLODE)) + if (!sSpellMgr->GetSpellInfo(SPELL_DK_CORPSE_EXPLOSION_TRIGGERED) || !sSpellMgr->GetSpellInfo(SPELL_DK_GHOUL_EXPLODE)) return false; - if (!sSpellMgr->GetSpellInfo(DK_SPELL_CORPSE_EXPLOSION_VISUAL)) + if (!sSpellMgr->GetSpellInfo(SPELL_DK_CORPSE_EXPLOSION_VISUAL)) return false; return true; } @@ -223,17 +278,17 @@ class spell_dk_corpse_explosion : public SpellScriptLoader if (unitTarget->isAlive()) // Living ghoul as a target { bp = int32(unitTarget->CountPctFromMaxHealth(25)); - unitTarget->CastCustomSpell(unitTarget, DK_SPELL_GHOUL_EXPLODE, &bp, NULL, NULL, false); + unitTarget->CastCustomSpell(unitTarget, SPELL_DK_GHOUL_EXPLODE, &bp, NULL, NULL, false); } else // Some corpse { bp = GetEffectValue(); GetCaster()->CastCustomSpell(unitTarget, GetSpellInfo()->Effects[EFFECT_1].CalcValue(), &bp, NULL, NULL, true); // Corpse Explosion (Suicide) - unitTarget->CastSpell(unitTarget, DK_SPELL_CORPSE_EXPLOSION_TRIGGERED, true); + unitTarget->CastSpell(unitTarget, SPELL_DK_CORPSE_EXPLOSION_TRIGGERED, true); } // Set corpse look - GetCaster()->CastSpell(unitTarget, DK_SPELL_CORPSE_EXPLOSION_VISUAL, true); + GetCaster()->CastSpell(unitTarget, SPELL_DK_CORPSE_EXPLOSION_VISUAL, true); } } @@ -249,44 +304,74 @@ class spell_dk_corpse_explosion : public SpellScriptLoader } }; -// 47496 - Explode, Ghoul spell for Corpse Explosion -class spell_dk_ghoul_explode : public SpellScriptLoader +// -47541, 52375, 59134, -62900 - Death Coil +class spell_dk_death_coil : public SpellScriptLoader { public: - spell_dk_ghoul_explode() : SpellScriptLoader("spell_dk_ghoul_explode") { } + spell_dk_death_coil() : SpellScriptLoader("spell_dk_death_coil") { } - class spell_dk_ghoul_explode_SpellScript : public SpellScript + class spell_dk_death_coil_SpellScript : public SpellScript { - PrepareSpellScript(spell_dk_ghoul_explode_SpellScript); + PrepareSpellScript(spell_dk_death_coil_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(DK_SPELL_CORPSE_EXPLOSION_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(SPELL_DK_DEATH_COIL_DAMAGE) || !sSpellMgr->GetSpellInfo(SPELL_DK_DEATH_COIL_HEAL)) return false; return true; } - void Suicide(SpellEffIndex /*effIndex*/) + void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* unitTarget = GetHitUnit()) + int32 damage = GetEffectValue(); + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) { - // Corpse Explosion (Suicide) - unitTarget->CastSpell(unitTarget, DK_SPELL_CORPSE_EXPLOSION_TRIGGERED, true); + if (caster->IsFriendlyTo(target)) + { + int32 bp = int32(damage * 1.5f); + caster->CastCustomSpell(target, SPELL_DK_DEATH_COIL_HEAL, &bp, NULL, NULL, true); + } + else + { + if (AuraEffect const* auraEffect = caster->GetAuraEffect(SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART, EFFECT_1)) + damage += auraEffect->GetBaseAmount(); + caster->CastCustomSpell(target, SPELL_DK_DEATH_COIL_DAMAGE, &damage, NULL, NULL, true); + } + } + } + + SpellCastResult CheckCast() + { + Unit* caster = GetCaster(); + if (Unit* target = GetExplTargetUnit()) + { + if (!caster->IsFriendlyTo(target) && !caster->isInFront(target)) + return SPELL_FAILED_UNIT_NOT_INFRONT; + + if (target->IsFriendlyTo(caster) && target->GetCreatureType() != CREATURE_TYPE_UNDEAD) + return SPELL_FAILED_BAD_TARGETS; } + else + return SPELL_FAILED_BAD_TARGETS; + + return SPELL_CAST_OK; } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_dk_ghoul_explode_SpellScript::Suicide, EFFECT_1, SPELL_EFFECT_SCHOOL_DAMAGE); + OnCheckCast += SpellCheckCastFn(spell_dk_death_coil_SpellScript::CheckCast); + OnEffectHitTarget += SpellEffectFn(spell_dk_death_coil_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; SpellScript* GetSpellScript() const { - return new spell_dk_ghoul_explode_SpellScript(); + return new spell_dk_death_coil_SpellScript(); } }; +// 52751 - Death Gate class spell_dk_death_gate : public SpellScriptLoader { public: @@ -327,6 +412,41 @@ class spell_dk_death_gate : public SpellScriptLoader } }; +// 49560 - Death Grip +class spell_dk_death_grip : public SpellScriptLoader +{ + public: + spell_dk_death_grip() : SpellScriptLoader("spell_dk_death_grip") { } + + class spell_dk_death_grip_SpellScript : public SpellScript + { + PrepareSpellScript(spell_dk_death_grip_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + int32 damage = GetEffectValue(); + Position const* pos = GetExplTargetDest(); + if (Unit* target = GetHitUnit()) + { + if (!target->HasAuraType(SPELL_AURA_DEFLECT_SPELLS)) // Deterrence + target->CastSpell(pos->GetPositionX(), pos->GetPositionY(), pos->GetPositionZ(), damage, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_dk_death_grip_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + + }; + + SpellScript* GetSpellScript() const + { + return new spell_dk_death_grip_SpellScript(); + } +}; + +// 48743 - Death Pact class spell_dk_death_pact : public SpellScriptLoader { public: @@ -351,22 +471,22 @@ class spell_dk_death_pact : public SpellScriptLoader return SPELL_FAILED_NO_PET; } - void FilterTargets(std::list<WorldObject*>& unitList) + void FilterTargets(std::list<WorldObject*>& targetList) { - Unit* unit_to_add = NULL; - for (std::list<WorldObject*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr) + Unit* target = NULL; + for (std::list<WorldObject*>::iterator itr = targetList.begin(); itr != targetList.end(); ++itr) { if (Unit* unit = (*itr)->ToUnit()) - if (unit->GetOwnerGUID() == GetCaster()->GetGUID() && unit->GetCreatureType() == CREATURE_TYPE_UNDEAD) - { - unit_to_add = unit; - break; - } + if (unit->GetOwnerGUID() == GetCaster()->GetGUID() && unit->GetCreatureType() == CREATURE_TYPE_UNDEAD) + { + target = unit; + break; + } } - unitList.clear(); - if (unit_to_add) - unitList.push_back(unit_to_add); + targetList.clear(); + if (target) + targetList.push_back(target); } void Register() @@ -382,26 +502,19 @@ class spell_dk_death_pact : public SpellScriptLoader } }; -// 55090 Scourge Strike (55265, 55270, 55271) -class spell_dk_scourge_strike : public SpellScriptLoader +// -49998 - Death Strike +class spell_dk_death_strike : public SpellScriptLoader { public: - spell_dk_scourge_strike() : SpellScriptLoader("spell_dk_scourge_strike") { } + spell_dk_death_strike() : SpellScriptLoader("spell_dk_death_strike") { } - class spell_dk_scourge_strike_SpellScript : public SpellScript + class spell_dk_death_strike_SpellScript : public SpellScript { - PrepareSpellScript(spell_dk_scourge_strike_SpellScript); - float multiplier; - - bool Load() - { - multiplier = 1.0f; - return true; - } + PrepareSpellScript(spell_dk_death_strike_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(DK_SPELL_SCOURGE_STRIKE_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(SPELL_DK_DEATH_STRIKE_HEAL)) return false; return true; } @@ -409,442 +522,329 @@ class spell_dk_scourge_strike : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); - if (Unit* unitTarget = GetHitUnit()) - { - multiplier = (GetEffectValue() * unitTarget->GetDiseasesByCaster(caster->GetGUID()) / 100.f); - // Death Knight T8 Melee 4P Bonus - if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_DK_ITEM_T8_MELEE_4P_BONUS, EFFECT_0)) - AddPct(multiplier, aurEff->GetAmount()); - } - } - - void HandleAfterHit() - { - Unit* caster = GetCaster(); - if (Unit* unitTarget = GetHitUnit()) + if (Unit* target = GetHitUnit()) { - int32 bp = GetHitDamage() * multiplier; - - if (AuraEffect* aurEff = caster->GetAuraEffectOfRankedSpell(DK_SPELL_BLACK_ICE_R1, EFFECT_0)) - AddPct(bp, aurEff->GetAmount()); - - caster->CastCustomSpell(unitTarget, DK_SPELL_SCOURGE_STRIKE_TRIGGERED, &bp, NULL, NULL, true); + uint32 count = target->GetDiseasesByCaster(caster->GetGUID()); + int32 bp = int32(count * caster->CountPctFromMaxHealth(int32(GetSpellInfo()->Effects[EFFECT_0].DamageMultiplier))); + // Improved Death Strike + if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_DEATHKNIGHT, DK_ICON_ID_IMPROVED_DEATH_STRIKE, 0)) + AddPct(bp, caster->CalculateSpellDamage(caster, aurEff->GetSpellInfo(), 2)); + caster->CastCustomSpell(caster, SPELL_DK_DEATH_STRIKE_HEAL, &bp, NULL, NULL, false); } } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_dk_scourge_strike_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY); - AfterHit += SpellHitFn(spell_dk_scourge_strike_SpellScript::HandleAfterHit); + OnEffectHitTarget += SpellEffectFn(spell_dk_death_strike_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY); } + }; SpellScript* GetSpellScript() const { - return new spell_dk_scourge_strike_SpellScript(); + return new spell_dk_death_strike_SpellScript(); } }; -// 49145 - Spell Deflection -class spell_dk_spell_deflection : public SpellScriptLoader +// 47496 - Explode, Ghoul spell for Corpse Explosion +class spell_dk_ghoul_explode : public SpellScriptLoader { public: - spell_dk_spell_deflection() : SpellScriptLoader("spell_dk_spell_deflection") { } + spell_dk_ghoul_explode() : SpellScriptLoader("spell_dk_ghoul_explode") { } - class spell_dk_spell_deflection_AuraScript : public AuraScript + class spell_dk_ghoul_explode_SpellScript : public SpellScript { - PrepareAuraScript(spell_dk_spell_deflection_AuraScript); - - uint32 absorbPct; + PrepareSpellScript(spell_dk_ghoul_explode_SpellScript); - bool Load() + bool Validate(SpellInfo const* /*spellInfo*/) { - absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); + if (!sSpellMgr->GetSpellInfo(SPELL_DK_CORPSE_EXPLOSION_TRIGGERED)) + return false; return true; } - void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) - { - // Set absorbtion amount to unlimited - amount = -1; - } - - void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) + void Suicide(SpellEffIndex /*effIndex*/) { - // You have a chance equal to your Parry chance - if ((dmgInfo.GetDamageType() == SPELL_DIRECT_DAMAGE) && roll_chance_f(GetTarget()->GetUnitParryChance())) - absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct); + if (Unit* unitTarget = GetHitUnit()) + { + // Corpse Explosion (Suicide) + unitTarget->CastSpell(unitTarget, SPELL_DK_CORPSE_EXPLOSION_TRIGGERED, true); + } } void Register() { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_spell_deflection_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); - OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_spell_deflection_AuraScript::Absorb, EFFECT_0); + OnEffectHitTarget += SpellEffectFn(spell_dk_ghoul_explode_SpellScript::Suicide, EFFECT_1, SPELL_EFFECT_SCHOOL_DAMAGE); } }; - AuraScript* GetAuraScript() const + SpellScript* GetSpellScript() const { - return new spell_dk_spell_deflection_AuraScript(); + return new spell_dk_ghoul_explode_SpellScript(); } }; -// 48721 Blood Boil -class spell_dk_blood_boil : public SpellScriptLoader +// 50365, 50371 - Improved Blood Presence +class spell_dk_improved_blood_presence : public SpellScriptLoader { public: - spell_dk_blood_boil() : SpellScriptLoader("spell_dk_blood_boil") { } + spell_dk_improved_blood_presence() : SpellScriptLoader("spell_dk_improved_blood_presence") { } - class spell_dk_blood_boil_SpellScript : public SpellScript + class spell_dk_improved_blood_presence_AuraScript : public AuraScript { - PrepareSpellScript(spell_dk_blood_boil_SpellScript); + PrepareAuraScript(spell_dk_improved_blood_presence_AuraScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(DK_SPELL_BLOOD_BOIL_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE) || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) return false; return true; } - bool Load() + void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { - _executed = false; - return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCaster()->getClass() == CLASS_DEATH_KNIGHT; + Unit* target = GetTarget(); + if (!target->HasAura(SPELL_DK_BLOOD_PRESENCE) && !target->HasAura(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) + { + int32 basePoints1 = aurEff->GetAmount(); + target->CastCustomSpell(target, SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED, NULL, &basePoints1, NULL, true, 0, aurEff); + } } - void HandleAfterHit() + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (_executed || !GetHitUnit()) - return; - - _executed = true; - GetCaster()->CastSpell(GetCaster(), DK_SPELL_BLOOD_BOIL_TRIGGERED, true); + Unit* target = GetTarget(); + if (!target->HasAura(SPELL_DK_BLOOD_PRESENCE)) + target->RemoveAura(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED); } void Register() { - AfterHit += SpellHitFn(spell_dk_blood_boil_SpellScript::HandleAfterHit); + AfterEffectApply += AuraEffectApplyFn(spell_dk_improved_blood_presence_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_dk_improved_blood_presence_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); } - - bool _executed; }; - SpellScript* GetSpellScript() const + AuraScript* GetAuraScript() const { - return new spell_dk_blood_boil_SpellScript(); + return new spell_dk_improved_blood_presence_AuraScript(); } }; -// 52284 - Will of the Necropolis -class spell_dk_will_of_the_necropolis : public SpellScriptLoader +// 50391, 50392 - Improved Unholy Presence +class spell_dk_improved_unholy_presence : public SpellScriptLoader { public: - spell_dk_will_of_the_necropolis() : SpellScriptLoader("spell_dk_will_of_the_necropolis") { } + spell_dk_improved_unholy_presence() : SpellScriptLoader("spell_dk_improved_unholy_presence") { } - class spell_dk_will_of_the_necropolis_AuraScript : public AuraScript + class spell_dk_improved_unholy_presence_AuraScript : public AuraScript { - PrepareAuraScript(spell_dk_will_of_the_necropolis_AuraScript); + PrepareAuraScript(spell_dk_improved_unholy_presence_AuraScript); - bool Validate(SpellInfo const* spellEntry) + bool Validate(SpellInfo const* /*spellInfo*/) { - // can't use other spell than will of the necropolis due to spell_ranks dependency - if (sSpellMgr->GetFirstSpellInChain(DK_SPELL_WILL_OF_THE_NECROPOLIS_AURA_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id)) - return false; - - uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id); - if (!sSpellMgr->GetSpellWithRank(DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank, true)) + if (!sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE) || !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED)) return false; - return true; } - uint32 absorbPct; - - bool Load() + void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { - absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); - return true; + Unit* target = GetTarget(); + if (target->HasAura(SPELL_DK_UNHOLY_PRESENCE) && !target->HasAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED)) + { + // Not listed as any effect, only base points set in dbc + int32 basePoints0 = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + target->CastCustomSpell(target, SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, &basePoints0, &basePoints0, &basePoints0, true, 0, aurEff); + } } - void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - // Set absorbtion amount to unlimited - amount = -1; - } - - void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) - { - // min pct of hp is stored in effect 0 of talent spell - uint32 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); - SpellInfo const* talentProto = sSpellMgr->GetSpellInfo(sSpellMgr->GetSpellWithRank(DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank)); - - int32 remainingHp = int32(GetTarget()->GetHealth() - dmgInfo.GetDamage()); - int32 minHp = int32(GetTarget()->CountPctFromMaxHealth(talentProto->Effects[EFFECT_0].CalcValue(GetCaster()))); - - // Damage that would take you below [effect0] health or taken while you are at [effect0] - if (remainingHp < minHp) - absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct); + GetTarget()->RemoveAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED); } void Register() { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_will_of_the_necropolis_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); - OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_will_of_the_necropolis_AuraScript::Absorb, EFFECT_0); + AfterEffectApply += AuraEffectApplyFn(spell_dk_improved_unholy_presence_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_dk_improved_unholy_presence_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); } }; AuraScript* GetAuraScript() const { - return new spell_dk_will_of_the_necropolis_AuraScript(); + return new spell_dk_improved_unholy_presence_AuraScript(); } }; -// 50365, 50371 Improved Blood Presence -class spell_dk_improved_blood_presence : public SpellScriptLoader +// 55090 - Scourge Strike (55265, 55270, 55271) +class spell_dk_scourge_strike : public SpellScriptLoader { -public: - spell_dk_improved_blood_presence() : SpellScriptLoader("spell_dk_improved_blood_presence") { } - - class spell_dk_improved_blood_presence_AuraScript : public AuraScript - { - PrepareAuraScript(spell_dk_improved_blood_presence_AuraScript); + public: + spell_dk_scourge_strike() : SpellScriptLoader("spell_dk_scourge_strike") { } - bool Validate(SpellInfo const* /*entry*/) + class spell_dk_scourge_strike_SpellScript : public SpellScript { - if (!sSpellMgr->GetSpellInfo(DK_SPELL_BLOOD_PRESENCE) || !sSpellMgr->GetSpellInfo(DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) - return false; - return true; - } + PrepareSpellScript(spell_dk_scourge_strike_SpellScript); + float multiplier; - void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - if (!target->HasAura(DK_SPELL_BLOOD_PRESENCE) && !target->HasAura(DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) + bool Load() { - int32 basePoints1 = aurEff->GetAmount(); - target->CastCustomSpell(target, DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED, NULL, &basePoints1, NULL, true, 0, aurEff); + multiplier = 1.0f; + return true; } - } - - void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - if (!target->HasAura(DK_SPELL_BLOOD_PRESENCE)) - target->RemoveAura(DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED); - } - void Register() - { - AfterEffectApply += AuraEffectApplyFn(spell_dk_improved_blood_presence_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - AfterEffectRemove += AuraEffectRemoveFn(spell_dk_improved_blood_presence_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_dk_improved_blood_presence_AuraScript(); - } -}; - -// 50391, 50392 Improved Unholy Presence -class spell_dk_improved_unholy_presence : public SpellScriptLoader -{ -public: - spell_dk_improved_unholy_presence() : SpellScriptLoader("spell_dk_improved_unholy_presence") { } - - class spell_dk_improved_unholy_presence_AuraScript : public AuraScript - { - PrepareAuraScript(spell_dk_improved_unholy_presence_AuraScript); - - bool Validate(SpellInfo const* /*entry*/) - { - if (!sSpellMgr->GetSpellInfo(DK_SPELL_UNHOLY_PRESENCE) || !sSpellMgr->GetSpellInfo(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED)) - return false; - return true; - } - - void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - if (target->HasAura(DK_SPELL_UNHOLY_PRESENCE) && !target->HasAura(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED)) + bool Validate(SpellInfo const* /*spellInfo*/) { - // Not listed as any effect, only base points set in dbc - int32 basePoints0 = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); - target->CastCustomSpell(target, DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, &basePoints0, &basePoints0, &basePoints0, true, 0, aurEff); + if (!sSpellMgr->GetSpellInfo(SPELL_DK_SCOURGE_STRIKE_TRIGGERED)) + return false; + return true; } - } - - void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - GetTarget()->RemoveAura(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED); - } - - void Register() - { - AfterEffectApply += AuraEffectApplyFn(spell_dk_improved_unholy_presence_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - AfterEffectRemove += AuraEffectRemoveFn(spell_dk_improved_unholy_presence_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_dk_improved_unholy_presence_AuraScript(); - } -}; - -enum DeathStrike -{ - ICON_ID_IMPROVED_DEATH_STRIKE = 2751, - SPELL_DEATH_STRIKE_HEAL = 45470, -}; - -class spell_dk_death_strike : public SpellScriptLoader -{ - public: - spell_dk_death_strike() : SpellScriptLoader("spell_dk_death_strike") { } - - class spell_dk_death_strike_SpellScript : public SpellScript - { - PrepareSpellScript(spell_dk_death_strike_SpellScript); - bool Validate(SpellInfo const* /*SpellEntry*/) + void HandleDummy(SpellEffIndex /*effIndex*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_DEATH_STRIKE_HEAL)) - return false; - return true; + Unit* caster = GetCaster(); + if (Unit* unitTarget = GetHitUnit()) + { + multiplier = (GetEffectValue() * unitTarget->GetDiseasesByCaster(caster->GetGUID()) / 100.f); + // Death Knight T8 Melee 4P Bonus + if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_DK_ITEM_T8_MELEE_4P_BONUS, EFFECT_0)) + AddPct(multiplier, aurEff->GetAmount()); + } } - void HandleDummy(SpellEffIndex /* effIndex */) + void HandleAfterHit() { Unit* caster = GetCaster(); - if (Unit* target = GetHitUnit()) + if (Unit* unitTarget = GetHitUnit()) { - uint32 count = target->GetDiseasesByCaster(caster->GetGUID()); - int32 bp = int32(count * caster->CountPctFromMaxHealth(int32(GetSpellInfo()->Effects[EFFECT_0].DamageMultiplier))); - // Improved Death Strike - if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_DEATHKNIGHT, ICON_ID_IMPROVED_DEATH_STRIKE, 0)) - AddPct(bp, caster->CalculateSpellDamage(caster, aurEff->GetSpellInfo(), 2)); - caster->CastCustomSpell(caster, SPELL_DEATH_STRIKE_HEAL, &bp, NULL, NULL, false); + int32 bp = GetHitDamage() * multiplier; + + if (AuraEffect* aurEff = caster->GetAuraEffectOfRankedSpell(SPELL_DK_BLACK_ICE_R1, EFFECT_0)) + AddPct(bp, aurEff->GetAmount()); + + caster->CastCustomSpell(unitTarget, SPELL_DK_SCOURGE_STRIKE_TRIGGERED, &bp, NULL, NULL, true); } } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_dk_death_strike_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_dk_scourge_strike_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY); + AfterHit += SpellHitFn(spell_dk_scourge_strike_SpellScript::HandleAfterHit); } - }; SpellScript* GetSpellScript() const { - return new spell_dk_death_strike_SpellScript(); + return new spell_dk_scourge_strike_SpellScript(); } }; -enum DeathCoil -{ - SPELL_DEATH_COIL_DAMAGE = 47632, - SPELL_DEATH_COIL_HEAL = 47633, - SPELL_SIGIL_VENGEFUL_HEART = 64962, -}; - -class spell_dk_death_coil : public SpellScriptLoader +// 49145 - Spell Deflection +class spell_dk_spell_deflection : public SpellScriptLoader { public: - spell_dk_death_coil() : SpellScriptLoader("spell_dk_death_coil") { } + spell_dk_spell_deflection() : SpellScriptLoader("spell_dk_spell_deflection") { } - class spell_dk_death_coil_SpellScript : public SpellScript + class spell_dk_spell_deflection_AuraScript : public AuraScript { - PrepareSpellScript(spell_dk_death_coil_SpellScript); + PrepareAuraScript(spell_dk_spell_deflection_AuraScript); - bool Validate(SpellInfo const* /*spell*/) + uint32 absorbPct; + + bool Load() { - if (!sSpellMgr->GetSpellInfo(SPELL_DEATH_COIL_DAMAGE) || !sSpellMgr->GetSpellInfo(SPELL_DEATH_COIL_HEAL)) - return false; + absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); return true; } - void HandleDummy(SpellEffIndex /*effIndex*/) + void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) { - int32 damage = GetEffectValue(); - Unit* caster = GetCaster(); - if (Unit* target = GetHitUnit()) - { - if (caster->IsFriendlyTo(target)) - { - int32 bp = int32(damage * 1.5f); - caster->CastCustomSpell(target, SPELL_DEATH_COIL_HEAL, &bp, NULL, NULL, true); - } - else - { - if (AuraEffect const* auraEffect = caster->GetAuraEffect(SPELL_SIGIL_VENGEFUL_HEART, EFFECT_1)) - damage += auraEffect->GetBaseAmount(); - caster->CastCustomSpell(target, SPELL_DEATH_COIL_DAMAGE, &damage, NULL, NULL, true); - } - } + // Set absorbtion amount to unlimited + amount = -1; } - SpellCastResult CheckCast() + void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) { - Unit* caster = GetCaster(); - if (Unit* target = GetExplTargetUnit()) - { - if (!caster->IsFriendlyTo(target) && !caster->isInFront(target)) - return SPELL_FAILED_UNIT_NOT_INFRONT; - - if (target->IsFriendlyTo(caster) && target->GetCreatureType() != CREATURE_TYPE_UNDEAD) - return SPELL_FAILED_BAD_TARGETS; - } - else - return SPELL_FAILED_BAD_TARGETS; - - return SPELL_CAST_OK; + // You have a chance equal to your Parry chance + if ((dmgInfo.GetDamageType() == SPELL_DIRECT_DAMAGE) && roll_chance_f(GetTarget()->GetUnitParryChance())) + absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct); } void Register() { - OnCheckCast += SpellCheckCastFn(spell_dk_death_coil_SpellScript::CheckCast); - OnEffectHitTarget += SpellEffectFn(spell_dk_death_coil_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_spell_deflection_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); + OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_spell_deflection_AuraScript::Absorb, EFFECT_0); } - }; - SpellScript* GetSpellScript() const + AuraScript* GetAuraScript() const { - return new spell_dk_death_coil_SpellScript(); + return new spell_dk_spell_deflection_AuraScript(); } }; -class spell_dk_death_grip : public SpellScriptLoader +// 52284 - Will of the Necropolis +class spell_dk_will_of_the_necropolis : public SpellScriptLoader { public: - spell_dk_death_grip() : SpellScriptLoader("spell_dk_death_grip") { } + spell_dk_will_of_the_necropolis() : SpellScriptLoader("spell_dk_will_of_the_necropolis") { } - class spell_dk_death_grip_SpellScript : public SpellScript + class spell_dk_will_of_the_necropolis_AuraScript : public AuraScript { - PrepareSpellScript(spell_dk_death_grip_SpellScript); + PrepareAuraScript(spell_dk_will_of_the_necropolis_AuraScript); - void HandleDummy(SpellEffIndex /*effIndex*/) + bool Validate(SpellInfo const* spellInfo) { - int32 damage = GetEffectValue(); - Position const* pos = GetExplTargetDest(); - if (Unit* target = GetHitUnit()) - { - if (!target->HasAuraType(SPELL_AURA_DEFLECT_SPELLS)) // Deterrence - target->CastSpell(pos->GetPositionX(), pos->GetPositionY(), pos->GetPositionZ(), damage, true); - } + // can't use other spell than will of the necropolis due to spell_ranks dependency + if (sSpellMgr->GetFirstSpellInChain(SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1) != sSpellMgr->GetFirstSpellInChain(spellInfo->Id)) + return false; + + uint8 rank = sSpellMgr->GetSpellRank(spellInfo->Id); + if (!sSpellMgr->GetSpellWithRank(SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank, true)) + return false; + + return true; } - void Register() + uint32 absorbPct; + + bool Load() { - OnEffectHitTarget += SpellEffectFn(spell_dk_death_grip_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); + return true; + } + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) + { + // Set absorbtion amount to unlimited + amount = -1; + } + + void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) + { + // min pct of hp is stored in effect 0 of talent spell + uint32 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); + SpellInfo const* talentProto = sSpellMgr->GetSpellInfo(sSpellMgr->GetSpellWithRank(SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank)); + + int32 remainingHp = int32(GetTarget()->GetHealth() - dmgInfo.GetDamage()); + int32 minHp = int32(GetTarget()->CountPctFromMaxHealth(talentProto->Effects[EFFECT_0].CalcValue(GetCaster()))); + + // Damage that would take you below [effect0] health or taken while you are at [effect0] + if (remainingHp < minHp) + absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct); } + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_will_of_the_necropolis_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); + OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_will_of_the_necropolis_AuraScript::Absorb, EFFECT_0); + } }; - SpellScript* GetSpellScript() const + AuraScript* GetAuraScript() const { - return new spell_dk_death_grip_SpellScript(); + return new spell_dk_will_of_the_necropolis_AuraScript(); } }; @@ -853,17 +853,17 @@ void AddSC_deathknight_spell_scripts() new spell_dk_anti_magic_shell_raid(); new spell_dk_anti_magic_shell_self(); new spell_dk_anti_magic_zone(); + new spell_dk_blood_boil(); new spell_dk_corpse_explosion(); - new spell_dk_ghoul_explode(); + new spell_dk_death_coil(); new spell_dk_death_gate(); + new spell_dk_death_grip(); new spell_dk_death_pact(); + new spell_dk_death_strike(); + new spell_dk_ghoul_explode(); + new spell_dk_improved_blood_presence(); + new spell_dk_improved_unholy_presence(); new spell_dk_scourge_strike(); new spell_dk_spell_deflection(); - new spell_dk_blood_boil(); new spell_dk_will_of_the_necropolis(); - new spell_dk_improved_blood_presence(); - new spell_dk_improved_unholy_presence(); - new spell_dk_death_strike(); - new spell_dk_death_coil(); - new spell_dk_death_grip(); } diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 0fe6c367a9a..a0307f994c9 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 2e36d3811f6..4a1b0d558ff 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -367,59 +367,9 @@ class spell_gen_remove_flight_auras : public SpellScriptLoader } }; -// 66118 Leeching Swarm -enum LeechingSwarmSpells -{ - SPELL_LEECHING_SWARM_DMG = 66240, - SPELL_LEECHING_SWARM_HEAL = 66125, -}; - -class spell_gen_leeching_swarm : public SpellScriptLoader -{ - public: - spell_gen_leeching_swarm() : SpellScriptLoader("spell_gen_leeching_swarm") { } - - class spell_gen_leeching_swarm_AuraScript : public AuraScript - { - PrepareAuraScript(spell_gen_leeching_swarm_AuraScript); - - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_LEECHING_SWARM_DMG) || !sSpellMgr->GetSpellInfo(SPELL_LEECHING_SWARM_HEAL)) - return false; - return true; - } - - void HandleEffectPeriodic(AuraEffect const* aurEff) - { - Unit* caster = GetCaster(); - if (Unit* target = GetTarget()) - { - int32 lifeLeeched = target->CountPctFromCurHealth(aurEff->GetAmount()); - if (lifeLeeched < 250) - lifeLeeched = 250; - // Damage - caster->CastCustomSpell(target, SPELL_LEECHING_SWARM_DMG, &lifeLeeched, 0, 0, false); - // Heal - caster->CastCustomSpell(caster, SPELL_LEECHING_SWARM_HEAL, &lifeLeeched, 0, 0, false); - } - } - - void Register() - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_leeching_swarm_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_gen_leeching_swarm_AuraScript(); - } -}; - enum EluneCandle { - NPC_OMEN = 15467, + NPC_OMEN = 15467, SPELL_ELUNE_CANDLE_OMEN_HEAD = 26622, SPELL_ELUNE_CANDLE_OMEN_CHEST = 26624, @@ -483,128 +433,6 @@ class spell_gen_elune_candle : public SpellScriptLoader } }; -// 24750 Trick -enum TrickSpells -{ - SPELL_PIRATE_COSTUME_MALE = 24708, - SPELL_PIRATE_COSTUME_FEMALE = 24709, - SPELL_NINJA_COSTUME_MALE = 24710, - SPELL_NINJA_COSTUME_FEMALE = 24711, - SPELL_LEPER_GNOME_COSTUME_MALE = 24712, - SPELL_LEPER_GNOME_COSTUME_FEMALE = 24713, - SPELL_SKELETON_COSTUME = 24723, - SPELL_GHOST_COSTUME_MALE = 24735, - SPELL_GHOST_COSTUME_FEMALE = 24736, - SPELL_TRICK_BUFF = 24753, -}; - -class spell_gen_trick : public SpellScriptLoader -{ - public: - spell_gen_trick() : SpellScriptLoader("spell_gen_trick") {} - - class spell_gen_trick_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_trick_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_MALE) - || !sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_FEMALE) - || !sSpellMgr->GetSpellInfo(SPELL_SKELETON_COSTUME) || !sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_TRICK_BUFF)) - return false; - return true; - } - - void HandleScript(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - if (Player* target = GetHitPlayer()) - { - uint8 gender = target->getGender(); - uint32 spellId = SPELL_TRICK_BUFF; - switch (urand(0, 5)) - { - case 1: - spellId = gender ? SPELL_LEPER_GNOME_COSTUME_FEMALE : SPELL_LEPER_GNOME_COSTUME_MALE; - break; - case 2: - spellId = gender ? SPELL_PIRATE_COSTUME_FEMALE : SPELL_PIRATE_COSTUME_MALE; - break; - case 3: - spellId = gender ? SPELL_GHOST_COSTUME_FEMALE : SPELL_GHOST_COSTUME_MALE; - break; - case 4: - spellId = gender ? SPELL_NINJA_COSTUME_FEMALE : SPELL_NINJA_COSTUME_MALE; - break; - case 5: - spellId = SPELL_SKELETON_COSTUME; - break; - default: - break; - } - - caster->CastSpell(target, spellId, true, NULL); - } - } - - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_gen_trick_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_gen_trick_SpellScript(); - } -}; - -// 24751 Trick or Treat -enum TrickOrTreatSpells -{ - SPELL_TRICK = 24714, - SPELL_TREAT = 24715, - SPELL_TRICKED_OR_TREATED = 24755 -}; - -class spell_gen_trick_or_treat : public SpellScriptLoader -{ - public: - spell_gen_trick_or_treat() : SpellScriptLoader("spell_gen_trick_or_treat") {} - - class spell_gen_trick_or_treat_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_trick_or_treat_SpellScript); - - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_TRICK) || !sSpellMgr->GetSpellInfo(SPELL_TREAT) || !sSpellMgr->GetSpellInfo(SPELL_TRICKED_OR_TREATED)) - return false; - return true; - } - - void HandleScript(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - if (Player* target = GetHitPlayer()) - { - caster->CastSpell(target, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true, NULL); - caster->CastSpell(target, SPELL_TRICKED_OR_TREATED, true, NULL); - } - } - - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_gen_trick_or_treat_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_gen_trick_or_treat_SpellScript(); - } -}; - class spell_creature_permanent_feign_death : public SpellScriptLoader { public: @@ -1590,7 +1418,7 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader if (group->isLFGGroup()) if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true)) if (LFGDungeonData const* dungeon = sLFGMgr->GetLFGDungeon(dungeonId)) - if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == uint32(map->GetDifficulty())) + if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty()) if (randomDungeon && randomDungeon->type == LFG_TYPE_RANDOM) return; // in correct dungeon @@ -3367,12 +3195,9 @@ void AddSC_generic_spell_scripts() new spell_gen_av_drekthar_presence(); new spell_gen_burn_brutallus(); new spell_gen_cannibalize(); - new spell_gen_leeching_swarm(); new spell_gen_parachute(); new spell_gen_pet_summoned(); new spell_gen_remove_flight_auras(); - new spell_gen_trick(); - new spell_gen_trick_or_treat(); new spell_creature_permanent_feign_death(); new spell_pvp_trinket_wotf_shared_cd(); new spell_gen_animal_blood(); diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index 5b1cbe0c36a..83532e7d72d 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -110,7 +110,241 @@ class spell_love_is_in_the_air_romantic_picnic : public SpellScriptLoader } }; +// 24750 Trick +enum TrickSpells +{ + SPELL_PIRATE_COSTUME_MALE = 24708, + SPELL_PIRATE_COSTUME_FEMALE = 24709, + SPELL_NINJA_COSTUME_MALE = 24710, + SPELL_NINJA_COSTUME_FEMALE = 24711, + SPELL_LEPER_GNOME_COSTUME_MALE = 24712, + SPELL_LEPER_GNOME_COSTUME_FEMALE = 24713, + SPELL_SKELETON_COSTUME = 24723, + SPELL_GHOST_COSTUME_MALE = 24735, + SPELL_GHOST_COSTUME_FEMALE = 24736, + SPELL_TRICK_BUFF = 24753, +}; + +class spell_hallow_end_trick : public SpellScriptLoader +{ + public: + spell_hallow_end_trick() : SpellScriptLoader("spell_hallow_end_trick") { } + + class spell_hallow_end_trick_SpellScript : public SpellScript + { + PrepareSpellScript(spell_hallow_end_trick_SpellScript); + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_MALE) + || !sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_FEMALE) + || !sSpellMgr->GetSpellInfo(SPELL_SKELETON_COSTUME) || !sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_TRICK_BUFF)) + return false; + return true; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Player* target = GetHitPlayer()) + { + uint8 gender = target->getGender(); + uint32 spellId = SPELL_TRICK_BUFF; + switch (urand(0, 5)) + { + case 1: + spellId = gender ? SPELL_LEPER_GNOME_COSTUME_FEMALE : SPELL_LEPER_GNOME_COSTUME_MALE; + break; + case 2: + spellId = gender ? SPELL_PIRATE_COSTUME_FEMALE : SPELL_PIRATE_COSTUME_MALE; + break; + case 3: + spellId = gender ? SPELL_GHOST_COSTUME_FEMALE : SPELL_GHOST_COSTUME_MALE; + break; + case 4: + spellId = gender ? SPELL_NINJA_COSTUME_FEMALE : SPELL_NINJA_COSTUME_MALE; + break; + case 5: + spellId = SPELL_SKELETON_COSTUME; + break; + default: + break; + } + + caster->CastSpell(target, spellId, true, NULL); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_hallow_end_trick_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_hallow_end_trick_SpellScript(); + } +}; + +// 24751 Trick or Treat +enum TrickOrTreatSpells +{ + SPELL_TRICK = 24714, + SPELL_TREAT = 24715, + SPELL_TRICKED_OR_TREATED = 24755, + SPELL_TRICKY_TREAT_SPEED = 42919, + SPELL_TRICKY_TREAT_TRIGGER = 42965, + SPELL_UPSET_TUMMY = 42966 +}; + +class spell_hallow_end_trick_or_treat : public SpellScriptLoader +{ + public: + spell_hallow_end_trick_or_treat() : SpellScriptLoader("spell_hallow_end_trick_or_treat") {} + + class spell_hallow_end_trick_or_treat_SpellScript : public SpellScript + { + PrepareSpellScript(spell_hallow_end_trick_or_treat_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_TRICK) || !sSpellMgr->GetSpellInfo(SPELL_TREAT) || !sSpellMgr->GetSpellInfo(SPELL_TRICKED_OR_TREATED)) + return false; + return true; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Player* target = GetHitPlayer()) + { + caster->CastSpell(target, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true, NULL); + caster->CastSpell(target, SPELL_TRICKED_OR_TREATED, true, NULL); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_hallow_end_trick_or_treat_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_hallow_end_trick_or_treat_SpellScript(); + } +}; + +class spell_hallow_end_tricky_treat : public SpellScriptLoader +{ + public: + spell_hallow_end_tricky_treat() : SpellScriptLoader("spell_hallow_end_tricky_treat") { } + + class spell_hallow_end_tricky_treat_SpellScript : public SpellScript + { + PrepareSpellScript(spell_hallow_end_tricky_treat_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_TRICKY_TREAT_SPEED)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_TRICKY_TREAT_TRIGGER)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_UPSET_TUMMY)) + return false; + return true; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (caster->HasAura(SPELL_TRICKY_TREAT_TRIGGER) && caster->GetAuraCount(SPELL_TRICKY_TREAT_SPEED) > 3 && roll_chance_i(33)) + caster->CastSpell(caster, SPELL_UPSET_TUMMY, true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_hallow_end_tricky_treat_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_hallow_end_tricky_treat_SpellScript(); + } +}; + +enum Mistletoe +{ + SPELL_CREATE_MISTLETOE = 26206, + SPELL_CREATE_HOLLY = 26207, + SPELL_CREATE_SNOWFLAKES = 45036 +}; + +class spell_winter_veil_mistletoe : public SpellScriptLoader +{ + public: + spell_winter_veil_mistletoe() : SpellScriptLoader("spell_winter_veil_mistletoe") { } + + class spell_winter_veil_mistletoe_SpellScript : public SpellScript + { + PrepareSpellScript(spell_winter_veil_mistletoe_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_MISTLETOE) || + !sSpellMgr->GetSpellInfo(SPELL_CREATE_HOLLY) || + !sSpellMgr->GetSpellInfo(SPELL_CREATE_SNOWFLAKES)) + return false; + return true; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + + if (Player* target = GetHitPlayer()) + { + uint32 spellId = 0; + switch (urand(0, 2)) + { + case 0: + spellId = SPELL_CREATE_MISTLETOE; + break; + case 1: + spellId = SPELL_CREATE_HOLLY; + break; + case 2: + spellId = SPELL_CREATE_SNOWFLAKES; + break; + default: + return; + } + + caster->CastSpell(target, spellId, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_winter_veil_mistletoe_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_winter_veil_mistletoe_SpellScript(); + } +}; + void AddSC_holiday_spell_scripts() { + // Love is in the Air new spell_love_is_in_the_air_romantic_picnic(); + // Hallow's End + new spell_hallow_end_trick(); + new spell_hallow_end_trick_or_treat(); + new spell_hallow_end_tricky_treat(); + // Winter Veil + new spell_winter_veil_mistletoe(); } diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index e52034ed2d9..36194a596ce 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -32,23 +32,25 @@ enum HunterSpells { - HUNTER_SPELL_READINESS = 23989, - DRAENEI_SPELL_GIFT_OF_THE_NAARU = 59543, - HUNTER_SPELL_BESTIAL_WRATH = 19574, - HUNTER_PET_SPELL_LAST_STAND_TRIGGERED = 53479, - HUNTER_PET_HEART_OF_THE_PHOENIX = 55709, - HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED = 54114, - HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF = 55711, - HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED = 54045, - HUNTER_SPELL_INVIGORATION_TRIGGERED = 53398, - HUNTER_SPELL_MASTERS_CALL_TRIGGERED = 62305, - HUNTER_SPELL_CHIMERA_SHOT_SERPENT = 53353, - HUNTER_SPELL_CHIMERA_SHOT_VIPER = 53358, - HUNTER_SPELL_CHIMERA_SHOT_SCORPID = 53359, - HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET = 61669, + SPELL_HUNTER_ASPECT_OF_THE_BEAST_PET = 61669, + SPELL_HUNTER_BESTIAL_WRATH = 19574, + SPELL_HUNTER_CHIMERA_SHOT_SERPENT = 53353, + SPELL_HUNTER_CHIMERA_SHOT_VIPER = 53358, + SPELL_HUNTER_CHIMERA_SHOT_SCORPID = 53359, + SPELL_HUNTER_INVIGORATION_TRIGGERED = 53398, + SPELL_HUNTER_MASTERS_CALL_TRIGGERED = 62305, + SPELL_HUNTER_PET_LAST_STAND_TRIGGERED = 53479, + SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX = 55709, + SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED = 54114, + SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF = 55711, + SPELL_HUNTER_PET_CARRION_FEEDER_TRIGGERED = 54045, + SPELL_HUNTER_READINESS = 23989, + SPELL_HUNTER_SNIPER_TRAINING_R1 = 53302, + SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1 = 64418, + SPELL_DRAENEI_GIFT_OF_THE_NAARU = 59543, }; -// 13161 Aspect of the Beast +// 13161 - Aspect of the Beast class spell_hun_aspect_of_the_beast : public SpellScriptLoader { public: @@ -63,9 +65,9 @@ class spell_hun_aspect_of_the_beast : public SpellScriptLoader return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - bool Validate(SpellInfo const* /*entry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET)) + if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_ASPECT_OF_THE_BEAST_PET)) return false; return true; } @@ -74,14 +76,14 @@ class spell_hun_aspect_of_the_beast : public SpellScriptLoader { if (Player* caster = GetCaster()->ToPlayer()) if (Pet* pet = caster->GetPet()) - pet->RemoveAurasDueToSpell(HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET); + pet->RemoveAurasDueToSpell(SPELL_HUNTER_ASPECT_OF_THE_BEAST_PET); } void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Player* caster = GetCaster()->ToPlayer()) if (caster->GetPet()) - caster->CastSpell(caster, HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET, true); + caster->CastSpell(caster, SPELL_HUNTER_ASPECT_OF_THE_BEAST_PET, true); } void Register() @@ -97,7 +99,7 @@ class spell_hun_aspect_of_the_beast : public SpellScriptLoader } }; -// 53209 Chimera Shot +// 53209 - Chimera Shot class spell_hun_chimera_shot : public SpellScriptLoader { public: @@ -107,9 +109,9 @@ class spell_hun_chimera_shot : public SpellScriptLoader { PrepareSpellScript(spell_hun_chimera_shot_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_SERPENT) || !sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_VIPER) || !sSpellMgr->GetSpellInfo(HUNTER_SPELL_CHIMERA_SHOT_SCORPID)) + if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_CHIMERA_SHOT_SERPENT) || !sSpellMgr->GetSpellInfo(SPELL_HUNTER_CHIMERA_SHOT_VIPER) || !sSpellMgr->GetSpellInfo(SPELL_HUNTER_CHIMERA_SHOT_SCORPID)) return false; return true; } @@ -138,7 +140,7 @@ class spell_hun_chimera_shot : public SpellScriptLoader if (familyFlag[0] & 0x4000) { int32 TickCount = aurEff->GetTotalTicks(); - spellId = HUNTER_SPELL_CHIMERA_SHOT_SERPENT; + spellId = SPELL_HUNTER_CHIMERA_SHOT_SERPENT; basePoint = caster->SpellDamageBonusDone(unitTarget, aura->GetSpellInfo(), aurEff->GetAmount(), DOT, aura->GetStackAmount()); ApplyPct(basePoint, TickCount * 40); basePoint = unitTarget->SpellDamageBonusTaken(caster, aura->GetSpellInfo(), basePoint, DOT, aura->GetStackAmount()); @@ -147,7 +149,7 @@ class spell_hun_chimera_shot : public SpellScriptLoader else if (familyFlag[1] & 0x00000080) { int32 TickCount = aura->GetEffect(0)->GetTotalTicks(); - spellId = HUNTER_SPELL_CHIMERA_SHOT_VIPER; + spellId = SPELL_HUNTER_CHIMERA_SHOT_VIPER; // Amount of one aura tick basePoint = int32(CalculatePct(unitTarget->GetMaxPower(POWER_MANA), aurEff->GetAmount())); @@ -158,7 +160,7 @@ class spell_hun_chimera_shot : public SpellScriptLoader } // Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute. else if (familyFlag[0] & 0x00008000) - spellId = HUNTER_SPELL_CHIMERA_SHOT_SCORPID; + spellId = SPELL_HUNTER_CHIMERA_SHOT_SCORPID; // ?? nothing say in spell desc (possibly need addition check) //if (familyFlag & 0x0000010000000000LL || // dot // familyFlag & 0x0000100000000000LL) // stun @@ -173,7 +175,7 @@ class spell_hun_chimera_shot : public SpellScriptLoader } if (spellId) caster->CastCustomSpell(unitTarget, spellId, &basePoint, 0, 0, true); - if (spellId == HUNTER_SPELL_CHIMERA_SHOT_SCORPID && caster->ToPlayer()) // Scorpid Sting - Add 1 minute cooldown + if (spellId == SPELL_HUNTER_CHIMERA_SHOT_SCORPID && caster->ToPlayer()) // Scorpid Sting - Add 1 minute cooldown caster->ToPlayer()->AddSpellCooldown(spellId, 0, uint32(time(NULL) + 60)); } } @@ -190,7 +192,38 @@ class spell_hun_chimera_shot : public SpellScriptLoader } }; -// 53412 Invigoration +// 781 - Disengage +class spell_hun_disengage : public SpellScriptLoader +{ + public: + spell_hun_disengage() : SpellScriptLoader("spell_hun_disengage") { } + + class spell_hun_disengage_SpellScript : public SpellScript + { + PrepareSpellScript(spell_hun_disengage_SpellScript); + + SpellCastResult CheckCast() + { + Unit* caster = GetCaster(); + if (caster->GetTypeId() == TYPEID_PLAYER && !caster->isInCombat()) + return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; + + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_hun_disengage_SpellScript::CheckCast); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_hun_disengage_SpellScript(); + } +}; + +// 53412 - Invigoration class spell_hun_invigoration : public SpellScriptLoader { public: @@ -200,9 +233,9 @@ class spell_hun_invigoration : public SpellScriptLoader { PrepareSpellScript(spell_hun_invigoration_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_INVIGORATION_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_INVIGORATION_TRIGGERED)) return false; return true; } @@ -212,7 +245,7 @@ class spell_hun_invigoration : public SpellScriptLoader if (Unit* unitTarget = GetHitUnit()) if (AuraEffect* aurEff = unitTarget->GetDummyAuraEffect(SPELLFAMILY_HUNTER, 3487, 0)) if (roll_chance_i(aurEff->GetAmount())) - unitTarget->CastSpell(unitTarget, HUNTER_SPELL_INVIGORATION_TRIGGERED, true); + unitTarget->CastSpell(unitTarget, SPELL_HUNTER_INVIGORATION_TRIGGERED, true); } void Register() @@ -227,6 +260,7 @@ class spell_hun_invigoration : public SpellScriptLoader } }; +// 53478 - Last Stand Pet class spell_hun_last_stand_pet : public SpellScriptLoader { public: @@ -236,9 +270,9 @@ class spell_hun_last_stand_pet : public SpellScriptLoader { PrepareSpellScript(spell_hun_last_stand_pet_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(HUNTER_PET_SPELL_LAST_STAND_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_PET_LAST_STAND_TRIGGERED)) return false; return true; } @@ -247,7 +281,7 @@ class spell_hun_last_stand_pet : public SpellScriptLoader { Unit* caster = GetCaster(); int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(30)); - caster->CastCustomSpell(caster, HUNTER_PET_SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL); + caster->CastCustomSpell(caster, SPELL_HUNTER_PET_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL); } void Register() @@ -263,6 +297,7 @@ class spell_hun_last_stand_pet : public SpellScriptLoader } }; +// 53271 - Masters Call class spell_hun_masters_call : public SpellScriptLoader { public: @@ -272,9 +307,9 @@ class spell_hun_masters_call : public SpellScriptLoader { PrepareSpellScript(spell_hun_masters_call_SpellScript); - bool Validate(SpellInfo const* spellEntry) + bool Validate(SpellInfo const* spellInfo) { - if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_MASTERS_CALL_TRIGGERED) || !sSpellMgr->GetSpellInfo(spellEntry->Effects[EFFECT_0].CalcValue()) || !sSpellMgr->GetSpellInfo(spellEntry->Effects[EFFECT_1].CalcValue())) + if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_MASTERS_CALL_TRIGGERED) || !sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].CalcValue()) || !sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_1].CalcValue())) return false; return true; } @@ -297,7 +332,7 @@ class spell_hun_masters_call : public SpellScriptLoader { // Cannot be processed while pet is dead TriggerCastFlags castMask = TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_CASTER_AURASTATE); - target->CastSpell(target, HUNTER_SPELL_MASTERS_CALL_TRIGGERED, castMask); + target->CastSpell(target, SPELL_HUNTER_MASTERS_CALL_TRIGGERED, castMask); } } @@ -314,156 +349,122 @@ class spell_hun_masters_call : public SpellScriptLoader } }; -class spell_hun_readiness : public SpellScriptLoader +// 34477 - Misdirection +class spell_hun_misdirection : public SpellScriptLoader { public: - spell_hun_readiness() : SpellScriptLoader("spell_hun_readiness") { } + spell_hun_misdirection() : SpellScriptLoader("spell_hun_misdirection") { } - class spell_hun_readiness_SpellScript : public SpellScript + class spell_hun_misdirection_AuraScript : public AuraScript { - PrepareSpellScript(spell_hun_readiness_SpellScript); - - bool Load() - { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; - } + PrepareAuraScript(spell_hun_misdirection_AuraScript); - void HandleDummy(SpellEffIndex /*effIndex*/) + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - Player* caster = GetCaster()->ToPlayer(); - // immediately finishes the cooldown on your other Hunter abilities except Bestial Wrath - const SpellCooldowns& cm = caster->ToPlayer()->GetSpellCooldownMap(); - for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();) - { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); - - ///! If spellId in cooldown map isn't valid, the above will return a null pointer. - if (spellInfo && - spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && - spellInfo->Id != HUNTER_SPELL_READINESS && - spellInfo->Id != HUNTER_SPELL_BESTIAL_WRATH && - spellInfo->Id != DRAENEI_SPELL_GIFT_OF_THE_NAARU && - spellInfo->GetRecoveryTime() > 0) - caster->RemoveSpellCooldown((itr++)->first, true); - else - ++itr; - } + if (Unit* caster = GetCaster()) + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEFAULT) + caster->SetReducedThreatPercent(0, 0); } void Register() { - // add dummy effect spell handler to Readiness - OnEffectHitTarget += SpellEffectFn(spell_hun_readiness_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + AfterEffectRemove += AuraEffectRemoveFn(spell_hun_misdirection_AuraScript::OnRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); } }; - SpellScript* GetSpellScript() const + AuraScript* GetAuraScript() const { - return new spell_hun_readiness_SpellScript(); + return new spell_hun_misdirection_AuraScript(); } }; -// 37506 Scatter Shot -class spell_hun_scatter_shot : public SpellScriptLoader +// 35079 - Misdirection proc +class spell_hun_misdirection_proc : public SpellScriptLoader { public: - spell_hun_scatter_shot() : SpellScriptLoader("spell_hun_scatter_shot") { } + spell_hun_misdirection_proc() : SpellScriptLoader("spell_hun_misdirection_proc") { } - class spell_hun_scatter_shot_SpellScript : public SpellScript + class spell_hun_misdirection_proc_AuraScript : public AuraScript { - PrepareSpellScript(spell_hun_scatter_shot_SpellScript); - - bool Load() - { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; - } + PrepareAuraScript(spell_hun_misdirection_proc_AuraScript); - void HandleDummy(SpellEffIndex /*effIndex*/) + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - Player* caster = GetCaster()->ToPlayer(); - // break Auto Shot and autohit - caster->InterruptSpell(CURRENT_AUTOREPEAT_SPELL); - caster->AttackStop(); - caster->SendAttackSwingCancelAttack(); + if (GetCaster()) + GetCaster()->SetReducedThreatPercent(0, 0); } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_hun_scatter_shot_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + AfterEffectRemove += AuraEffectRemoveFn(spell_hun_misdirection_proc_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); } }; - SpellScript* GetSpellScript() const + AuraScript* GetAuraScript() const { - return new spell_hun_scatter_shot_SpellScript(); + return new spell_hun_misdirection_proc_AuraScript(); } }; -// 53302, 53303, 53304 Sniper Training -enum eSniperTrainingSpells -{ - SPELL_SNIPER_TRAINING_R1 = 53302, - SPELL_SNIPER_TRAINING_BUFF_R1 = 64418, -}; - -class spell_hun_sniper_training : public SpellScriptLoader +// 54044 - Pet Carrion Feeder +class spell_hun_pet_carrion_feeder : public SpellScriptLoader { public: - spell_hun_sniper_training() : SpellScriptLoader("spell_hun_sniper_training") { } + spell_hun_pet_carrion_feeder() : SpellScriptLoader("spell_hun_pet_carrion_feeder") { } - class spell_hun_sniper_training_AuraScript : public AuraScript + class spell_hun_pet_carrion_feeder_SpellScript : public SpellScript { - PrepareAuraScript(spell_hun_sniper_training_AuraScript); + PrepareSpellScript(spell_hun_pet_carrion_feeder_SpellScript); - bool Validate(SpellInfo const* /*entry*/) + bool Load() { - if (!sSpellMgr->GetSpellInfo(SPELL_SNIPER_TRAINING_R1) || !sSpellMgr->GetSpellInfo(SPELL_SNIPER_TRAINING_BUFF_R1)) + if (!GetCaster()->isPet()) return false; return true; } - void HandlePeriodic(AuraEffect const* aurEff) + bool Validate(SpellInfo const* /*spellInfo*/) { - PreventDefaultAction(); - if (aurEff->GetAmount() <= 0) - { - Unit* caster = GetCaster(); - uint32 spellId = SPELL_SNIPER_TRAINING_BUFF_R1 + GetId() - SPELL_SNIPER_TRAINING_R1; - if (Unit* target = GetTarget()) - if (!target->HasAura(spellId)) - { - SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(spellId); - Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster() ? caster : target; - triggerCaster->CastSpell(target, triggeredSpellInfo, true, 0, aurEff); - } - } + if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_PET_CARRION_FEEDER_TRIGGERED)) + return false; + return true; } - void HandleUpdatePeriodic(AuraEffect* aurEff) + SpellCastResult CheckIfCorpseNear() { - if (Player* playerTarget = GetUnitOwner()->ToPlayer()) - { - int32 baseAmount = aurEff->GetBaseAmount(); - int32 amount = playerTarget->isMoving() ? - playerTarget->CalculateSpellDamage(playerTarget, GetSpellInfo(), aurEff->GetEffIndex(), &baseAmount) : - aurEff->GetAmount() - 1; - aurEff->SetAmount(amount); - } + Unit* caster = GetCaster(); + float max_range = GetSpellInfo()->GetMaxRange(false); + WorldObject* result = NULL; + // search for nearby enemy corpse in range + Trinity::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_CHECK_ENEMY); + Trinity::WorldObjectSearcher<Trinity::AnyDeadUnitSpellTargetInRangeCheck> searcher(caster, result, check); + caster->GetMap()->VisitFirstFound(caster->m_positionX, caster->m_positionY, max_range, searcher); + if (!result) + return SPELL_FAILED_NO_EDIBLE_CORPSES; + return SPELL_CAST_OK; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + caster->CastSpell(caster, SPELL_HUNTER_PET_CARRION_FEEDER_TRIGGERED, false); } void Register() { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_hun_sniper_training_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); - OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_hun_sniper_training_AuraScript::HandleUpdatePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + // add dummy effect spell handler to pet's Last Stand + OnEffectHit += SpellEffectFn(spell_hun_pet_carrion_feeder_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnCheckCast += SpellCheckCastFn(spell_hun_pet_carrion_feeder_SpellScript::CheckIfCorpseNear); } }; - AuraScript* GetAuraScript() const + SpellScript* GetSpellScript() const { - return new spell_hun_sniper_training_AuraScript(); + return new spell_hun_pet_carrion_feeder_SpellScript(); } }; +// 55709 - Pet Heart of the Phoenix class spell_hun_pet_heart_of_the_phoenix : public SpellScriptLoader { public: @@ -480,9 +481,9 @@ class spell_hun_pet_heart_of_the_phoenix : public SpellScriptLoader return true; } - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED) || !sSpellMgr->GetSpellInfo(HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF)) + if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED) || !sSpellMgr->GetSpellInfo(SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF)) return false; return true; } @@ -491,10 +492,10 @@ class spell_hun_pet_heart_of_the_phoenix : public SpellScriptLoader { Unit* caster = GetCaster(); if (Unit* owner = caster->GetOwner()) - if (!caster->HasAura(HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF)) + if (!caster->HasAura(SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF)) { - owner->CastCustomSpell(HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED, SPELLVALUE_BASE_POINT0, 100, caster, true); - caster->CastSpell(caster, HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF, true); + owner->CastCustomSpell(SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED, SPELLVALUE_BASE_POINT0, 100, caster, true); + caster->CastSpell(caster, SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF, true); } } @@ -511,150 +512,152 @@ class spell_hun_pet_heart_of_the_phoenix : public SpellScriptLoader } }; -class spell_hun_pet_carrion_feeder : public SpellScriptLoader +// 23989 - Readiness +class spell_hun_readiness : public SpellScriptLoader { public: - spell_hun_pet_carrion_feeder() : SpellScriptLoader("spell_hun_pet_carrion_feeder") { } + spell_hun_readiness() : SpellScriptLoader("spell_hun_readiness") { } - class spell_hun_pet_carrion_feeder_SpellScript : public SpellScript + class spell_hun_readiness_SpellScript : public SpellScript { - PrepareSpellScript(spell_hun_pet_carrion_feeder_SpellScript); + PrepareSpellScript(spell_hun_readiness_SpellScript); bool Load() { - if (!GetCaster()->isPet()) - return false; - return true; - } - - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED)) - return false; - return true; - } - - SpellCastResult CheckIfCorpseNear() - { - Unit* caster = GetCaster(); - float max_range = GetSpellInfo()->GetMaxRange(false); - WorldObject* result = NULL; - // search for nearby enemy corpse in range - Trinity::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_CHECK_ENEMY); - Trinity::WorldObjectSearcher<Trinity::AnyDeadUnitSpellTargetInRangeCheck> searcher(caster, result, check); - caster->GetMap()->VisitFirstFound(caster->m_positionX, caster->m_positionY, max_range, searcher); - if (!result) - return SPELL_FAILED_NO_EDIBLE_CORPSES; - return SPELL_CAST_OK; + return GetCaster()->GetTypeId() == TYPEID_PLAYER; } void HandleDummy(SpellEffIndex /*effIndex*/) { - Unit* caster = GetCaster(); - caster->CastSpell(caster, HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED, false); + Player* caster = GetCaster()->ToPlayer(); + // immediately finishes the cooldown on your other Hunter abilities except Bestial Wrath + const SpellCooldowns& cm = caster->ToPlayer()->GetSpellCooldownMap(); + for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();) + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); + + ///! If spellId in cooldown map isn't valid, the above will return a null pointer. + if (spellInfo && + spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && + spellInfo->Id != SPELL_HUNTER_READINESS && + spellInfo->Id != SPELL_HUNTER_BESTIAL_WRATH && + spellInfo->Id != SPELL_DRAENEI_GIFT_OF_THE_NAARU && + spellInfo->GetRecoveryTime() > 0) + caster->RemoveSpellCooldown((itr++)->first, true); + else + ++itr; + } } void Register() { - // add dummy effect spell handler to pet's Last Stand - OnEffectHit += SpellEffectFn(spell_hun_pet_carrion_feeder_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - OnCheckCast += SpellCheckCastFn(spell_hun_pet_carrion_feeder_SpellScript::CheckIfCorpseNear); + // add dummy effect spell handler to Readiness + OnEffectHitTarget += SpellEffectFn(spell_hun_readiness_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; SpellScript* GetSpellScript() const { - return new spell_hun_pet_carrion_feeder_SpellScript(); + return new spell_hun_readiness_SpellScript(); } }; -// 34477 Misdirection -class spell_hun_misdirection : public SpellScriptLoader +// 37506 - Scatter Shot +class spell_hun_scatter_shot : public SpellScriptLoader { public: - spell_hun_misdirection() : SpellScriptLoader("spell_hun_misdirection") { } + spell_hun_scatter_shot() : SpellScriptLoader("spell_hun_scatter_shot") { } - class spell_hun_misdirection_AuraScript : public AuraScript + class spell_hun_scatter_shot_SpellScript : public SpellScript { - PrepareAuraScript(spell_hun_misdirection_AuraScript); + PrepareSpellScript(spell_hun_scatter_shot_SpellScript); - void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + bool Load() { - if (Unit* caster = GetCaster()) - if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEFAULT) - caster->SetReducedThreatPercent(0, 0); + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + // break Auto Shot and autohit + caster->InterruptSpell(CURRENT_AUTOREPEAT_SPELL); + caster->AttackStop(); + caster->SendAttackSwingCancelAttack(); } void Register() { - AfterEffectRemove += AuraEffectRemoveFn(spell_hun_misdirection_AuraScript::OnRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectHitTarget += SpellEffectFn(spell_hun_scatter_shot_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; - AuraScript* GetAuraScript() const + SpellScript* GetSpellScript() const { - return new spell_hun_misdirection_AuraScript(); + return new spell_hun_scatter_shot_SpellScript(); } }; -// 35079 Misdirection proc -class spell_hun_misdirection_proc : public SpellScriptLoader +// -53302 - Sniper Training +class spell_hun_sniper_training : public SpellScriptLoader { public: - spell_hun_misdirection_proc() : SpellScriptLoader("spell_hun_misdirection_proc") { } + spell_hun_sniper_training() : SpellScriptLoader("spell_hun_sniper_training") { } - class spell_hun_misdirection_proc_AuraScript : public AuraScript + class spell_hun_sniper_training_AuraScript : public AuraScript { - PrepareAuraScript(spell_hun_misdirection_proc_AuraScript); + PrepareAuraScript(spell_hun_sniper_training_AuraScript); - void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (GetCaster()) - GetCaster()->SetReducedThreatPercent(0, 0); + if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_SNIPER_TRAINING_R1) || !sSpellMgr->GetSpellInfo(SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1)) + return false; + return true; } - void Register() + void HandlePeriodic(AuraEffect const* aurEff) { - AfterEffectRemove += AuraEffectRemoveFn(spell_hun_misdirection_proc_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + PreventDefaultAction(); + if (aurEff->GetAmount() <= 0) + { + Unit* caster = GetCaster(); + uint32 spellId = SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1 + GetId() - SPELL_HUNTER_SNIPER_TRAINING_R1; + if (Unit* target = GetTarget()) + if (!target->HasAura(spellId)) + { + SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(spellId); + Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster() ? caster : target; + triggerCaster->CastSpell(target, triggeredSpellInfo, true, 0, aurEff); + } + } } - }; - - AuraScript* GetAuraScript() const - { - return new spell_hun_misdirection_proc_AuraScript(); - } -}; -class spell_hun_disengage : public SpellScriptLoader -{ - public: - spell_hun_disengage() : SpellScriptLoader("spell_hun_disengage") { } - - class spell_hun_disengage_SpellScript : public SpellScript - { - PrepareSpellScript(spell_hun_disengage_SpellScript); - - SpellCastResult CheckCast() + void HandleUpdatePeriodic(AuraEffect* aurEff) { - Unit* caster = GetCaster(); - if (caster->GetTypeId() == TYPEID_PLAYER && !caster->isInCombat()) - return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; - - return SPELL_CAST_OK; + if (Player* playerTarget = GetUnitOwner()->ToPlayer()) + { + int32 baseAmount = aurEff->GetBaseAmount(); + int32 amount = playerTarget->isMoving() ? + playerTarget->CalculateSpellDamage(playerTarget, GetSpellInfo(), aurEff->GetEffIndex(), &baseAmount) : + aurEff->GetAmount() - 1; + aurEff->SetAmount(amount); + } } void Register() { - OnCheckCast += SpellCheckCastFn(spell_hun_disengage_SpellScript::CheckCast); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_hun_sniper_training_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_hun_sniper_training_AuraScript::HandleUpdatePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); } }; - SpellScript* GetSpellScript() const + AuraScript* GetAuraScript() const { - return new spell_hun_disengage_SpellScript(); + return new spell_hun_sniper_training_AuraScript(); } }; +// 1515 - Tame Beast class spell_hun_tame_beast : public SpellScriptLoader { public: @@ -706,14 +709,16 @@ class spell_hun_tame_beast : public SpellScriptLoader } }; -class spell_hun_furious_howl : public SpellScriptLoader +// -24604 - Furious Howl +// 53434 - Call of the Wild +class spell_hun_target_only_pet_and_owner : public SpellScriptLoader { public: - spell_hun_furious_howl() : SpellScriptLoader("spell_hun_furious_howl") { } + spell_hun_target_only_pet_and_owner() : SpellScriptLoader("spell_hun_target_only_pet_and_owner") { } - class spell_hun_furious_howl_SpellScript : public SpellScript + class spell_hun_target_only_pet_and_owner_SpellScript : public SpellScript { - PrepareSpellScript(spell_hun_furious_howl_SpellScript); + PrepareSpellScript(spell_hun_target_only_pet_and_owner_SpellScript); void FilterTargets(std::list<WorldObject*>& targets) { @@ -725,14 +730,14 @@ class spell_hun_furious_howl : public SpellScriptLoader void Register() { - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_hun_furious_howl_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY); - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_hun_furious_howl_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_PARTY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_hun_target_only_pet_and_owner_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_hun_target_only_pet_and_owner_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_PARTY); } }; SpellScript* GetSpellScript() const { - return new spell_hun_furious_howl_SpellScript(); + return new spell_hun_target_only_pet_and_owner_SpellScript(); } }; @@ -740,17 +745,17 @@ void AddSC_hunter_spell_scripts() { new spell_hun_aspect_of_the_beast(); new spell_hun_chimera_shot(); + new spell_hun_disengage(); new spell_hun_invigoration(); new spell_hun_last_stand_pet(); new spell_hun_masters_call(); + new spell_hun_misdirection(); + new spell_hun_misdirection_proc(); + new spell_hun_pet_carrion_feeder(); + new spell_hun_pet_heart_of_the_phoenix(); new spell_hun_readiness(); new spell_hun_scatter_shot(); new spell_hun_sniper_training(); - new spell_hun_pet_heart_of_the_phoenix(); - new spell_hun_pet_carrion_feeder(); - new spell_hun_misdirection(); - new spell_hun_misdirection_proc(); - new spell_hun_disengage(); new spell_hun_tame_beast(); - new spell_hun_furious_howl(); + new spell_hun_target_only_pet_and_owner(); } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index e0c88ad6846..ccd8f3f81e7 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index cd096ebed5e..cf10cfdab5c 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 58f94edb387..07d903c9587 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 876d7c80a44..5198e555ee1 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index a15eb7ddc2c..68a9337f8ea 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -29,20 +29,25 @@ enum PriestSpells { - PRIEST_SPELL_GUARDIAN_SPIRIT_HEAL = 48153, - PRIEST_SPELL_PENANCE_R1 = 47540, - PRIEST_SPELL_PENANCE_R1_DAMAGE = 47758, - PRIEST_SPELL_PENANCE_R1_HEAL = 47757, - PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED = 33619, - PRIEST_SPELL_REFLECTIVE_SHIELD_R1 = 33201, - PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL = 64085, - PRIEST_SPELL_EMPOWERED_RENEW = 63544, + SPELL_PRIEST_EMPOWERED_RENEW = 63544, + SPELL_PRIEST_GUARDIAN_SPIRIT_HEAL = 48153, + SPELL_PRIEST_PENANCE_R1 = 47540, + SPELL_PRIEST_PENANCE_R1_DAMAGE = 47758, + SPELL_PRIEST_PENANCE_R1_HEAL = 47757, + SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED = 33619, + SPELL_PRIEST_REFLECTIVE_SHIELD_R1 = 33201, + SPELL_PRIEST_SHADOW_WORD_DEATH = 32409, + SPELL_PRIEST_T9_HEALING_2P = 67201, + SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL = 64085, +}; + +enum PriestSpellIcons +{ PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT = 3021, PRIEST_ICON_ID_PAIN_AND_SUFFERING = 2874, - PRIEST_SHADOW_WORD_DEATH = 32409, }; -// Guardian Spirit +// -47788 - Guardian Spirit class spell_pri_guardian_spirit : public SpellScriptLoader { public: @@ -54,9 +59,9 @@ class spell_pri_guardian_spirit : public SpellScriptLoader uint32 healPct; - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(PRIEST_SPELL_GUARDIAN_SPIRIT_HEAL)) + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_GUARDIAN_SPIRIT_HEAL)) return false; return true; } @@ -82,7 +87,7 @@ class spell_pri_guardian_spirit : public SpellScriptLoader int32 healAmount = int32(target->CountPctFromMaxHealth(healPct)); // remove the aura now, we don't want 40% healing bonus Remove(AURA_REMOVE_BY_ENEMY_SPELL); - target->CastCustomSpell(target, PRIEST_SPELL_GUARDIAN_SPIRIT_HEAL, &healAmount, NULL, NULL, true); + target->CastCustomSpell(target, SPELL_PRIEST_GUARDIAN_SPIRIT_HEAL, &healAmount, NULL, NULL, true); absorbAmount = dmgInfo.GetDamage(); } @@ -99,6 +104,7 @@ class spell_pri_guardian_spirit : public SpellScriptLoader } }; +// -8129 - Mana Burn class spell_pri_mana_burn : public SpellScriptLoader { public: @@ -126,6 +132,7 @@ class spell_pri_mana_burn : public SpellScriptLoader } }; +// -49821 - Mind Sear class spell_pri_mind_sear : public SpellScriptLoader { public: @@ -152,12 +159,12 @@ class spell_pri_mind_sear : public SpellScriptLoader } }; +// 47948 - Pain and Suffering (Proc) class spell_pri_pain_and_suffering_proc : public SpellScriptLoader { public: spell_pri_pain_and_suffering_proc() : SpellScriptLoader("spell_pri_pain_and_suffering_proc") { } - // 47948 Pain and Suffering (proc) class spell_pri_pain_and_suffering_proc_SpellScript : public SpellScript { PrepareSpellScript(spell_pri_pain_and_suffering_proc_SpellScript); @@ -182,6 +189,7 @@ class spell_pri_pain_and_suffering_proc : public SpellScriptLoader } }; +// -47540 - Penance class spell_pri_penance : public SpellScriptLoader { public: @@ -196,18 +204,18 @@ class spell_pri_penance : public SpellScriptLoader return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - bool Validate(SpellInfo const* spellEntry) + bool Validate(SpellInfo const* spellInfo) { - if (!sSpellMgr->GetSpellInfo(PRIEST_SPELL_PENANCE_R1)) + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_PENANCE_R1)) return false; // can't use other spell than this penance due to spell_ranks dependency - if (sSpellMgr->GetFirstSpellInChain(PRIEST_SPELL_PENANCE_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id)) + if (sSpellMgr->GetFirstSpellInChain(SPELL_PRIEST_PENANCE_R1) != sSpellMgr->GetFirstSpellInChain(spellInfo->Id)) return false; - uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id); - if (!sSpellMgr->GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_DAMAGE, rank, true)) + uint8 rank = sSpellMgr->GetSpellRank(spellInfo->Id); + if (!sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_DAMAGE, rank, true)) return false; - if (!sSpellMgr->GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_HEAL, rank, true)) + if (!sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_HEAL, rank, true)) return false; return true; @@ -224,9 +232,9 @@ class spell_pri_penance : public SpellScriptLoader uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); if (caster->IsFriendlyTo(unitTarget)) - caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_HEAL, rank), false, 0); + caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_HEAL, rank), false, 0); else - caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PRIEST_SPELL_PENANCE_R1_DAMAGE, rank), false, 0); + caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_DAMAGE, rank), false, 0); } } @@ -253,137 +261,94 @@ class spell_pri_penance : public SpellScriptLoader } }; -// Reflective Shield -class spell_pri_reflective_shield_trigger : public SpellScriptLoader +// 33110 - Prayer of Mending Heal +class spell_pri_prayer_of_mending_heal : public SpellScriptLoader { public: - spell_pri_reflective_shield_trigger() : SpellScriptLoader("spell_pri_reflective_shield_trigger") { } + spell_pri_prayer_of_mending_heal() : SpellScriptLoader("spell_pri_prayer_of_mending_heal") { } - class spell_pri_reflective_shield_trigger_AuraScript : public AuraScript + class spell_pri_prayer_of_mending_heal_SpellScript : public SpellScript { - PrepareAuraScript(spell_pri_reflective_shield_trigger_AuraScript); + PrepareSpellScript(spell_pri_prayer_of_mending_heal_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + void HandleHeal(SpellEffIndex /*effIndex*/) { - if (!sSpellMgr->GetSpellInfo(PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED) || !sSpellMgr->GetSpellInfo(PRIEST_SPELL_REFLECTIVE_SHIELD_R1)) - return false; - return true; - } - - void Trigger(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount) - { - Unit* target = GetTarget(); - if (dmgInfo.GetAttacker() == target) - return; - - if (GetCaster()) - if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(PRIEST_SPELL_REFLECTIVE_SHIELD_R1, EFFECT_0)) + if (Unit* caster = GetOriginalCaster()) + { + if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_PRIEST_T9_HEALING_2P, EFFECT_0)) { - int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount()); - target->CastCustomSpell(dmgInfo.GetAttacker(), PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); + int32 heal = GetHitHeal(); + AddPct(heal, aurEff->GetAmount()); + SetHitHeal(heal); } + } + } void Register() { - AfterEffectAbsorb += AuraEffectAbsorbFn(spell_pri_reflective_shield_trigger_AuraScript::Trigger, EFFECT_0); + OnEffectHitTarget += SpellEffectFn(spell_pri_prayer_of_mending_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); } }; - AuraScript* GetAuraScript() const - { - return new spell_pri_reflective_shield_trigger_AuraScript(); - } -}; - -enum PrayerOfMending -{ - SPELL_T9_HEALING_2_PIECE = 67201, -}; -// Prayer of Mending Heal -class spell_pri_prayer_of_mending_heal : public SpellScriptLoader -{ -public: - spell_pri_prayer_of_mending_heal() : SpellScriptLoader("spell_pri_prayer_of_mending_heal") { } - - class spell_pri_prayer_of_mending_heal_SpellScript : public SpellScript - { - PrepareSpellScript(spell_pri_prayer_of_mending_heal_SpellScript); - - void HandleHeal(SpellEffIndex /*effIndex*/) - { - if (Unit* caster = GetOriginalCaster()) - { - if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_T9_HEALING_2_PIECE, EFFECT_0)) - { - int32 heal = GetHitHeal(); - AddPct(heal, aurEff->GetAmount()); - SetHitHeal(heal); - } - } - - } - - void Register() + SpellScript* GetSpellScript() const { - OnEffectHitTarget += SpellEffectFn(spell_pri_prayer_of_mending_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + return new spell_pri_prayer_of_mending_heal_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_pri_prayer_of_mending_heal_SpellScript(); - } }; -class spell_pri_vampiric_touch : public SpellScriptLoader +// -17 - Reflective Shield +class spell_pri_reflective_shield_trigger : public SpellScriptLoader { public: - spell_pri_vampiric_touch() : SpellScriptLoader("spell_pri_vampiric_touch") { } + spell_pri_reflective_shield_trigger() : SpellScriptLoader("spell_pri_reflective_shield_trigger") { } - class spell_pri_vampiric_touch_AuraScript : public AuraScript + class spell_pri_reflective_shield_trigger_AuraScript : public AuraScript { - PrepareAuraScript(spell_pri_vampiric_touch_AuraScript); + PrepareAuraScript(spell_pri_reflective_shield_trigger_AuraScript); - bool Validate(SpellInfo const* /*spell*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL)) + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED) || !sSpellMgr->GetSpellInfo(SPELL_PRIEST_REFLECTIVE_SHIELD_R1)) return false; return true; } - void HandleDispel(DispelInfo* /*dispelInfo*/) + void Trigger(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount) { - if (Unit* caster = GetCaster()) - if (Unit* target = GetUnitOwner()) - if (AuraEffect const* aurEff = GetEffect(EFFECT_1)) - { - int32 damage = aurEff->GetAmount() * 8; - // backfire damage - caster->CastCustomSpell(target, PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL, &damage, NULL, NULL, true, NULL, aurEff); - } + Unit* target = GetTarget(); + if (dmgInfo.GetAttacker() == target) + return; + + if (GetCaster()) + if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_PRIEST_REFLECTIVE_SHIELD_R1, EFFECT_0)) + { + int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount()); + target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); + } } void Register() { - AfterDispel += AuraDispelFn(spell_pri_vampiric_touch_AuraScript::HandleDispel); + AfterEffectAbsorb += AuraEffectAbsorbFn(spell_pri_reflective_shield_trigger_AuraScript::Trigger, EFFECT_0); } }; AuraScript* GetAuraScript() const { - return new spell_pri_vampiric_touch_AuraScript(); + return new spell_pri_reflective_shield_trigger_AuraScript(); } }; -class spell_priest_renew : public SpellScriptLoader +// -139 - Renew +class spell_pri_renew : public SpellScriptLoader { public: - spell_priest_renew() : SpellScriptLoader("spell_priest_renew") { } + spell_pri_renew() : SpellScriptLoader("spell_pri_renew") { } - class spell_priest_renew_AuraScript : public AuraScript + class spell_pri_renew_AuraScript : public AuraScript { - PrepareAuraScript(spell_priest_renew_AuraScript); + PrepareAuraScript(spell_pri_renew_AuraScript); bool Load() { @@ -401,23 +366,24 @@ class spell_priest_renew : public SpellScriptLoader heal = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT); int32 basepoints0 = empoweredRenewAurEff->GetAmount() * GetEffect(EFFECT_0)->GetTotalTicks() * int32(heal) / 100; - caster->CastCustomSpell(GetTarget(), PRIEST_SPELL_EMPOWERED_RENEW, &basepoints0, NULL, NULL, true, NULL, aurEff); + caster->CastCustomSpell(GetTarget(), SPELL_PRIEST_EMPOWERED_RENEW, &basepoints0, NULL, NULL, true, NULL, aurEff); } } } void Register() { - OnEffectApply += AuraEffectApplyFn(spell_priest_renew_AuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectApply += AuraEffectApplyFn(spell_pri_renew_AuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); } }; AuraScript* GetAuraScript() const { - return new spell_priest_renew_AuraScript(); + return new spell_pri_renew_AuraScript(); } }; +// -32379 - Shadow Word Death class spell_pri_shadow_word_death : public SpellScriptLoader { public: @@ -435,7 +401,7 @@ class spell_pri_shadow_word_death : public SpellScriptLoader if (AuraEffect* aurEff = GetCaster()->GetDummyAuraEffect(SPELLFAMILY_PRIEST, PRIEST_ICON_ID_PAIN_AND_SUFFERING, EFFECT_1)) AddPct(damage, aurEff->GetAmount()); - GetCaster()->CastCustomSpell(GetCaster(), PRIEST_SHADOW_WORD_DEATH, &damage, 0, 0, true); + GetCaster()->CastCustomSpell(GetCaster(), SPELL_PRIEST_SHADOW_WORD_DEATH, &damage, 0, 0, true); } void Register() @@ -450,16 +416,57 @@ class spell_pri_shadow_word_death : public SpellScriptLoader } }; +// -34914 - Vampiric Touch +class spell_pri_vampiric_touch : public SpellScriptLoader +{ + public: + spell_pri_vampiric_touch() : SpellScriptLoader("spell_pri_vampiric_touch") { } + + class spell_pri_vampiric_touch_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pri_vampiric_touch_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL)) + return false; + return true; + } + + void HandleDispel(DispelInfo* /*dispelInfo*/) + { + if (Unit* caster = GetCaster()) + if (Unit* target = GetUnitOwner()) + if (AuraEffect const* aurEff = GetEffect(EFFECT_1)) + { + int32 damage = aurEff->GetAmount() * 8; + // backfire damage + caster->CastCustomSpell(target, SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL, &damage, NULL, NULL, true, NULL, aurEff); + } + } + + void Register() + { + AfterDispel += AuraDispelFn(spell_pri_vampiric_touch_AuraScript::HandleDispel); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_pri_vampiric_touch_AuraScript(); + } +}; + void AddSC_priest_spell_scripts() { new spell_pri_guardian_spirit(); new spell_pri_mana_burn(); + new spell_pri_mind_sear(); new spell_pri_pain_and_suffering_proc(); new spell_pri_penance(); - new spell_pri_reflective_shield_trigger(); - new spell_pri_mind_sear(); new spell_pri_prayer_of_mending_heal(); - new spell_pri_vampiric_touch(); - new spell_priest_renew(); + new spell_pri_reflective_shield_trigger(); + new spell_pri_renew(); new spell_pri_shadow_word_death(); + new spell_pri_vampiric_touch(); } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index da80ec8f1da..9cd94e9c7d5 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -1284,7 +1284,10 @@ class spell_q12372_cast_from_gossip_trigger : public SpellScriptLoader // 49370 - Wyrmrest Defender: Destabilize Azure Dragonshrine Effect enum Quest12372Data { + // NPCs NPC_WYRMREST_TEMPLE_CREDIT = 27698, + // Spells + WHISPER_ON_HIT_BY_FORCE_WHISPER = 1 }; class spell_q12372_destabilize_azure_dragonshrine_dummy : public SpellScriptLoader @@ -1318,6 +1321,34 @@ class spell_q12372_destabilize_azure_dragonshrine_dummy : public SpellScriptLoad } }; +// ID - 50287 Azure Dragon: On Death Force Cast Wyrmrest Defender to Whisper to Controller - Random (casted from Azure Dragons and Azure Drakes on death) +class spell_q12372_azure_on_death_force_whisper : public SpellScriptLoader +{ + public: + spell_q12372_azure_on_death_force_whisper() : SpellScriptLoader("spell_q12372_azure_on_death_force_whisper") { } + + class spell_q12372_azure_on_death_force_whisper_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12372_azure_on_death_force_whisper_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Creature* defender = GetHitCreature()) + defender->AI()->Talk(WHISPER_ON_HIT_BY_FORCE_WHISPER, defender->GetCharmerOrOwnerGUID()); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q12372_azure_on_death_force_whisper_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_q12372_azure_on_death_force_whisper_SpellScript(); + } +}; + // "Bombing Run" and "Bomb Them Again!" enum Quest11010_11102_11023Data { @@ -1432,7 +1463,7 @@ class spell_q11010_q11102_q11023_choose_loc : public SpellScriptLoader Unit* caster = GetCaster(); // Check for player that is in 65 y range std::list<Player*> playerList; - Trinity::AnyPlayerInObjectRangeCheck checker(caster, 765.0f); + Trinity::AnyPlayerInObjectRangeCheck checker(caster, 65.0f); Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(caster, playerList, checker); caster->VisitNearbyWorldObject(65.0f, searcher); for (std::list<Player*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr) @@ -1522,4 +1553,5 @@ void AddSC_quest_spell_scripts() new spell_q11010_q11102_q11023_aggro_burst(); new spell_q11010_q11102_q11023_choose_loc(); new spell_q11010_q11102_q11023_q11008_check_fly_mount(); + new spell_q12372_azure_on_death_force_whisper(); } diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 0294533bdcd..01a4225cc00 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -28,13 +28,13 @@ enum RogueSpells { - ROGUE_SPELL_SHIV_TRIGGERED = 5940, - ROGUE_SPELL_GLYPH_OF_PREPARATION = 56819, - ROGUE_SPELL_PREY_ON_THE_WEAK = 58670, - ROGUE_SPELL_CHEAT_DEATH_COOLDOWN = 31231, + SPELL_ROGUE_CHEAT_DEATH_COOLDOWN = 31231, + SPELL_ROGUE_GLYPH_OF_PREPARATION = 56819, + SPELL_ROGUE_PREY_ON_THE_WEAK = 58670, + SPELL_ROGUE_SHIV_TRIGGERED = 5940, }; -// Cheat Death +// -31228 - Cheat Death class spell_rog_cheat_death : public SpellScriptLoader { public: @@ -46,9 +46,9 @@ class spell_rog_cheat_death : public SpellScriptLoader uint32 absorbChance; - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_CHEAT_DEATH_COOLDOWN)) + if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_CHEAT_DEATH_COOLDOWN)) return false; return true; } @@ -68,11 +68,11 @@ class spell_rog_cheat_death : public SpellScriptLoader void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) { Player* target = GetTarget()->ToPlayer(); - if (dmgInfo.GetDamage() < target->GetHealth() || target->HasSpellCooldown(ROGUE_SPELL_CHEAT_DEATH_COOLDOWN) || !roll_chance_i(absorbChance)) + if (dmgInfo.GetDamage() < target->GetHealth() || target->HasSpellCooldown(SPELL_ROGUE_CHEAT_DEATH_COOLDOWN) || !roll_chance_i(absorbChance)) return; - target->CastSpell(target, ROGUE_SPELL_CHEAT_DEATH_COOLDOWN, true); - target->AddSpellCooldown(ROGUE_SPELL_CHEAT_DEATH_COOLDOWN, 0, time(NULL) + 60); + target->CastSpell(target, SPELL_ROGUE_CHEAT_DEATH_COOLDOWN, true); + target->AddSpellCooldown(SPELL_ROGUE_CHEAT_DEATH_COOLDOWN, 0, time(NULL) + 60); uint32 health10 = target->CountPctFromMaxHealth(10); @@ -97,7 +97,101 @@ class spell_rog_cheat_death : public SpellScriptLoader } }; -// 31130 - Nerves of Steel +// -2818 - Deadly Poison +class spell_rog_deadly_poison : public SpellScriptLoader +{ + public: + spell_rog_deadly_poison() : SpellScriptLoader("spell_rog_deadly_poison") { } + + class spell_rog_deadly_poison_SpellScript : public SpellScript + { + PrepareSpellScript(spell_rog_deadly_poison_SpellScript); + + bool Load() + { + _stackAmount = 0; + // at this point CastItem must already be initialized + return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCastItem(); + } + + void HandleBeforeHit() + { + if (Unit* target = GetHitUnit()) + // Deadly Poison + if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x10000, 0x80000, 0, GetCaster()->GetGUID())) + _stackAmount = aurEff->GetBase()->GetStackAmount(); + } + + void HandleAfterHit() + { + if (_stackAmount < 5) + return; + + Player* player = GetCaster()->ToPlayer(); + + if (Unit* target = GetHitUnit()) + { + + Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND); + + if (item == GetCastItem()) + item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); + + if (!item) + return; + + // item combat enchantments + for (uint8 slot = 0; slot < MAX_ENCHANTMENT_SLOT; ++slot) + { + SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(EnchantmentSlot(slot))); + if (!enchant) + continue; + + for (uint8 s = 0; s < 3; ++s) + { + if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) + continue; + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->spellid[s]); + if (!spellInfo) + { + sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::CastItemCombatSpell Enchant %i, player (Name: %s, GUID: %u) cast unknown spell %i", enchant->ID, player->GetName().c_str(), player->GetGUIDLow(), enchant->spellid[s]); + continue; + } + + // Proc only rogue poisons + if (spellInfo->SpellFamilyName != SPELLFAMILY_ROGUE || spellInfo->Dispel != DISPEL_POISON) + continue; + + // Do not reproc deadly + if (spellInfo->SpellFamilyFlags.IsEqual(0x10000, 0x80000, 0)) + continue; + + if (spellInfo->IsPositive()) + player->CastSpell(player, enchant->spellid[s], true, item); + else + player->CastSpell(target, enchant->spellid[s], true, item); + } + } + } + } + + void Register() + { + BeforeHit += SpellHitFn(spell_rog_deadly_poison_SpellScript::HandleBeforeHit); + AfterHit += SpellHitFn(spell_rog_deadly_poison_SpellScript::HandleAfterHit); + } + + uint8 _stackAmount; + }; + + SpellScript* GetSpellScript() const + { + return new spell_rog_deadly_poison_SpellScript(); + } +}; + +// -31130 - Nerves of Steel class spell_rog_nerves_of_steel : public SpellScriptLoader { public: @@ -141,6 +235,7 @@ class spell_rog_nerves_of_steel : public SpellScriptLoader } }; +// 14185 - Preparation class spell_rog_preparation : public SpellScriptLoader { public: @@ -157,7 +252,7 @@ class spell_rog_preparation : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_GLYPH_OF_PREPARATION)) + if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_GLYPH_OF_PREPARATION)) return false; return true; } @@ -177,7 +272,7 @@ class spell_rog_preparation : public SpellScriptLoader if (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_COLDB_SHADOWSTEP || // Cold Blood, Shadowstep spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_VAN_EVAS_SPRINT) // Vanish, Evasion, Sprint caster->RemoveSpellCooldown((itr++)->first, true); - else if (caster->HasAura(ROGUE_SPELL_GLYPH_OF_PREPARATION)) + else if (caster->HasAura(SPELL_ROGUE_GLYPH_OF_PREPARATION)) { if (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_DISMANTLE || // Dismantle spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_KICK || // Kick @@ -208,220 +303,128 @@ class spell_rog_preparation : public SpellScriptLoader } }; -// 51685-51689 Prey on the Weak +// -51685 - Prey on the Weak class spell_rog_prey_on_the_weak : public SpellScriptLoader { -public: - spell_rog_prey_on_the_weak() : SpellScriptLoader("spell_rog_prey_on_the_weak") { } - - class spell_rog_prey_on_the_weak_AuraScript : public AuraScript - { - PrepareAuraScript(spell_rog_prey_on_the_weak_AuraScript); - - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_PREY_ON_THE_WEAK)) - return false; - return true; - } - - void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) - { - Unit* target = GetTarget(); - Unit* victim = target->getVictim(); - if (victim && (target->GetHealthPct() > victim->GetHealthPct())) - { - if (!target->HasAura(ROGUE_SPELL_PREY_ON_THE_WEAK)) - { - int32 bp = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); - target->CastCustomSpell(target, ROGUE_SPELL_PREY_ON_THE_WEAK, &bp, 0, 0, true); - } - } - else - target->RemoveAurasDueToSpell(ROGUE_SPELL_PREY_ON_THE_WEAK); - } - - void Register() - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_rog_prey_on_the_weak_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_rog_prey_on_the_weak_AuraScript(); - } -}; - -class spell_rog_shiv : public SpellScriptLoader -{ public: - spell_rog_shiv() : SpellScriptLoader("spell_rog_shiv") { } + spell_rog_prey_on_the_weak() : SpellScriptLoader("spell_rog_prey_on_the_weak") { } - class spell_rog_shiv_SpellScript : public SpellScript + class spell_rog_prey_on_the_weak_AuraScript : public AuraScript { - PrepareSpellScript(spell_rog_shiv_SpellScript); + PrepareAuraScript(spell_rog_prey_on_the_weak_AuraScript); - bool Load() + bool Validate(SpellInfo const* /*spellInfo*/) { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; - } - - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_SHIV_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_PREY_ON_THE_WEAK)) return false; return true; } - void HandleDummy(SpellEffIndex /*effIndex*/) + void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) { - Unit* caster = GetCaster(); - if (Unit* unitTarget = GetHitUnit()) - caster->CastSpell(unitTarget, ROGUE_SPELL_SHIV_TRIGGERED, true); + Unit* target = GetTarget(); + Unit* victim = target->getVictim(); + if (victim && (target->GetHealthPct() > victim->GetHealthPct())) + { + if (!target->HasAura(SPELL_ROGUE_PREY_ON_THE_WEAK)) + { + int32 bp = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); + target->CastCustomSpell(target, SPELL_ROGUE_PREY_ON_THE_WEAK, &bp, 0, 0, true); + } + } + else + target->RemoveAurasDueToSpell(SPELL_ROGUE_PREY_ON_THE_WEAK); } void Register() { - // add dummy effect spell handler to Shiv - OnEffectHitTarget += SpellEffectFn(spell_rog_shiv_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_rog_prey_on_the_weak_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); } }; - SpellScript* GetSpellScript() const + AuraScript* GetAuraScript() const { - return new spell_rog_shiv_SpellScript(); + return new spell_rog_prey_on_the_weak_AuraScript(); } }; -class spell_rog_deadly_poison : public SpellScriptLoader +// 36554 - Shadowstep +class spell_rog_shadowstep : public SpellScriptLoader { public: - spell_rog_deadly_poison() : SpellScriptLoader("spell_rog_deadly_poison") { } + spell_rog_shadowstep() : SpellScriptLoader("spell_rog_shadowstep") { } - class spell_rog_deadly_poison_SpellScript : public SpellScript + class spell_rog_shadowstep_SpellScript : public SpellScript { - PrepareSpellScript(spell_rog_deadly_poison_SpellScript); - - bool Load() - { - _stackAmount = 0; - // at this point CastItem must already be initialized - return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCastItem(); - } - - void HandleBeforeHit() - { - if (Unit* target = GetHitUnit()) - // Deadly Poison - if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x10000, 0x80000, 0, GetCaster()->GetGUID())) - _stackAmount = aurEff->GetBase()->GetStackAmount(); - } + PrepareSpellScript(spell_rog_shadowstep_SpellScript); - void HandleAfterHit() + SpellCastResult CheckCast() { - if (_stackAmount < 5) - return; - - Player* player = GetCaster()->ToPlayer(); - - if (Unit* target = GetHitUnit()) - { - - Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND); - - if (item == GetCastItem()) - item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); - - if (!item) - return; - - // item combat enchantments - for (uint8 slot = 0; slot < MAX_ENCHANTMENT_SLOT; ++slot) - { - SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(EnchantmentSlot(slot))); - if (!enchant) - continue; - - for (uint8 s = 0; s < 3; ++s) - { - if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) - continue; - - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->spellid[s]); - if (!spellInfo) - { - sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::CastItemCombatSpell Enchant %i, player (Name: %s, GUID: %u) cast unknown spell %i", enchant->ID, player->GetName().c_str(), player->GetGUIDLow(), enchant->spellid[s]); - continue; - } - - // Proc only rogue poisons - if (spellInfo->SpellFamilyName != SPELLFAMILY_ROGUE || spellInfo->Dispel != DISPEL_POISON) - continue; - - // Do not reproc deadly - if (spellInfo->SpellFamilyFlags.IsEqual(0x10000, 0x80000, 0)) - continue; - - if (spellInfo->IsPositive()) - player->CastSpell(player, enchant->spellid[s], true, item); - else - player->CastSpell(target, enchant->spellid[s], true, item); - } - } - } + if (GetCaster()->HasUnitState(UNIT_STATE_ROOT)) + return SPELL_FAILED_ROOTED; + return SPELL_CAST_OK; } void Register() { - BeforeHit += SpellHitFn(spell_rog_deadly_poison_SpellScript::HandleBeforeHit); - AfterHit += SpellHitFn(spell_rog_deadly_poison_SpellScript::HandleAfterHit); + OnCheckCast += SpellCheckCastFn(spell_rog_shadowstep_SpellScript::CheckCast); } - - uint8 _stackAmount; }; SpellScript* GetSpellScript() const { - return new spell_rog_deadly_poison_SpellScript(); + return new spell_rog_shadowstep_SpellScript(); } }; -class spell_rog_shadowstep : public SpellScriptLoader +// 5938 - Shiv +class spell_rog_shiv : public SpellScriptLoader { public: - spell_rog_shadowstep() : SpellScriptLoader("spell_rog_shadowstep") { } + spell_rog_shiv() : SpellScriptLoader("spell_rog_shiv") { } - class spell_rog_shadowstep_SpellScript : public SpellScript + class spell_rog_shiv_SpellScript : public SpellScript { - PrepareSpellScript(spell_rog_shadowstep_SpellScript); + PrepareSpellScript(spell_rog_shiv_SpellScript); - SpellCastResult CheckCast() + bool Load() { - if (GetCaster()->HasUnitState(UNIT_STATE_ROOT)) - return SPELL_FAILED_ROOTED; - return SPELL_CAST_OK; + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_SHIV_TRIGGERED)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Unit* unitTarget = GetHitUnit()) + caster->CastSpell(unitTarget, SPELL_ROGUE_SHIV_TRIGGERED, true); } void Register() { - OnCheckCast += SpellCheckCastFn(spell_rog_shadowstep_SpellScript::CheckCast); + OnEffectHitTarget += SpellEffectFn(spell_rog_shiv_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; SpellScript* GetSpellScript() const { - return new spell_rog_shadowstep_SpellScript(); + return new spell_rog_shiv_SpellScript(); } }; void AddSC_rogue_spell_scripts() { new spell_rog_cheat_death(); + new spell_rog_deadly_poison(); new spell_rog_nerves_of_steel(); new spell_rog_preparation(); new spell_rog_prey_on_the_weak(); - new spell_rog_shiv(); - new spell_rog_deadly_poison(); new spell_rog_shadowstep(); + new spell_rog_shiv(); } diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 1ba962982e4..ff7c83b95a5 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index f83056aa8b6..2070933173b 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 613bf0fef5d..7b6ac8fed12 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/World/CMakeLists.txt b/src/server/scripts/World/CMakeLists.txt index f081a5225e4..c8fd16dca36 100644 --- a/src/server/scripts/World/CMakeLists.txt +++ b/src/server/scripts/World/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # 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/achievement_scripts.cpp b/src/server/scripts/World/achievement_scripts.cpp index 178df2078f8..41a32185620 100644 --- a/src/server/scripts/World/achievement_scripts.cpp +++ b/src/server/scripts/World/achievement_scripts.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp index db3c6dd2274..c031c4a3b4d 100644 --- a/src/server/scripts/World/areatrigger_scripts.cpp +++ b/src/server/scripts/World/areatrigger_scripts.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index a8f65b0bc9b..7699712a1e4 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -1,20 +1,20 @@ /* -* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> -* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; 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 <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; 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 <http://www.gnu.org/licenses/>. + */ #include "ObjectMgr.h" #include "ScriptMgr.h" diff --git a/src/server/scripts/World/chat_log.cpp b/src/server/scripts/World/chat_log.cpp index 236436b229b..d2d78aa81cc 100644 --- a/src/server/scripts/World/chat_log.cpp +++ b/src/server/scripts/World/chat_log.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index dac67b566e3..5ed45764ed6 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -309,6 +309,7 @@ public: bool OnGossipHello(Player* player, GameObject* go) { + go->UseDoorOrButton(); int Random = rand() % (sizeof(NpcPrisonEntry) / sizeof(uint32)); if (Creature* creature = player->SummonCreature(NpcPrisonEntry[Random], go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player), @@ -358,6 +359,7 @@ public: bool OnGossipHello(Player* player, GameObject* go) { + go->UseDoorOrButton(); int Random = rand() % (sizeof(NpcStasisEntry) / sizeof(uint32)); player->SummonCreature(NpcStasisEntry[Random], go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player), @@ -729,9 +731,9 @@ public: bool OnGossipHello(Player* player, GameObject* go) { + go->UseDoorOrButton(); if (Creature* pNearestPrisoner = go->FindNearestCreature(NPC_SCOURGE_PRISONER, 5.0f, true)) { - go->SetGoState(GO_STATE_ACTIVE); player->KilledMonsterCredit(NPC_SCOURGE_PRISONER, pNearestPrisoner->GetGUID()); pNearestPrisoner->DisappearAndDie(); } @@ -811,6 +813,7 @@ public: bool OnGossipHello(Player* player, GameObject* go) { + go->UseDoorOrButton(); Creature* pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true); if (!pPrisoner) { @@ -1047,6 +1050,7 @@ public: bool OnGossipHello(Player* player, GameObject* go) { + go->UseDoorOrButton(); if (player->GetQuestStatus(QUEST_PRISONERS_OF_WYRMSKULL) != QUEST_STATUS_INCOMPLETE) return true; @@ -1094,12 +1098,12 @@ public: bool OnGossipHello(Player* player, GameObject* go) { + go->UseDoorOrButton(); if (player->GetQuestStatus(QUEST_OH_NOES_THE_TADPOLES) == QUEST_STATUS_INCOMPLETE) { Creature* pTadpole = go->FindNearestCreature(NPC_WINTERFIN_TADPOLE, 1.0f); if (pTadpole) { - go->UseDoorOrButton(); pTadpole->DisappearAndDie(); player->KilledMonsterCredit(NPC_WINTERFIN_TADPOLE, 0); //FIX: Summon minion tadpole @@ -1229,13 +1233,12 @@ class go_gjalerbron_cage : public GameObjectScript bool OnGossipHello(Player* player, GameObject* go) { + go->UseDoorOrButton(); if ((player->GetTeamId() == TEAM_ALLIANCE && player->GetQuestStatus(QUEST_ALLIANCE_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE) || (player->GetTeamId() == TEAM_HORDE && player->GetQuestStatus(QUEST_HORDE_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE)) { if (Creature* prisoner = go->FindNearestCreature(NPC_GJALERBRON_PRISONER, 5.0f)) { - go->UseDoorOrButton(); - if (player) player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, 0); @@ -1258,6 +1261,7 @@ class go_large_gjalerbron_cage : public GameObjectScript bool OnGossipHello(Player* player, GameObject* go) { + go->UseDoorOrButton(); if ((player->GetTeamId() == TEAM_ALLIANCE && player->GetQuestStatus(QUEST_ALLIANCE_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE) || (player->GetTeamId() == TEAM_HORDE && player->GetQuestStatus(QUEST_HORDE_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE)) { @@ -1265,7 +1269,6 @@ class go_large_gjalerbron_cage : public GameObjectScript GetCreatureListWithEntryInGrid(prisonerList, go, NPC_GJALERBRON_PRISONER, INTERACTION_DISTANCE); for (std::list<Creature*>::const_iterator itr = prisonerList.begin(); itr != prisonerList.end(); ++itr) { - go->UseDoorOrButton(); player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, (*itr)->GetGUID()); (*itr)->DespawnOrUnsummon(6000); (*itr)->AI()->Talk(SAY_FREE); @@ -1293,13 +1296,13 @@ class go_veil_skith_cage : public GameObjectScript bool OnGossipHello(Player* player, GameObject* go) { + go->UseDoorOrButton(); if (player->GetQuestStatus(QUEST_MISSING_FRIENDS) == QUEST_STATUS_INCOMPLETE) { std::list<Creature*> childrenList; GetCreatureListWithEntryInGrid(childrenList, go, NPC_CAPTIVE_CHILD, INTERACTION_DISTANCE); for (std::list<Creature*>::const_iterator itr = childrenList.begin(); itr != childrenList.end(); ++itr) { - go->UseDoorOrButton(); player->KilledMonsterCredit(NPC_CAPTIVE_CHILD, (*itr)->GetGUID()); (*itr)->DespawnOrUnsummon(5000); (*itr)->GetMotionMaster()->MovePoint(1, go->GetPositionX()+5, go->GetPositionY(), go->GetPositionZ()); @@ -1330,10 +1333,10 @@ public: bool OnGossipHello(Player* player, GameObject* go) { + go->UseDoorOrButton(10); if (!player->HasAura(SPELL_RECENT_MEDITATION)) if (player->GetQuestStatus(QUEST_THE_CLEANSING_HORDE) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_THE_CLEANSING_ALLIANCE) == QUEST_STATUS_INCOMPLETE) { - go->UseDoorOrButton(10); player->CastSpell(player, SPELL_CLEANSING_SOUL); player->SetStandState(UNIT_STAND_STATE_SIT); } diff --git a/src/server/scripts/World/guards.cpp b/src/server/scripts/World/guards.cpp index 951c0ed9688..f07a9ed7671 100644 --- a/src/server/scripts/World/guards.cpp +++ b/src/server/scripts/World/guards.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -39,9 +39,7 @@ enum GuardGeneric { GENERIC_CREATURE_COOLDOWN = 5000, - SAY_GUARD_SIL_AGGRO1 = -1070001, - SAY_GUARD_SIL_AGGRO2 = -1070002, - SAY_GUARD_SIL_AGGRO3 = -1070003, + SAY_GUARD_SIL_AGGRO = 0, NPC_CENARION_HOLD_INFANTRY = 15184, NPC_STORMWIND_CITY_GUARD = 68, @@ -67,7 +65,7 @@ public: void EnterCombat(Unit* who) { if (me->GetEntry() == NPC_CENARION_HOLD_INFANTRY) - DoScriptText(RAND(SAY_GUARD_SIL_AGGRO1, SAY_GUARD_SIL_AGGRO2, SAY_GUARD_SIL_AGGRO3), me, who); + Talk(SAY_GUARD_SIL_AGGRO, who->GetGUID()); if (SpellInfo const* spell = me->reachWithSpellAttack(who)) DoCast(who, spell->Id); } diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index 535bebd9415..a6e82f31914 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp index be409670f5d..174ba8870d1 100644 --- a/src/server/scripts/World/mob_generic_creature.cpp +++ b/src/server/scripts/World/mob_generic_creature.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/World/npc_innkeeper.cpp b/src/server/scripts/World/npc_innkeeper.cpp index 502ecb1acb2..4a289c55794 100644 --- a/src/server/scripts/World/npc_innkeeper.cpp +++ b/src/server/scripts/World/npc_innkeeper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index 4e0818c7c82..89c768d65ba 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -785,7 +785,7 @@ enum eEngineeringTrinkets SPELL_TO_TOSHLEY = 36955, }; -#define GOSSIP_ITEM_ZAP "[PH] Unknown" +#define GOSSIP_ITEM_ZAP "This Dimensional Imploder sounds dangerous! How can I make one?" #define GOSSIP_ITEM_JHORDY "I must build a beacon for this marvelous device!" #define GOSSIP_ITEM_KABLAM "[PH] Unknown" @@ -819,7 +819,7 @@ public: switch (creature->GetEntry()) { case NPC_ZAP: - canLearn = CanLearn(player, 7249, 0, 260, S_GOBLIN, SPELL_TO_EVERLOOK, npcTextId); + canLearn = CanLearn(player, 6092, 0, 260, S_GOBLIN, SPELL_TO_EVERLOOK, npcTextId); if (canLearn) gossipItem = GOSSIP_ITEM_ZAP; break; diff --git a/src/server/scripts/World/npc_taxi.cpp b/src/server/scripts/World/npc_taxi.cpp index 4ed5b0d9276..778ab370597 100644 --- a/src/server/scripts/World/npc_taxi.cpp +++ b/src/server/scripts/World/npc_taxi.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 5ed799bbec1..aaac8ee4b83 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * * This program is free software; you can redistribute it and/or modify it @@ -313,12 +313,16 @@ public: # npc_chicken_cluck #########*/ -#define EMOTE_HELLO -1070004 -#define EMOTE_CLUCK_TEXT -1070006 +enum ChickenCluck +{ + EMOTE_HELLO_A = 0, + EMOTE_HELLO_H = 1, + EMOTE_CLUCK_TEXT = 2, -#define QUEST_CLUCK 3861 -#define FACTION_FRIENDLY 35 -#define FACTION_CHICKEN 31 + QUEST_CLUCK = 3861, + FACTION_FRIENDLY = 35, + FACTION_CHICKEN = 31 +}; class npc_chicken_cluck : public CreatureScript { @@ -367,7 +371,7 @@ public: { me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); me->setFaction(FACTION_FRIENDLY); - DoScriptText(EMOTE_HELLO, me); + Talk(player->GetTeam() == HORDE ? EMOTE_HELLO_H : EMOTE_HELLO_A); } break; case TEXT_EMOTE_CHEER: @@ -375,7 +379,7 @@ public: { me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); me->setFaction(FACTION_FRIENDLY); - DoScriptText(EMOTE_CLUCK_TEXT, me); + Talk(EMOTE_CLUCK_TEXT); } break; } @@ -500,15 +504,15 @@ public: ## Triage quest ######*/ -//signed for 9623 -#define SAY_DOC1 -1000201 -#define SAY_DOC2 -1000202 -#define SAY_DOC3 -1000203 +enum Doctor +{ + SAY_DOC = 0, -#define DOCTOR_ALLIANCE 12939 -#define DOCTOR_HORDE 12920 -#define ALLIANCE_COORDS 7 -#define HORDE_COORDS 6 + DOCTOR_ALLIANCE = 12939, + DOCTOR_HORDE = 12920, + ALLIANCE_COORDS = 7, + HORDE_COORDS = 6 +}; struct Location { @@ -773,7 +777,7 @@ public: //stand up me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); - DoScriptText(RAND(SAY_DOC1, SAY_DOC2, SAY_DOC3), me); + Talk(SAY_DOC); uint32 mobId = me->GetEntry(); me->SetWalk(false); @@ -879,7 +883,7 @@ void npc_doctor::npc_doctorAI::UpdateAI(uint32 const diff) //TODO: get text for each NPC -enum eGarments +enum Garments { SPELL_LESSER_HEAL_R2 = 2052, SPELL_FORTITUDE_R1 = 1243, @@ -896,18 +900,10 @@ enum eGarments ENTRY_KORJA = 12430, ENTRY_DG_KEL = 12428, - //used by 12429, 12423, 12427, 12430, 12428, but signed for 12429 - SAY_COMMON_HEALED = -1000164, - SAY_DG_KEL_THANKS = -1000165, - SAY_DG_KEL_GOODBYE = -1000166, - SAY_ROBERTS_THANKS = -1000167, - SAY_ROBERTS_GOODBYE = -1000168, - SAY_KORJA_THANKS = -1000169, - SAY_KORJA_GOODBYE = -1000170, - SAY_DOLF_THANKS = -1000171, - SAY_DOLF_GOODBYE = -1000172, - SAY_SHAYA_THANKS = -1000173, - SAY_SHAYA_GOODBYE = -1000174, //signed for 21469 + // used by 12429, 12423, 12427, 12430, 12428, but signed for 12429 + SAY_THANKS = 0, + SAY_GOODBYE = 1, + SAY_HEALED = 2, }; class npc_garments_of_quests : public CreatureScript @@ -917,7 +913,10 @@ public: struct npc_garments_of_questsAI : public npc_escortAI { - npc_garments_of_questsAI(Creature* creature) : npc_escortAI(creature) {Reset();} + npc_garments_of_questsAI(Creature* creature) : npc_escortAI(creature) + { + Reset(); + } uint64 CasterGUID; @@ -936,15 +935,15 @@ public: RunAwayTimer = 5000; me->SetStandState(UNIT_STAND_STATE_KNEEL); - //expect database to have RegenHealth=0 + // expect database to have RegenHealth=0 me->SetHealth(me->CountPctFromMaxHealth(70)); } - void EnterCombat(Unit* /*who*/) {} + void EnterCombat(Unit* /*who*/) { } - void SpellHit(Unit* caster, SpellInfo const* Spell) + void SpellHit(Unit* caster, SpellInfo const* spell) { - if (Spell->Id == SPELL_LESSER_HEAL_R2 || Spell->Id == SPELL_FORTITUDE_R1) + if (spell->Id == SPELL_LESSER_HEAL_R2 || spell->Id == SPELL_FORTITUDE_R1) { //not while in combat if (me->isInCombat()) @@ -961,16 +960,16 @@ public: case ENTRY_SHAYA: if (player->GetQuestStatus(QUEST_MOON) == QUEST_STATUS_INCOMPLETE) { - if (IsHealed && !CanRun && Spell->Id == SPELL_FORTITUDE_R1) + if (IsHealed && !CanRun && spell->Id == SPELL_FORTITUDE_R1) { - DoScriptText(SAY_SHAYA_THANKS, me, caster); + Talk(SAY_THANKS, caster->GetGUID()); CanRun = true; } - else if (!IsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + else if (!IsHealed && spell->Id == SPELL_LESSER_HEAL_R2) { CasterGUID = caster->GetGUID(); me->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(SAY_COMMON_HEALED, me, caster); + Talk(SAY_HEALED, caster->GetGUID()); IsHealed = true; } } @@ -978,16 +977,16 @@ public: case ENTRY_ROBERTS: if (player->GetQuestStatus(QUEST_LIGHT_1) == QUEST_STATUS_INCOMPLETE) { - if (IsHealed && !CanRun && Spell->Id == SPELL_FORTITUDE_R1) + if (IsHealed && !CanRun && spell->Id == SPELL_FORTITUDE_R1) { - DoScriptText(SAY_ROBERTS_THANKS, me, caster); + Talk(SAY_THANKS, caster->GetGUID()); CanRun = true; } - else if (!IsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + else if (!IsHealed && spell->Id == SPELL_LESSER_HEAL_R2) { CasterGUID = caster->GetGUID(); me->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(SAY_COMMON_HEALED, me, caster); + Talk(SAY_HEALED, caster->GetGUID()); IsHealed = true; } } @@ -995,16 +994,16 @@ public: case ENTRY_DOLF: if (player->GetQuestStatus(QUEST_LIGHT_2) == QUEST_STATUS_INCOMPLETE) { - if (IsHealed && !CanRun && Spell->Id == SPELL_FORTITUDE_R1) + if (IsHealed && !CanRun && spell->Id == SPELL_FORTITUDE_R1) { - DoScriptText(SAY_DOLF_THANKS, me, caster); + Talk(SAY_THANKS, caster->GetGUID()); CanRun = true; } - else if (!IsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + else if (!IsHealed && spell->Id == SPELL_LESSER_HEAL_R2) { CasterGUID = caster->GetGUID(); me->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(SAY_COMMON_HEALED, me, caster); + Talk(SAY_HEALED, caster->GetGUID()); IsHealed = true; } } @@ -1012,16 +1011,16 @@ public: case ENTRY_KORJA: if (player->GetQuestStatus(QUEST_SPIRIT) == QUEST_STATUS_INCOMPLETE) { - if (IsHealed && !CanRun && Spell->Id == SPELL_FORTITUDE_R1) + if (IsHealed && !CanRun && spell->Id == SPELL_FORTITUDE_R1) { - DoScriptText(SAY_KORJA_THANKS, me, caster); + Talk(SAY_THANKS, caster->GetGUID()); CanRun = true; } - else if (!IsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + else if (!IsHealed && spell->Id == SPELL_LESSER_HEAL_R2) { CasterGUID = caster->GetGUID(); me->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(SAY_COMMON_HEALED, me, caster); + Talk(SAY_HEALED, caster->GetGUID()); IsHealed = true; } } @@ -1029,23 +1028,23 @@ public: case ENTRY_DG_KEL: if (player->GetQuestStatus(QUEST_DARKNESS) == QUEST_STATUS_INCOMPLETE) { - if (IsHealed && !CanRun && Spell->Id == SPELL_FORTITUDE_R1) + if (IsHealed && !CanRun && spell->Id == SPELL_FORTITUDE_R1) { - DoScriptText(SAY_DG_KEL_THANKS, me, caster); + Talk(SAY_THANKS, caster->GetGUID()); CanRun = true; } - else if (!IsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + else if (!IsHealed && spell->Id == SPELL_LESSER_HEAL_R2) { CasterGUID = caster->GetGUID(); me->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(SAY_COMMON_HEALED, me, caster); + Talk(SAY_HEALED, caster->GetGUID()); IsHealed = true; } } break; } - //give quest credit, not expect any special quest objectives + // give quest credit, not expect any special quest objectives if (CanRun) player->TalkedToCreature(me->GetEntry(), me->GetGUID()); } @@ -1068,19 +1067,19 @@ public: switch (me->GetEntry()) { case ENTRY_SHAYA: - DoScriptText(SAY_SHAYA_GOODBYE, me, unit); + Talk(SAY_GOODBYE, unit->GetGUID()); break; case ENTRY_ROBERTS: - DoScriptText(SAY_ROBERTS_GOODBYE, me, unit); + Talk(SAY_GOODBYE, unit->GetGUID()); break; case ENTRY_DOLF: - DoScriptText(SAY_DOLF_GOODBYE, me, unit); + Talk(SAY_GOODBYE, unit->GetGUID()); break; case ENTRY_KORJA: - DoScriptText(SAY_KORJA_GOODBYE, me, unit); + Talk(SAY_GOODBYE, unit->GetGUID()); break; case ENTRY_DG_KEL: - DoScriptText(SAY_DG_KEL_GOODBYE, me, unit); + Talk(SAY_GOODBYE, unit->GetGUID()); break; } @@ -1587,49 +1586,6 @@ public: } }; -/*#### -## npc_winter_reveler -####*/ - -enum WinterReveler -{ - SPELL_MISTLETOE_DEBUFF = 26218, - SPELL_CREATE_MISTLETOE = 26206, - SPELL_CREATE_HOLLY = 26207, - SPELL_CREATE_SNOWFLAKES = 45036, -}; - -class npc_winter_reveler : public CreatureScript -{ - public: - npc_winter_reveler() : CreatureScript("npc_winter_reveler") { } - - struct npc_winter_revelerAI : public ScriptedAI - { - npc_winter_revelerAI(Creature* creature) : ScriptedAI(creature) {} - - void ReceiveEmote(Player* player, uint32 emote) - { - if (player->HasAura(SPELL_MISTLETOE_DEBUFF)) - return; - - if (!IsHolidayActive(HOLIDAY_FEAST_OF_WINTER_VEIL)) - return; - - if (emote == TEXT_EMOTE_KISS) - { - uint32 spellId = RAND<uint32>(SPELL_CREATE_MISTLETOE, SPELL_CREATE_HOLLY, SPELL_CREATE_SNOWFLAKES); - me->CastSpell(player, spellId, false); - me->CastSpell(player, SPELL_MISTLETOE_DEBUFF, false); - } - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_winter_revelerAI(creature); - } -}; /*#### ## npc_snake_trap_serpents @@ -3040,7 +2996,6 @@ void AddSC_npcs_special() new npc_sayge(); new npc_steam_tonk(); new npc_tonk_mine(); - new npc_winter_reveler(); new npc_brewfest_reveler(); new npc_snake_trap(); new npc_mirror_image(); diff --git a/src/server/shared/AutoPtr.h b/src/server/shared/AutoPtr.h index 9afa05325c9..621e0007f64 100644 --- a/src/server/shared/AutoPtr.h +++ b/src/server/shared/AutoPtr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/CMakeLists.txt b/src/server/shared/CMakeLists.txt index e9f414d34e5..86d0cbf613b 100644 --- a/src/server/shared/CMakeLists.txt +++ b/src/server/shared/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # 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/shared/Common.cpp b/src/server/shared/Common.cpp index 88e7d5a76fc..28f987cf0b7 100644 --- a/src/server/shared/Common.cpp +++ b/src/server/shared/Common.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Common.h b/src/server/shared/Common.h index ad0e6dd6437..d0c3490bc2d 100644 --- a/src/server/shared/Common.h +++ b/src/server/shared/Common.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/CompilerDefs.h b/src/server/shared/CompilerDefs.h index b8be66d928f..10cdaf4e179 100644 --- a/src/server/shared/CompilerDefs.h +++ b/src/server/shared/CompilerDefs.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Configuration/Config.cpp b/src/server/shared/Configuration/Config.cpp index e0df22b88ae..5d5cc02616b 100644 --- a/src/server/shared/Configuration/Config.cpp +++ b/src/server/shared/Configuration/Config.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Configuration/Config.h b/src/server/shared/Configuration/Config.h index 82e4d9bcce0..778c25f2033 100644 --- a/src/server/shared/Configuration/Config.h +++ b/src/server/shared/Configuration/Config.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Containers.h b/src/server/shared/Containers.h index 0a1b6738f1a..83c691a99e2 100644 --- a/src/server/shared/Containers.h +++ b/src/server/shared/Containers.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Cryptography/ARC4.cpp b/src/server/shared/Cryptography/ARC4.cpp index 5b2cf7a0a93..6395ff99bfa 100644 --- a/src/server/shared/Cryptography/ARC4.cpp +++ b/src/server/shared/Cryptography/ARC4.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Cryptography/ARC4.h b/src/server/shared/Cryptography/ARC4.h index 541135e52f2..0804971f696 100644 --- a/src/server/shared/Cryptography/ARC4.h +++ b/src/server/shared/Cryptography/ARC4.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp b/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp index 5b4ffabd4f6..0f68fcb6c37 100644 --- a/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp +++ b/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Cryptography/Authentication/AuthCrypt.h b/src/server/shared/Cryptography/Authentication/AuthCrypt.h index b40ce8ac40c..200681afd08 100644 --- a/src/server/shared/Cryptography/Authentication/AuthCrypt.h +++ b/src/server/shared/Cryptography/Authentication/AuthCrypt.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Cryptography/BigNumber.cpp b/src/server/shared/Cryptography/BigNumber.cpp index def0a7fd02e..37778cceab8 100644 --- a/src/server/shared/Cryptography/BigNumber.cpp +++ b/src/server/shared/Cryptography/BigNumber.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -28,7 +28,7 @@ BigNumber::BigNumber() , _array(NULL) { } -BigNumber::BigNumber(const BigNumber &bn) +BigNumber::BigNumber(BigNumber const& bn) : _bn(BN_dup(bn._bn)) , _array(NULL) { } @@ -58,44 +58,45 @@ void BigNumber::SetQword(uint64 val) BN_add_word(_bn, (uint32)(val & 0xFFFFFFFF)); } -void BigNumber::SetBinary(const uint8 *bytes, int len) +void BigNumber::SetBinary(uint8 const* bytes, int32 len) { uint8 t[1000]; for (int i = 0; i < len; i++) t[i] = bytes[len - 1 - i]; BN_bin2bn(t, len, _bn); } -void BigNumber::SetHexStr(const char *str) +void BigNumber::SetHexStr(char const* str) { BN_hex2bn(&_bn, str); } -void BigNumber::SetRand(int numbits) +void BigNumber::SetRand(int32 numbits) { BN_rand(_bn, numbits, 0, 1); } -BigNumber& BigNumber::operator=(const BigNumber &bn) +BigNumber& BigNumber::operator=(BigNumber const& bn) { if (this == &bn) return *this; + BN_copy(_bn, bn._bn); return *this; } -BigNumber BigNumber::operator+=(const BigNumber &bn) +BigNumber BigNumber::operator+=(BigNumber const& bn) { BN_add(_bn, _bn, bn._bn); return *this; } -BigNumber BigNumber::operator-=(const BigNumber &bn) +BigNumber BigNumber::operator-=(BigNumber const& bn) { BN_sub(_bn, _bn, bn._bn); return *this; } -BigNumber BigNumber::operator*=(const BigNumber &bn) +BigNumber BigNumber::operator*=(BigNumber const& bn) { BN_CTX *bnctx; @@ -106,7 +107,7 @@ BigNumber BigNumber::operator*=(const BigNumber &bn) return *this; } -BigNumber BigNumber::operator/=(const BigNumber &bn) +BigNumber BigNumber::operator/=(BigNumber const& bn) { BN_CTX *bnctx; @@ -117,7 +118,7 @@ BigNumber BigNumber::operator/=(const BigNumber &bn) return *this; } -BigNumber BigNumber::operator%=(const BigNumber &bn) +BigNumber BigNumber::operator%=(BigNumber const& bn) { BN_CTX *bnctx; @@ -128,7 +129,7 @@ BigNumber BigNumber::operator%=(const BigNumber &bn) return *this; } -BigNumber BigNumber::Exp(const BigNumber &bn) +BigNumber BigNumber::Exp(BigNumber const& bn) { BigNumber ret; BN_CTX *bnctx; @@ -140,7 +141,7 @@ BigNumber BigNumber::Exp(const BigNumber &bn) return ret; } -BigNumber BigNumber::ModExp(const BigNumber &bn1, const BigNumber &bn2) +BigNumber BigNumber::ModExp(BigNumber const& bn1, BigNumber const& bn2) { BigNumber ret; BN_CTX *bnctx; @@ -152,7 +153,7 @@ BigNumber BigNumber::ModExp(const BigNumber &bn1, const BigNumber &bn2) return ret; } -int BigNumber::GetNumBytes(void) +int32 BigNumber::GetNumBytes(void) { return BN_num_bytes(_bn); } @@ -167,7 +168,7 @@ bool BigNumber::isZero() const return BN_is_zero(_bn); } -uint8 *BigNumber::AsByteArray(int minSize, bool reverse) +uint8* BigNumber::AsByteArray(int32 minSize, bool reverse) { int length = (minSize >= GetNumBytes()) ? minSize : GetNumBytes(); diff --git a/src/server/shared/Cryptography/BigNumber.h b/src/server/shared/Cryptography/BigNumber.h index 36a618056a5..fe56fd7e6f9 100644 --- a/src/server/shared/Cryptography/BigNumber.h +++ b/src/server/shared/Cryptography/BigNumber.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -28,45 +28,49 @@ class BigNumber { public: BigNumber(); - BigNumber(const BigNumber &bn); + BigNumber(BigNumber const& bn); BigNumber(uint32); ~BigNumber(); void SetDword(uint32); void SetQword(uint64); - void SetBinary(const uint8 *bytes, int len); - void SetHexStr(const char *str); + void SetBinary(uint8 const* bytes, int32 len); + void SetHexStr(char const* str); - void SetRand(int numbits); + void SetRand(int32 numbits); - BigNumber& operator=(const BigNumber &bn); + BigNumber& operator=(BigNumber const& bn); - BigNumber operator+=(const BigNumber &bn); - BigNumber operator+(const BigNumber &bn) + BigNumber operator+=(BigNumber const& bn); + BigNumber operator+(BigNumber const& bn) { BigNumber t(*this); return t += bn; } - BigNumber operator-=(const BigNumber &bn); - BigNumber operator-(const BigNumber &bn) + + BigNumber operator-=(BigNumber const& bn); + BigNumber operator-(BigNumber const& bn) { BigNumber t(*this); return t -= bn; } - BigNumber operator*=(const BigNumber &bn); - BigNumber operator*(const BigNumber &bn) + + BigNumber operator*=(BigNumber const& bn); + BigNumber operator*(BigNumber const& bn) { BigNumber t(*this); return t *= bn; } - BigNumber operator/=(const BigNumber &bn); - BigNumber operator/(const BigNumber &bn) + + BigNumber operator/=(BigNumber const& bn); + BigNumber operator/(BigNumber const& bn) { BigNumber t(*this); return t /= bn; } - BigNumber operator%=(const BigNumber &bn); - BigNumber operator%(const BigNumber &bn) + + BigNumber operator%=(BigNumber const& bn); + BigNumber operator%(BigNumber const& bn) { BigNumber t(*this); return t %= bn; @@ -74,15 +78,15 @@ class BigNumber bool isZero() const; - BigNumber ModExp(const BigNumber &bn1, const BigNumber &bn2); - BigNumber Exp(const BigNumber &); + BigNumber ModExp(BigNumber const& bn1, BigNumber const& bn2); + BigNumber Exp(BigNumber const&); - int GetNumBytes(void); + int32 GetNumBytes(void); struct bignum_st *BN() { return _bn; } uint32 AsDword(); - uint8* AsByteArray(int minSize = 0, bool reverse = true); + uint8* AsByteArray(int32 minSize = 0, bool reverse = true); char * AsHexStr() const; char * AsDecStr() const; diff --git a/src/server/shared/Cryptography/HMACSHA1.cpp b/src/server/shared/Cryptography/HMACSHA1.cpp index c9de1191464..ab50eb9981a 100644 --- a/src/server/shared/Cryptography/HMACSHA1.cpp +++ b/src/server/shared/Cryptography/HMACSHA1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Cryptography/HMACSHA1.h b/src/server/shared/Cryptography/HMACSHA1.h index 4b7667968ca..e09e7fdb43c 100644 --- a/src/server/shared/Cryptography/HMACSHA1.h +++ b/src/server/shared/Cryptography/HMACSHA1.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Cryptography/SHA1.cpp b/src/server/shared/Cryptography/SHA1.cpp index 2af8e4d4cbe..d02e9711014 100644 --- a/src/server/shared/Cryptography/SHA1.cpp +++ b/src/server/shared/Cryptography/SHA1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Cryptography/SHA1.h b/src/server/shared/Cryptography/SHA1.h index 7c77defebfa..a4232f4e75f 100644 --- a/src/server/shared/Cryptography/SHA1.h +++ b/src/server/shared/Cryptography/SHA1.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Cryptography/WardenKeyGeneration.h b/src/server/shared/Cryptography/WardenKeyGeneration.h index f0a9905b6fe..5c04da38dc9 100644 --- a/src/server/shared/Cryptography/WardenKeyGeneration.h +++ b/src/server/shared/Cryptography/WardenKeyGeneration.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/DataStores/DBCFileLoader.cpp b/src/server/shared/DataStores/DBCFileLoader.cpp index 6f78ce5a02d..5e82579d29d 100644 --- a/src/server/shared/DataStores/DBCFileLoader.cpp +++ b/src/server/shared/DataStores/DBCFileLoader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/DataStores/DBCFileLoader.h b/src/server/shared/DataStores/DBCFileLoader.h index eb8317fbefd..1756b635635 100644 --- a/src/server/shared/DataStores/DBCFileLoader.h +++ b/src/server/shared/DataStores/DBCFileLoader.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/DataStores/DBCStore.h b/src/server/shared/DataStores/DBCStore.h index e872ead35db..af15ea800e4 100644 --- a/src/server/shared/DataStores/DBCStore.h +++ b/src/server/shared/DataStores/DBCStore.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -28,20 +28,20 @@ struct SqlDbc { - const std::string * formatString; - const std::string * indexName; + std::string const* formatString; + std::string const* indexName; std::string sqlTableName; int32 indexPos; int32 sqlIndexPos; - SqlDbc(const std::string * _filename, const std::string * _format, const std::string * _idname, const char * fmt) - :formatString(_format), indexName (_idname), sqlIndexPos(0) + SqlDbc(std::string const* _filename, std::string const* _format, std::string const* _idname, char const* fmt) + : formatString(_format), indexName (_idname), sqlIndexPos(0) { // Convert dbc file name to sql table name sqlTableName = *_filename; for (uint32 i = 0; i< sqlTableName.size(); ++i) { if (isalpha(sqlTableName[i])) - sqlTableName[i] = tolower(sqlTableName[i]); + sqlTableName[i] = char(tolower(sqlTableName[i])); else if (sqlTableName[i] == '.') sqlTableName[i] = '_'; } @@ -70,22 +70,24 @@ class DBCStorage { typedef std::list<char*> StringPoolList; public: - explicit DBCStorage(const char *f) : - fmt(f), nCount(0), fieldCount(0), dataTable(NULL) + explicit DBCStorage(char const* f) + : fmt(f), nCount(0), fieldCount(0), dataTable(NULL) { indexTable.asT = NULL; } + ~DBCStorage() { Clear(); } T const* LookupEntry(uint32 id) const { return (id >= nCount) ? NULL : indexTable.asT[id]; } + uint32 GetNumRows() const { return nCount; } char const* GetFormat() const { return fmt; } uint32 GetFieldCount() const { return fieldCount; } - bool Load(char const* fn, SqlDbc * sql) + bool Load(char const* fn, SqlDbc* sql) { DBCFileLoader dbc; // Check if load was sucessful, only then continue @@ -114,8 +116,9 @@ class DBCStorage fields = result->Fetch(); sqlHighestIndex = fields[sql->sqlIndexPos].GetUInt32(); } + // Check if sql index pos is valid - if (int32(result->GetFieldCount()-1) < sql->sqlIndexPos) + if (int32(result->GetFieldCount() - 1) < sql->sqlIndexPos) { sLog->outError(LOG_FILTER_SERVER_LOADING, "Invalid index pos for dbc:'%s'", sql->sqlTableName.c_str()); return false; @@ -123,13 +126,13 @@ class DBCStorage } } - char * sqlDataTable; + char* sqlDataTable = NULL; fieldCount = dbc.GetCols(); - dataTable = (T*)dbc.AutoProduceData(fmt, nCount, indexTable.asChar, - sqlRecordCount, sqlHighestIndex, sqlDataTable); + dataTable = reinterpret_cast<T*>(dbc.AutoProduceData(fmt, nCount, indexTable.asChar, + sqlRecordCount, sqlHighestIndex, sqlDataTable)); - stringPoolList.push_back(dbc.AutoProduceStrings(fmt, (char*)dataTable)); + stringPoolList.push_back(dbc.AutoProduceStrings(fmt, reinterpret_cast<char*>(dataTable))); // Insert sql data into arrays if (result) @@ -151,10 +154,12 @@ class DBCStorage sLog->outError(LOG_FILTER_SERVER_LOADING, "Index %d already exists in dbc:'%s'", id, sql->sqlTableName.c_str()); return false; } - indexTable.asT[id]=(T*)&sqlDataTable[offset]; + + indexTable.asT[id] = reinterpret_cast<T*>(&sqlDataTable[offset]); } else - indexTable.asT[rowIndex]=(T*)&sqlDataTable[offset]; + indexTable.asT[rowIndex]= reinterpret_cast<T*>(&sqlDataTable[offset]); + uint32 columnNumber = 0; uint32 sqlColumnNumber = 0; @@ -165,22 +170,22 @@ class DBCStorage switch (fmt[columnNumber]) { case FT_FLOAT: - *((float*)(&sqlDataTable[offset]))= 0.0f; - offset+=4; + *reinterpret_cast<float*>(&sqlDataTable[offset]) = 0.0f; + offset += 4; break; case FT_IND: case FT_INT: - *((uint32*)(&sqlDataTable[offset]))=uint32(0); - offset+=4; + *reinterpret_cast<uint32*>(&sqlDataTable[offset]) = uint32(0); + offset += 4; break; case FT_BYTE: - *((uint8*)(&sqlDataTable[offset]))=uint8(0); - offset+=1; + *reinterpret_cast<uint8*>(&sqlDataTable[offset]) = uint8(0); + offset += 1; break; case FT_STRING: // Beginning of the pool - empty string - *((char**)(&sqlDataTable[offset]))=stringPoolList.back(); - offset+=sizeof(char*); + *reinterpret_cast<char**>(&sqlDataTable[offset]) = stringPoolList.back(); + offset += sizeof(char*); break; } } @@ -190,17 +195,17 @@ class DBCStorage switch (fmt[columnNumber]) { case FT_FLOAT: - *((float*)(&sqlDataTable[offset]))=fields[sqlColumnNumber].GetFloat(); - offset+=4; + *reinterpret_cast<float*>(&sqlDataTable[offset]) = fields[sqlColumnNumber].GetFloat(); + offset += 4; break; case FT_IND: case FT_INT: - *((uint32*)(&sqlDataTable[offset]))=fields[sqlColumnNumber].GetUInt32(); - offset+=4; + *reinterpret_cast<uint32*>(&sqlDataTable[offset]) = fields[sqlColumnNumber].GetUInt32(); + offset += 4; break; case FT_BYTE: - *((uint8*)(&sqlDataTable[offset]))=fields[sqlColumnNumber].GetUInt8(); - offset+=1; + *reinterpret_cast<uint8*>(&sqlDataTable[offset]) = fields[sqlColumnNumber].GetUInt8(); + offset += 1; break; case FT_STRING: sLog->outError(LOG_FILTER_SERVER_LOADING, "Unsupported data type in table '%s' at char %d", sql->sqlTableName.c_str(), columnNumber); @@ -209,6 +214,7 @@ class DBCStorage break; default: validSqlColumn = false; + break; } if (validSqlColumn && (columnNumber != (sql->formatString->size()-1))) sqlColumnNumber++; @@ -219,7 +225,8 @@ class DBCStorage return false; } } - if (sqlColumnNumber != (result->GetFieldCount()-1)) + + if (sqlColumnNumber != (result->GetFieldCount() - 1)) { sLog->outError(LOG_FILTER_SERVER_LOADING, "SQL and DBC format strings are not matching for table: '%s'", sql->sqlTableName.c_str()); return false; @@ -227,7 +234,7 @@ class DBCStorage fields = NULL; ++rowIndex; - }while (result->NextRow()); + } while (result->NextRow()); } } @@ -246,7 +253,7 @@ class DBCStorage if (!dbc.Load(fn, fmt)) return false; - stringPoolList.push_back(dbc.AutoProduceStrings(fmt, (char*)dataTable)); + stringPoolList.push_back(dbc.AutoProduceStrings(fmt, reinterpret_cast<char*>(dataTable))); return true; } @@ -256,9 +263,9 @@ class DBCStorage if (!indexTable.asT) return; - delete[] ((char*)indexTable.asT); + delete[] reinterpret_cast<char*>(indexTable.asT); indexTable.asT = NULL; - delete[] ((char*)dataTable); + delete[] reinterpret_cast<char*>(dataTable); dataTable = NULL; while (!stringPoolList.empty()) @@ -266,6 +273,7 @@ class DBCStorage delete[] stringPoolList.front(); stringPoolList.pop_front(); } + nCount = 0; } diff --git a/src/server/shared/Database/AdhocStatement.cpp b/src/server/shared/Database/AdhocStatement.cpp index 95dce77e53c..23175cd2273 100644 --- a/src/server/shared/Database/AdhocStatement.cpp +++ b/src/server/shared/Database/AdhocStatement.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Database/AdhocStatement.h b/src/server/shared/Database/AdhocStatement.h index e17a85e7466..7b41b43725c 100644 --- a/src/server/shared/Database/AdhocStatement.h +++ b/src/server/shared/Database/AdhocStatement.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Database/DatabaseEnv.h b/src/server/shared/Database/DatabaseEnv.h index 13b900d8392..f45a468f617 100644 --- a/src/server/shared/Database/DatabaseEnv.h +++ b/src/server/shared/Database/DatabaseEnv.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Database/DatabaseWorker.cpp b/src/server/shared/Database/DatabaseWorker.cpp index 662c879ad5e..1333ba14632 100644 --- a/src/server/shared/Database/DatabaseWorker.cpp +++ b/src/server/shared/Database/DatabaseWorker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Database/DatabaseWorker.h b/src/server/shared/Database/DatabaseWorker.h index c01a9c1bc3c..252517e336e 100644 --- a/src/server/shared/Database/DatabaseWorker.h +++ b/src/server/shared/Database/DatabaseWorker.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Database/DatabaseWorkerPool.h b/src/server/shared/Database/DatabaseWorkerPool.h index a0816686734..34b7c5083e3 100644 --- a/src/server/shared/Database/DatabaseWorkerPool.h +++ b/src/server/shared/Database/DatabaseWorkerPool.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Database/Field.cpp b/src/server/shared/Database/Field.cpp index 3ea153bdc0c..9bd37641813 100644 --- a/src/server/shared/Database/Field.cpp +++ b/src/server/shared/Database/Field.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Database/Field.h b/src/server/shared/Database/Field.h index 61e8fb7ccef..878b806ecb9 100644 --- a/src/server/shared/Database/Field.h +++ b/src/server/shared/Database/Field.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -246,6 +246,11 @@ class Field return std::string((char*)data.value); } + bool IsNull() const + { + return data.value == NULL; + } + protected: Field(); ~Field(); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 33f0cab5170..cfbd4b2bc45 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -22,527 +22,559 @@ void CharacterDatabaseConnection::DoPrepareStatements() if (!m_reconnecting) m_stmts.resize(MAX_CHARACTERDATABASE_STATEMENTS); - PREPARE_STATEMENT(CHAR_DEL_QUEST_POOL_SAVE, "DELETE FROM pool_quest_save WHERE pool_id = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_INS_QUEST_POOL_SAVE, "INSERT INTO pool_quest_save (pool_id, quest_id) VALUES (?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEM, "DELETE FROM guild_bank_item WHERE guildid = ? AND TabId = ? AND SlotId = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_EXPIRED_BANS, "UPDATE character_banned SET active = 0 WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate <> bandate", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_GUID_BY_NAME, "SELECT guid FROM characters WHERE name = ?", CONNECTION_BOTH); - PREPARE_STATEMENT(CHAR_SEL_CHECK_NAME, "SELECT 1 FROM characters WHERE name = ?", CONNECTION_BOTH); - PREPARE_STATEMENT(CHAR_SEL_CHECK_GUID, "SELECT 1 FROM characters WHERE guid = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_SUM_CHARS, "SELECT COUNT(guid) FROM characters WHERE account = ?", CONNECTION_BOTH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_CREATE_INFO, "SELECT level, race, class FROM characters WHERE account = ? LIMIT 0, ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_CHARACTER_BAN, "INSERT INTO character_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_CHARACTER_BAN, "UPDATE character_banned SET active = 0 WHERE guid = ? AND active != 0", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_CHARACTER_BAN, "DELETE cb FROM character_banned cb INNER JOIN characters c ON c.guid = cb.guid WHERE c.account = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_SEL_BANINFO, "SELECT FROM_UNIXTIME(bandate), unbandate-bandate, active, unbandate, banreason, bannedby FROM character_banned WHERE guid = ? ORDER BY bandate ASC", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_SEL_GUID_BY_NAME_FILTER, "SELECT guid, name FROM characters WHERE name LIKE CONCAT('%%', ?, '%%')", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_SEL_BANINFO_LIST, "SELECT bandate, unbandate, bannedby, banreason FROM character_banned WHERE guid = ? ORDER BY unbandate", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_SEL_BANNED_NAME, "SELECT characters.name FROM characters, character_banned WHERE character_banned.guid = ? AND character_banned.guid = characters.guid", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_SEL_ENUM, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN guild_member AS gm ON c.guid = gm.guid LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? ORDER BY c.guid", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_SEL_ENUM_DECLINED_NAME, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid, cd.genitive FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN character_declinedname AS cd ON c.guid = cd.guid LEFT JOIN guild_member AS gm ON c.guid = gm.guid LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? ORDER BY c.guid", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_SEL_PET_SLOTS, "SELECT owner, slot FROM character_pet WHERE owner = ? AND slot >= ? AND slot <= ? ORDER BY slot", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_SEL_PET_SLOTS_DETAIL, "SELECT owner, id, entry, level, name FROM character_pet WHERE owner = ? AND slot >= ? AND slot <= ? ORDER BY slot", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_SEL_PET_ENTRY, "SELECT entry FROM character_pet WHERE owner = ? AND id = ? AND slot >= ? AND slot <= ?", CONNECTION_ASYNC); - 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_CHARACTER_NAME_DATA, "SELECT race, class, gender, level FROM characters WHERE guid = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_POSITION_XYZ, "SELECT map, position_x, position_y, position_z FROM characters WHERE guid = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_POSITION, "SELECT position_x, position_y, position_z, orientation, map, taxi_path FROM characters WHERE guid = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_DAILY, "DELETE FROM character_queststatus_daily", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_WEEKLY, "DELETE FROM character_queststatus_weekly", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_MONTHLY, "DELETE FROM character_queststatus_monthly", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_SEASONAL, "DELETE FROM character_queststatus_seasonal WHERE event = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_DAILY_CHAR, "DELETE FROM character_queststatus_daily WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_WEEKLY_CHAR, "DELETE FROM character_queststatus_weekly WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_MONTHLY_CHAR, "DELETE FROM character_queststatus_monthly WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_SEASONAL_CHAR, "DELETE FROM character_queststatus_seasonal WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_BATTLEGROUND_RANDOM, "DELETE FROM character_battleground_random", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_BATTLEGROUND_RANDOM, "INSERT INTO character_battleground_random (guid) VALUES (?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_QUEST_POOL_SAVE, "DELETE FROM pool_quest_save WHERE pool_id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_QUEST_POOL_SAVE, "INSERT INTO pool_quest_save (pool_id, quest_id) VALUES (?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEM, "DELETE FROM guild_bank_item WHERE guildid = ? AND TabId = ? AND SlotId = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_EXPIRED_BANS, "UPDATE character_banned SET active = 0 WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate <> bandate", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_GUID_BY_NAME, "SELECT guid FROM characters WHERE name = ?", CONNECTION_BOTH); + PrepareStatement(CHAR_SEL_CHECK_NAME, "SELECT 1 FROM characters WHERE name = ?", CONNECTION_BOTH); + PrepareStatement(CHAR_SEL_CHECK_GUID, "SELECT 1 FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_SUM_CHARS, "SELECT COUNT(guid) FROM characters WHERE account = ?", CONNECTION_BOTH); + PrepareStatement(CHAR_SEL_CHAR_CREATE_INFO, "SELECT level, race, class FROM characters WHERE account = ? LIMIT 0, ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHARACTER_BAN, "INSERT INTO character_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHARACTER_BAN, "UPDATE character_banned SET active = 0 WHERE guid = ? AND active != 0", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHARACTER_BAN, "DELETE cb FROM character_banned cb INNER JOIN characters c ON c.guid = cb.guid WHERE c.account = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_BANINFO, "SELECT FROM_UNIXTIME(bandate), unbandate-bandate, active, unbandate, banreason, bannedby FROM character_banned WHERE guid = ? ORDER BY bandate ASC", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_GUID_BY_NAME_FILTER, "SELECT guid, name FROM characters WHERE name LIKE CONCAT('%%', ?, '%%')", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_BANINFO_LIST, "SELECT bandate, unbandate, bannedby, banreason FROM character_banned WHERE guid = ? ORDER BY unbandate", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_BANNED_NAME, "SELECT characters.name FROM characters, character_banned WHERE character_banned.guid = ? AND character_banned.guid = characters.guid", CONNECTION_SYNCH); + PrepareStatement(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); + PrepareStatement(CHAR_SEL_ENUM_DECLINED_NAME, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, " + "c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, " + "cb.guid, cd.genitive FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? " + "LEFT JOIN character_declinedname AS cd ON c.guid = cd.guid LEFT JOIN guild_member AS gm ON c.guid = gm.guid " + "LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? ORDER BY c.guid", CONNECTION_ASYNC); + PrepareStatement(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); + PrepareStatement(CHAR_SEL_GUID_RACE_ACC_BY_NAME, "SELECT guid, race, account FROM characters WHERE name = ?", CONNECTION_BOTH); + PrepareStatement(CHAR_SEL_CHAR_RACE, "SELECT race FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHAR_LEVEL, "SELECT level FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHAR_ZONE, "SELECT zone FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHARACTER_NAME_DATA, "SELECT race, class, gender, level FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHAR_POSITION_XYZ, "SELECT map, position_x, position_y, position_z FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHAR_POSITION, "SELECT position_x, position_y, position_z, orientation, map, taxi_path FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_DEL_QUEST_STATUS_DAILY, "DELETE FROM character_queststatus_daily", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_QUEST_STATUS_WEEKLY, "DELETE FROM character_queststatus_weekly", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_QUEST_STATUS_MONTHLY, "DELETE FROM character_queststatus_monthly", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_QUEST_STATUS_SEASONAL, "DELETE FROM character_queststatus_seasonal WHERE event = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_QUEST_STATUS_DAILY_CHAR, "DELETE FROM character_queststatus_daily WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_QUEST_STATUS_WEEKLY_CHAR, "DELETE FROM character_queststatus_weekly WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_QUEST_STATUS_MONTHLY_CHAR, "DELETE FROM character_queststatus_monthly WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_QUEST_STATUS_SEASONAL_CHAR, "DELETE FROM character_queststatus_seasonal WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_BATTLEGROUND_RANDOM, "DELETE FROM character_battleground_random", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_BATTLEGROUND_RANDOM, "INSERT INTO character_battleground_random (guid) VALUES (?)", CONNECTION_ASYNC); // Start LoginQueryHolder content - PREPARE_STATEMENT(CHAR_SEL_CHARACTER, "SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, " - "position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, " - "resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " - "arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, " - "health, power1, power2, power3, power4, power5, power6, power7, instance_id, speccount, activespec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars, grantableLevels FROM characters WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_BOTH) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_INSTANCE, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_AURAS, "SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, " - "base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges FROM character_aura WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SPELL, "SELECT spell, active, disabled FROM character_spell WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_QUESTSTATUS, "SELECT quest, status, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, " - "itemcount1, itemcount2, itemcount3, itemcount4, playercount FROM character_queststatus WHERE guid = ? AND status <> 0", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_DAILYQUESTSTATUS, "SELECT quest, time FROM character_queststatus_daily WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_WEEKLYQUESTSTATUS, "SELECT quest FROM character_queststatus_weekly WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_MONTHLYQUESTSTATUS, "SELECT quest FROM character_queststatus_monthly WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SEASONALQUESTSTATUS, "SELECT quest, event FROM character_queststatus_seasonal WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_INS_CHARACTER_DAILYQUESTSTATUS, "INSERT INTO character_queststatus_daily (guid, quest, time) VALUES (?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_INS_CHARACTER_WEEKLYQUESTSTATUS, "INSERT INTO character_queststatus_weekly (guid, quest) VALUES (?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_INS_CHARACTER_MONTHLYQUESTSTATUS, "INSERT INTO character_queststatus_monthly (guid, quest) VALUES (?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_INS_CHARACTER_SEASONALQUESTSTATUS, "INSERT INTO character_queststatus_seasonal (guid, quest, event) VALUES (?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_REPUTATION, "SELECT faction, standing, flags FROM character_reputation WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_INVENTORY, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, bag, slot, " - "item, itemEntry FROM character_inventory ci JOIN item_instance ii ON ci.item = ii.guid WHERE ci.guid = ? ORDER BY bag, slot", CONNECTION_ASYNC) - 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_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, ignore_mask, item0, item1, item2, item3, item4, item5, item6, item7, item8, " - "item9, item10, item11, item12, item13, item14, item15, item16, item17, item18 FROM character_equipmentsets WHERE guid = ? ORDER BY setindex", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_BGDATA, "SELECT instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell FROM character_battleground_data WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_GLYPHS, "SELECT spec, glyph1, glyph2, glyph3, glyph4, glyph5, glyph6 FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_TALENTS, "SELECT spell, spec FROM character_talent WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SKILLS, "SELECT skill, value, max FROM character_skills WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_RANDOMBG, "SELECT guid FROM character_battleground_random WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_BANNED, "SELECT guid FROM character_banned WHERE guid = ? AND active = 1", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_QUESTSTATUSREW, "SELECT quest FROM character_queststatus_rewarded WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_ACCOUNT_INSTANCELOCKTIMES, "SELECT instanceId, releaseTime FROM account_instance_times WHERE accountId = ?", CONNECTION_ASYNC) + PrepareStatement(CHAR_SEL_CHARACTER, "SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, " + "position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, " + "resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " + "arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, " + "health, power1, power2, power3, power4, power5, power6, power7, instance_id, speccount, activespec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars, grantableLevels " + "FROM characters WHERE guid = ?", CONNECTION_ASYNC); + + PrepareStatement(CHAR_SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_BOTH); + PrepareStatement(CHAR_SEL_CHARACTER_INSTANCE, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_AURAS, "SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, " + "base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges FROM character_aura WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_SPELL, "SELECT spell, active, disabled FROM character_spell WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_QUESTSTATUS, "SELECT quest, status, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, " + "itemcount1, itemcount2, itemcount3, itemcount4, playercount FROM character_queststatus WHERE guid = ? AND status <> 0", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_DAILYQUESTSTATUS, "SELECT quest, time FROM character_queststatus_daily WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_WEEKLYQUESTSTATUS, "SELECT quest FROM character_queststatus_weekly WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_MONTHLYQUESTSTATUS, "SELECT quest FROM character_queststatus_monthly WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_SEASONALQUESTSTATUS, "SELECT quest, event FROM character_queststatus_seasonal WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHARACTER_DAILYQUESTSTATUS, "INSERT INTO character_queststatus_daily (guid, quest, time) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHARACTER_WEEKLYQUESTSTATUS, "INSERT INTO character_queststatus_weekly (guid, quest) VALUES (?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHARACTER_MONTHLYQUESTSTATUS, "INSERT INTO character_queststatus_monthly (guid, quest) VALUES (?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHARACTER_SEASONALQUESTSTATUS, "INSERT INTO character_queststatus_seasonal (guid, quest, event) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_REPUTATION, "SELECT faction, standing, flags FROM character_reputation WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_INVENTORY, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, bag, slot, " + "item, itemEntry FROM character_inventory ci JOIN item_instance ii ON ci.item = ii.guid WHERE ci.guid = ? ORDER BY bag, slot", CONNECTION_ASYNC); + PrepareStatement(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); + PrepareStatement(CHAR_SEL_CHARACTER_MAILCOUNT, "SELECT COUNT(id) FROM mail WHERE receiver = ? AND (checked & 1) = 0 AND deliver_time <= ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_MAILDATE, "SELECT MIN(deliver_time) FROM mail WHERE receiver = ? AND (checked & 1) = 0", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_MAIL_COUNT, "SELECT COUNT(*) FROM mail WHERE receiver = ?", CONNECTION_SYNCH); + PrepareStatement(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); + PrepareStatement(CHAR_SEL_CHARACTER_HOMEBIND, "SELECT mapId, zoneId, posX, posY, posZ FROM character_homebind WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_SPELLCOOLDOWNS, "SELECT spell, item, time FROM character_spell_cooldown WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_DECLINEDNAMES, "SELECT genitive, dative, accusative, instrumental, prepositional FROM character_declinedname WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_GUILD_MEMBER, "SELECT guildid, rank FROM guild_member WHERE guid = ?", CONNECTION_BOTH); + PrepareStatement(CHAR_SEL_CHARACTER_ACHIEVEMENTS, "SELECT achievement, date FROM character_achievement WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_CRITERIAPROGRESS, "SELECT criteria, counter, date FROM character_achievement_progress WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_EQUIPMENTSETS, "SELECT setguid, setindex, name, iconname, ignore_mask, item0, item1, item2, item3, item4, item5, item6, item7, item8, " + "item9, item10, item11, item12, item13, item14, item15, item16, item17, item18 FROM character_equipmentsets WHERE guid = ? ORDER BY setindex", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_BGDATA, "SELECT instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell FROM character_battleground_data WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_GLYPHS, "SELECT spec, glyph1, glyph2, glyph3, glyph4, glyph5, glyph6 FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_TALENTS, "SELECT spell, spec FROM character_talent WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_SKILLS, "SELECT skill, value, max FROM character_skills WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_RANDOMBG, "SELECT guid FROM character_battleground_random WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_BANNED, "SELECT guid FROM character_banned WHERE guid = ? AND active = 1", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_QUESTSTATUSREW, "SELECT quest FROM character_queststatus_rewarded WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_ACCOUNT_INSTANCELOCKTIMES, "SELECT instanceId, releaseTime FROM account_instance_times WHERE accountId = ?", CONNECTION_ASYNC); // End LoginQueryHolder content - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_ACTIONS_SPEC, "SELECT button, action, type FROM character_action WHERE guid = ? AND spec = ? ORDER BY button", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_SEL_MAILITEMS, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, item_guid, itemEntry, owner_guid FROM mail_items mi JOIN item_instance ii ON mi.item_guid = ii.guid WHERE mail_id = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_SEL_AUCTION_ITEMS, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, itemguid, itemEntry FROM auctionhouse ah JOIN item_instance ii ON ah.itemguid = ii.guid", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_SEL_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, count, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_INS_AUCTION, "INSERT INTO auctionhouse (id, auctioneerguid, itemguid, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_AUCTION, "DELETE FROM auctionhouse WHERE id = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_AUCTION_BY_TIME, "SELECT id FROM auctionhouse WHERE time <= ? ORDER BY TIME ASC", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_UPD_AUCTION_BID, "UPDATE auctionhouse SET buyguid = ?, lastbid = ? WHERE id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_MAIL, "INSERT INTO mail(id, messageType, stationery, mailTemplateId, sender, receiver, subject, body, has_items, expire_time, deliver_time, money, cod, checked) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_MAIL_BY_ID, "DELETE FROM mail WHERE id = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_INS_MAIL_ITEM, "INSERT INTO mail_items(mail_id, item_guid, receiver) VALUES (?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_MAIL_ITEM, "DELETE FROM mail_items WHERE item_guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_INVALID_MAIL_ITEM, "DELETE FROM mail_items WHERE item_guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_EMPTY_EXPIRED_MAIL, "DELETE FROM mail WHERE expire_time < ? AND has_items = 0 AND body = ''", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_EXPIRED_MAIL, "SELECT id, messageType, sender, receiver, has_items, expire_time, cod, checked, mailTemplateId FROM mail WHERE expire_time < ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_SEL_EXPIRED_MAIL_ITEMS, "SELECT item_guid, itemEntry, mail_id FROM mail_items mi INNER JOIN item_instance ii ON ii.guid = mi.item_guid LEFT JOIN mail mm ON mi.mail_id = mm.id WHERE mm.id IS NOT NULL AND mm.expire_time < ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_UPD_MAIL_RETURNED, "UPDATE mail SET sender = ?, receiver = ?, expire_time = ?, deliver_time = ?, cod = 0, checked = ? WHERE id = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_MAIL_ITEM_RECEIVER, "UPDATE mail_items SET receiver = ? WHERE item_guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_ITEM_OWNER, "UPDATE item_instance SET owner_guid = ? WHERE guid = ?", CONNECTION_ASYNC) - - PREPARE_STATEMENT(CHAR_SEL_ITEM_REFUNDS, "SELECT player_guid, paidMoney, paidExtendedCost FROM item_refund_instance WHERE item_guid = ? AND player_guid = ? LIMIT 1", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_SEL_ITEM_BOP_TRADE, "SELECT allowedPlayers FROM item_soulbound_trade_data WHERE itemGuid = ? LIMIT 1", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_DEL_ITEM_BOP_TRADE, "DELETE FROM item_soulbound_trade_data WHERE itemGuid = ? LIMIT 1", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_INS_ITEM_BOP_TRADE, "INSERT INTO item_soulbound_trade_data VALUES (?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_REP_INVENTORY_ITEM, "REPLACE INTO character_inventory (guid, bag, slot, item) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_REP_ITEM_INSTANCE, "REPLACE INTO item_instance (itemEntry, owner_guid, creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, guid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_ITEM_INSTANCE, "UPDATE item_instance SET itemEntry = ?, owner_guid = ?, creatorGuid = ?, giftCreatorGuid = ?, count = ?, duration = ?, charges = ?, flags = ?, enchantments = ?, randomPropertyId = ?, durability = ?, playedTime = ?, text = ? WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_ITEM_INSTANCE_ON_LOAD, "UPDATE item_instance SET duration = ?, flags = ?, durability = ? WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_ITEM_INSTANCE, "DELETE FROM item_instance WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_GIFT_OWNER, "UPDATE character_gifts SET guid = ? WHERE item_guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_GIFT, "DELETE FROM character_gifts WHERE item_guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_GIFT_BY_ITEM, "SELECT entry, flags FROM character_gifts WHERE item_guid = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_ACCOUNT_BY_NAME, "SELECT account FROM characters WHERE name = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_SEL_ACCOUNT_BY_GUID, "SELECT account FROM characters WHERE guid = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_DATA_BY_GUID, "SELECT account, name, level 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); - PREPARE_STATEMENT(CHAR_DEL_DECLINED_NAME, "DELETE FROM character_declinedname WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_ACTIONS_SPEC, "SELECT button, action, type FROM character_action WHERE guid = ? AND spec = ? ORDER BY button", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_MAILITEMS, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, item_guid, itemEntry, owner_guid FROM mail_items mi JOIN item_instance ii ON mi.item_guid = ii.guid WHERE mail_id = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_AUCTION_ITEMS, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, itemguid, itemEntry FROM auctionhouse ah JOIN item_instance ii ON ah.itemguid = ii.guid", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, count, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid", CONNECTION_SYNCH); + PrepareStatement(CHAR_INS_AUCTION, "INSERT INTO auctionhouse (id, auctioneerguid, itemguid, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_AUCTION, "DELETE FROM auctionhouse WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_AUCTION_BY_TIME, "SELECT id FROM auctionhouse WHERE time <= ? ORDER BY TIME ASC", CONNECTION_SYNCH); + PrepareStatement(CHAR_UPD_AUCTION_BID, "UPDATE auctionhouse SET buyguid = ?, lastbid = ? WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(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); + PrepareStatement(CHAR_DEL_MAIL_BY_ID, "DELETE FROM mail WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_MAIL_ITEM, "INSERT INTO mail_items(mail_id, item_guid, receiver) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_MAIL_ITEM, "DELETE FROM mail_items WHERE item_guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_INVALID_MAIL_ITEM, "DELETE FROM mail_items WHERE item_guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_EMPTY_EXPIRED_MAIL, "DELETE FROM mail WHERE expire_time < ? AND has_items = 0 AND body = ''", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_EXPIRED_MAIL, "SELECT id, messageType, sender, receiver, has_items, expire_time, cod, checked, mailTemplateId FROM mail WHERE expire_time < ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_EXPIRED_MAIL_ITEMS, "SELECT item_guid, itemEntry, mail_id FROM mail_items mi INNER JOIN item_instance ii ON ii.guid = mi.item_guid LEFT JOIN mail mm ON mi.mail_id = mm.id WHERE mm.id IS NOT NULL AND mm.expire_time < ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_UPD_MAIL_RETURNED, "UPDATE mail SET sender = ?, receiver = ?, expire_time = ?, deliver_time = ?, cod = 0, checked = ? WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_MAIL_ITEM_RECEIVER, "UPDATE mail_items SET receiver = ? WHERE item_guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_ITEM_OWNER, "UPDATE item_instance SET owner_guid = ? WHERE guid = ?", CONNECTION_ASYNC); + + PrepareStatement(CHAR_SEL_ITEM_REFUNDS, "SELECT player_guid, paidMoney, paidExtendedCost FROM item_refund_instance WHERE item_guid = ? AND player_guid = ? LIMIT 1", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_ITEM_BOP_TRADE, "SELECT allowedPlayers FROM item_soulbound_trade_data WHERE itemGuid = ? LIMIT 1", CONNECTION_SYNCH); + PrepareStatement(CHAR_DEL_ITEM_BOP_TRADE, "DELETE FROM item_soulbound_trade_data WHERE itemGuid = ? LIMIT 1", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_ITEM_BOP_TRADE, "INSERT INTO item_soulbound_trade_data VALUES (?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_REP_INVENTORY_ITEM, "REPLACE INTO character_inventory (guid, bag, slot, item) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_REP_ITEM_INSTANCE, "REPLACE INTO item_instance (itemEntry, owner_guid, creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, guid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_ITEM_INSTANCE, "UPDATE item_instance SET itemEntry = ?, owner_guid = ?, creatorGuid = ?, giftCreatorGuid = ?, count = ?, duration = ?, charges = ?, flags = ?, enchantments = ?, randomPropertyId = ?, durability = ?, playedTime = ?, text = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_ITEM_INSTANCE_ON_LOAD, "UPDATE item_instance SET duration = ?, flags = ?, durability = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_ITEM_INSTANCE, "DELETE FROM item_instance WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_GIFT_OWNER, "UPDATE character_gifts SET guid = ? WHERE item_guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GIFT, "DELETE FROM character_gifts WHERE item_guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_GIFT_BY_ITEM, "SELECT entry, flags FROM character_gifts WHERE item_guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_ACCOUNT_BY_NAME, "SELECT account FROM characters WHERE name = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_ACCOUNT_BY_GUID, "SELECT account FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHARACTER_DATA_BY_GUID, "SELECT account, name, level FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_DEL_ACCOUNT_INSTANCE_LOCK_TIMES, "DELETE FROM account_instance_times WHERE accountId = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_ACCOUNT_INSTANCE_LOCK_TIMES, "INSERT INTO account_instance_times (accountId, instanceId, releaseTime) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_NAME_CLASS, "SELECT name, class FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHARACTER_NAME, "SELECT name FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_MATCH_MAKER_RATING, "SELECT matchMakerRating FROM character_arena_stats WHERE guid = ? AND slot = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHARACTER_COUNT, "SELECT account, COUNT(guid) FROM characters WHERE account = ? GROUP BY account", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_NAME, "UPDATE characters set name = ?, at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_DECLINED_NAME, "DELETE FROM character_declinedname WHERE guid = ?", CONNECTION_ASYNC); // Guild handling // 0: uint32, 1: string, 2: uint32, 3: string, 4: string, 5: uint64, 6-10: uint32, 11: uint64 - PREPARE_STATEMENT(CHAR_INS_GUILD, "INSERT INTO guild (guildid, name, leaderguid, info, motd, createdate, EmblemStyle, EmblemColor, BorderStyle, BorderColor, BackgroundColor, BankMoney) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_GUILD, "DELETE FROM guild WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32 + PrepareStatement(CHAR_INS_GUILD, "INSERT INTO guild (guildid, name, leaderguid, info, motd, createdate, EmblemStyle, EmblemColor, BorderStyle, BorderColor, BackgroundColor, BankMoney) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GUILD, "DELETE FROM guild WHERE guildid = ?", CONNECTION_ASYNC); // 0: uint32 // 0: uint32, 1: uint32, 2: uint8, 4: string, 5: string - PREPARE_STATEMENT(CHAR_INS_GUILD_MEMBER, "INSERT INTO guild_member (guildid, guid, rank, pnote, offnote) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_GUILD_MEMBER, "DELETE FROM guild_member WHERE guid = ?", CONNECTION_ASYNC) // 0: uint32 - PREPARE_STATEMENT(CHAR_DEL_GUILD_MEMBERS, "DELETE FROM guild_member WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32 + PrepareStatement(CHAR_INS_GUILD_MEMBER, "INSERT INTO guild_member (guildid, guid, rank, pnote, offnote) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GUILD_MEMBER, "DELETE FROM guild_member WHERE guid = ?", CONNECTION_ASYNC); // 0: uint32 + PrepareStatement(CHAR_DEL_GUILD_MEMBERS, "DELETE FROM guild_member WHERE guildid = ?", CONNECTION_ASYNC); // 0: uint32 // 0: uint32, 1: uint8, 3: string, 4: uint32 - PREPARE_STATEMENT(CHAR_INS_GUILD_RANK, "INSERT INTO guild_rank (guildid, rid, rname, rights) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_GUILD_RANKS, "DELETE FROM guild_rank WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32 - PREPARE_STATEMENT(CHAR_DEL_GUILD_LOWEST_RANK, "DELETE FROM guild_rank WHERE guildid = ? AND rid >= ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8 - PREPARE_STATEMENT(CHAR_INS_GUILD_BANK_TAB, "INSERT INTO guild_bank_tab (guildid, TabId) VALUES (?, ?)", CONNECTION_ASYNC) // 0: uint32, 1: uint8 - PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_TAB, "DELETE FROM guild_bank_tab WHERE guildid = ? AND TabId = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8 - PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_TABS, "DELETE FROM guild_bank_tab WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32 + PrepareStatement(CHAR_INS_GUILD_RANK, "INSERT INTO guild_rank (guildid, rid, rname, rights) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GUILD_RANKS, "DELETE FROM guild_rank WHERE guildid = ?", CONNECTION_ASYNC); // 0: uint32 + PrepareStatement(CHAR_DEL_GUILD_LOWEST_RANK, "DELETE FROM guild_rank WHERE guildid = ? AND rid >= ?", CONNECTION_ASYNC); // 0: uint32, 1: uint8 + PrepareStatement(CHAR_INS_GUILD_BANK_TAB, "INSERT INTO guild_bank_tab (guildid, TabId) VALUES (?, ?)", CONNECTION_ASYNC); // 0: uint32, 1: uint8 + PrepareStatement(CHAR_DEL_GUILD_BANK_TAB, "DELETE FROM guild_bank_tab WHERE guildid = ? AND TabId = ?", CONNECTION_ASYNC); // 0: uint32, 1: uint8 + PrepareStatement(CHAR_DEL_GUILD_BANK_TABS, "DELETE FROM guild_bank_tab WHERE guildid = ?", CONNECTION_ASYNC); // 0: uint32 // 0: uint32, 1: uint8, 2: uint8, 3: uint32, 4: uint32 - PREPARE_STATEMENT(CHAR_INS_GUILD_BANK_ITEM, "INSERT INTO guild_bank_item (guildid, TabId, SlotId, item_guid) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_ITEM, "DELETE FROM guild_bank_item WHERE guildid = ? AND TabId = ? AND SlotId = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8, 2: uint8 - PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_ITEMS, "DELETE FROM guild_bank_item WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32 + PrepareStatement(CHAR_INS_GUILD_BANK_ITEM, "INSERT INTO guild_bank_item (guildid, TabId, SlotId, item_guid) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GUILD_BANK_ITEM, "DELETE FROM guild_bank_item WHERE guildid = ? AND TabId = ? AND SlotId = ?", CONNECTION_ASYNC); // 0: uint32, 1: uint8, 2: uint8 + PrepareStatement(CHAR_DEL_GUILD_BANK_ITEMS, "DELETE FROM guild_bank_item WHERE guildid = ?", CONNECTION_ASYNC); // 0: uint32 // 0: uint32, 1: uint8, 2: uint8, 3: uint8, 4: uint32 - PREPARE_STATEMENT(CHAR_INS_GUILD_BANK_RIGHT, "INSERT INTO guild_bank_right (guildid, TabId, rid, gbright, SlotPerDay) VALUES (?, ?, ?, ?, ?) " - "ON DUPLICATE KEY UPDATE gbright = VALUES(gbright), SlotPerDay = VALUES(SlotPerDay)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_RIGHTS, "DELETE FROM guild_bank_right WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32 - PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_RIGHTS_FOR_RANK, "DELETE FROM guild_bank_right WHERE guildid = ? AND rid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8 + PrepareStatement(CHAR_INS_GUILD_BANK_RIGHT, "INSERT INTO guild_bank_right (guildid, TabId, rid, gbright, SlotPerDay) VALUES (?, ?, ?, ?, ?) " + "ON DUPLICATE KEY UPDATE gbright = VALUES(gbright), SlotPerDay = VALUES(SlotPerDay)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GUILD_BANK_RIGHTS, "DELETE FROM guild_bank_right WHERE guildid = ?", CONNECTION_ASYNC); // 0: uint32 + PrepareStatement(CHAR_DEL_GUILD_BANK_RIGHTS_FOR_RANK, "DELETE FROM guild_bank_right WHERE guildid = ? AND rid = ?", CONNECTION_ASYNC); // 0: uint32, 1: uint8 // 0-1: uint32, 2-3: uint8, 4-5: uint32, 6: uint16, 7: uint8, 8: uint64 - PREPARE_STATEMENT(CHAR_INS_GUILD_BANK_EVENTLOG, "INSERT INTO guild_bank_eventlog (guildid, LogGuid, TabId, EventType, PlayerGuid, ItemOrMoney, ItemStackCount, DestTabId, TimeStamp) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_EVENTLOG, "DELETE FROM guild_bank_eventlog WHERE guildid = ? AND LogGuid = ? AND TabId = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint32, 2: uint8 - PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_EVENTLOGS, "DELETE FROM guild_bank_eventlog WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32 + PrepareStatement(CHAR_INS_GUILD_BANK_EVENTLOG, "INSERT INTO guild_bank_eventlog (guildid, LogGuid, TabId, EventType, PlayerGuid, ItemOrMoney, ItemStackCount, DestTabId, TimeStamp) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GUILD_BANK_EVENTLOG, "DELETE FROM guild_bank_eventlog WHERE guildid = ? AND LogGuid = ? AND TabId = ?", CONNECTION_ASYNC); // 0: uint32, 1: uint32, 2: uint8 + PrepareStatement(CHAR_DEL_GUILD_BANK_EVENTLOGS, "DELETE FROM guild_bank_eventlog WHERE guildid = ?", CONNECTION_ASYNC); // 0: uint32 // 0-1: uint32, 2: uint8, 3-4: uint32, 5: uint8, 6: uint64 - PREPARE_STATEMENT(CHAR_INS_GUILD_EVENTLOG, "INSERT INTO guild_eventlog (guildid, LogGuid, EventType, PlayerGuid1, PlayerGuid2, NewRank, TimeStamp) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_GUILD_EVENTLOG, "DELETE FROM guild_eventlog WHERE guildid = ? AND LogGuid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint32 - PREPARE_STATEMENT(CHAR_DEL_GUILD_EVENTLOGS, "DELETE FROM guild_eventlog WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32 - PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_PNOTE, "UPDATE guild_member SET pnote = ? WHERE guid = ?", CONNECTION_ASYNC) // 0: string, 1: uint32 - PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_OFFNOTE, "UPDATE guild_member SET offnote = ? WHERE guid = ?", CONNECTION_ASYNC) // 0: string, 1: uint32 - PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_RANK, "UPDATE guild_member SET rank = ? WHERE guid = ?", CONNECTION_ASYNC) // 0: uint8, 1: uint32 - PREPARE_STATEMENT(CHAR_UPD_GUILD_MOTD, "UPDATE guild SET motd = ? WHERE guildid = ?", CONNECTION_ASYNC) // 0: string, 1: uint32 - PREPARE_STATEMENT(CHAR_UPD_GUILD_INFO, "UPDATE guild SET info = ? WHERE guildid = ?", CONNECTION_ASYNC) // 0: string, 1: uint32 - PREPARE_STATEMENT(CHAR_UPD_GUILD_LEADER, "UPDATE guild SET leaderguid = ? WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint32 - PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_NAME, "UPDATE guild_rank SET rname = ? WHERE rid = ? AND guildid = ?", CONNECTION_ASYNC) // 0: string, 1: uint8, 2: uint32 - PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_RIGHTS, "UPDATE guild_rank SET rights = ? WHERE rid = ? AND guildid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8, 2: uint32 + PrepareStatement(CHAR_INS_GUILD_EVENTLOG, "INSERT INTO guild_eventlog (guildid, LogGuid, EventType, PlayerGuid1, PlayerGuid2, NewRank, TimeStamp) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GUILD_EVENTLOG, "DELETE FROM guild_eventlog WHERE guildid = ? AND LogGuid = ?", CONNECTION_ASYNC); // 0: uint32, 1: uint32 + PrepareStatement(CHAR_DEL_GUILD_EVENTLOGS, "DELETE FROM guild_eventlog WHERE guildid = ?", CONNECTION_ASYNC); // 0: uint32 + PrepareStatement(CHAR_UPD_GUILD_MEMBER_PNOTE, "UPDATE guild_member SET pnote = ? WHERE guid = ?", CONNECTION_ASYNC); // 0: string, 1: uint32 + PrepareStatement(CHAR_UPD_GUILD_MEMBER_OFFNOTE, "UPDATE guild_member SET offnote = ? WHERE guid = ?", CONNECTION_ASYNC); // 0: string, 1: uint32 + PrepareStatement(CHAR_UPD_GUILD_MEMBER_RANK, "UPDATE guild_member SET rank = ? WHERE guid = ?", CONNECTION_ASYNC); // 0: uint8, 1: uint32 + PrepareStatement(CHAR_UPD_GUILD_MOTD, "UPDATE guild SET motd = ? WHERE guildid = ?", CONNECTION_ASYNC); // 0: string, 1: uint32 + PrepareStatement(CHAR_UPD_GUILD_INFO, "UPDATE guild SET info = ? WHERE guildid = ?", CONNECTION_ASYNC); // 0: string, 1: uint32 + PrepareStatement(CHAR_UPD_GUILD_LEADER, "UPDATE guild SET leaderguid = ? WHERE guildid = ?", CONNECTION_ASYNC); // 0: uint32, 1: uint32 + PrepareStatement(CHAR_UPD_GUILD_RANK_NAME, "UPDATE guild_rank SET rname = ? WHERE rid = ? AND guildid = ?", CONNECTION_ASYNC); // 0: string, 1: uint8, 2: uint32 + PrepareStatement(CHAR_UPD_GUILD_RANK_RIGHTS, "UPDATE guild_rank SET rights = ? WHERE rid = ? AND guildid = ?", CONNECTION_ASYNC); // 0: uint32, 1: uint8, 2: uint32 // 0-5: uint32 - PREPARE_STATEMENT(CHAR_UPD_GUILD_EMBLEM_INFO, "UPDATE guild SET EmblemStyle = ?, EmblemColor = ?, BorderStyle = ?, BorderColor = ?, BackgroundColor = ? WHERE guildid = ?", CONNECTION_ASYNC) + PrepareStatement(CHAR_UPD_GUILD_EMBLEM_INFO, "UPDATE guild SET EmblemStyle = ?, EmblemColor = ?, BorderStyle = ?, BorderColor = ?, BackgroundColor = ? WHERE guildid = ?", CONNECTION_ASYNC); // 0: string, 1: string, 2: uint32, 3: uint8 - PREPARE_STATEMENT(CHAR_UPD_GUILD_BANK_TAB_INFO, "UPDATE guild_bank_tab SET TabName = ?, TabIcon = ? WHERE guildid = ? AND TabId = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_GUILD_BANK_MONEY, "UPDATE guild SET BankMoney = ? WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint64, 1: uint32 + PrepareStatement(CHAR_UPD_GUILD_BANK_TAB_INFO, "UPDATE guild_bank_tab SET TabName = ?, TabIcon = ? WHERE guildid = ? AND TabId = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_GUILD_BANK_MONEY, "UPDATE guild SET BankMoney = ? WHERE guildid = ?", CONNECTION_ASYNC); // 0: uint64, 1: uint32 // 0: uint8, 1: uint32, 2: uint8, 3: uint32 - PREPARE_STATEMENT(CHAR_UPD_GUILD_BANK_EVENTLOG_TAB, "UPDATE guild_bank_eventlog SET TabId = ? WHERE guildid = ? AND TabId = ? AND LogGuid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_MONEY, "UPDATE guild_rank SET BankMoneyPerDay = ? WHERE rid = ? AND guildid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8, 2: uint32 - PREPARE_STATEMENT(CHAR_UPD_GUILD_BANK_TAB_TEXT, "UPDATE guild_bank_tab SET TabText = ? WHERE guildid = ? AND TabId = ?", CONNECTION_ASYNC) // 0: string, 1: uint32, 2: uint8 + PrepareStatement(CHAR_UPD_GUILD_BANK_EVENTLOG_TAB, "UPDATE guild_bank_eventlog SET TabId = ? WHERE guildid = ? AND TabId = ? AND LogGuid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_GUILD_RANK_BANK_MONEY, "UPDATE guild_rank SET BankMoneyPerDay = ? WHERE rid = ? AND guildid = ?", CONNECTION_ASYNC); // 0: uint32, 1: uint8, 2: uint32 + PrepareStatement(CHAR_UPD_GUILD_BANK_TAB_TEXT, "UPDATE guild_bank_tab SET TabText = ? WHERE guildid = ? AND TabId = ?", CONNECTION_ASYNC); // 0: string, 1: uint32, 2: uint8 - PREPARE_STATEMENT(CHAR_INS_GUILD_MEMBER_WITHDRAW, - "INSERT INTO guild_member_withdraw (guid, tab0, tab1, tab2, tab3, tab4, tab5, money) VALUES (?, ?, ?, ?, ?, ?, ?, ?) " - "ON DUPLICATE KEY UPDATE tab0 = VALUES (tab0), tab1 = VALUES (tab1), tab2 = VALUES (tab2), tab3 = VALUES (tab3), tab4 = VALUES (tab4), tab5 = VALUES (tab5)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_GUILD_MEMBER_WITHDRAW, "TRUNCATE guild_member_withdraw", CONNECTION_ASYNC) + PrepareStatement(CHAR_INS_GUILD_MEMBER_WITHDRAW, + "INSERT INTO guild_member_withdraw (guid, tab0, tab1, tab2, tab3, tab4, tab5, money) VALUES (?, ?, ?, ?, ?, ?, ?, ?) " + "ON DUPLICATE KEY UPDATE tab0 = VALUES (tab0), tab1 = VALUES (tab1), tab2 = VALUES (tab2), tab3 = VALUES (tab3), tab4 = VALUES (tab4), tab5 = VALUES (tab5)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GUILD_MEMBER_WITHDRAW, "TRUNCATE guild_member_withdraw", CONNECTION_ASYNC); // 0: uint32, 1: uint32, 2: uint32 - PREPARE_STATEMENT(CHAR_SEL_CHAR_DATA_FOR_GUILD, "SELECT name, level, class, zone, account FROM characters WHERE guid = ?", CONNECTION_SYNCH) + PrepareStatement(CHAR_SEL_CHAR_DATA_FOR_GUILD, "SELECT name, level, class, zone, account FROM characters WHERE guid = ?", CONNECTION_SYNCH); // Chat channel handling - PREPARE_STATEMENT(CHAR_SEL_CHANNEL, "SELECT announce, ownership, password, bannedList FROM channels WHERE name = ? AND team = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_INS_CHANNEL, "INSERT INTO channels(name, team, lastUsed) VALUES (?, ?, UNIX_TIMESTAMP())", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_CHANNEL, "UPDATE channels SET announce = ?, ownership = ?, password = ?, bannedList = ?, lastUsed = UNIX_TIMESTAMP() WHERE name = ? AND team = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_CHANNEL_USAGE, "UPDATE channels SET lastUsed = UNIX_TIMESTAMP() WHERE name = ? AND team = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_CHANNEL_OWNERSHIP, "UPDATE channels SET ownership = ? WHERE name LIKE ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_OLD_CHANNELS, "DELETE FROM channels WHERE ownership = 1 AND lastUsed + ? < UNIX_TIMESTAMP()", CONNECTION_ASYNC) + PrepareStatement(CHAR_SEL_CHANNEL, "SELECT announce, ownership, password, bannedList FROM channels WHERE name = ? AND team = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_INS_CHANNEL, "INSERT INTO channels(name, team, lastUsed) VALUES (?, ?, UNIX_TIMESTAMP())", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHANNEL, "UPDATE channels SET announce = ?, ownership = ?, password = ?, bannedList = ?, lastUsed = UNIX_TIMESTAMP() WHERE name = ? AND team = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHANNEL_USAGE, "UPDATE channels SET lastUsed = UNIX_TIMESTAMP() WHERE name = ? AND team = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHANNEL_OWNERSHIP, "UPDATE channels SET ownership = ? WHERE name LIKE ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_OLD_CHANNELS, "DELETE FROM channels WHERE ownership = 1 AND lastUsed + ? < UNIX_TIMESTAMP()", CONNECTION_ASYNC); // Equipmentsets - PREPARE_STATEMENT(CHAR_UPD_EQUIP_SET, "UPDATE character_equipmentsets SET name=?, iconname=?, ignore_mask=?, item0=?, item1=?, item2=?, item3=?, item4=?, item5=?, item6=?, item7=?, item8=?, item9=?, item10=?, item11=?, item12=?, item13=?, item14=?, item15=?, item16=?, item17=?, item18=? WHERE guid=? AND setguid=? AND setindex=?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_INS_EQUIP_SET, "INSERT INTO character_equipmentsets (guid, setguid, setindex, name, iconname, ignore_mask, item0, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_EQUIP_SET, "DELETE FROM character_equipmentsets WHERE setguid=?", CONNECTION_ASYNC) + PrepareStatement(CHAR_UPD_EQUIP_SET, "UPDATE character_equipmentsets SET name=?, iconname=?, ignore_mask=?, item0=?, item1=?, item2=?, item3=?, " + "item4=?, item5=?, item6=?, item7=?, item8=?, item9=?, item10=?, item11=?, item12=?, item13=?, item14=?, item15=?, item16=?, " + "item17=?, item18=? WHERE guid=? AND setguid=? AND setindex=?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_EQUIP_SET, "INSERT INTO character_equipmentsets (guid, setguid, setindex, name, iconname, ignore_mask, item0, item1, item2, item3, " + "item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18) " + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_EQUIP_SET, "DELETE FROM character_equipmentsets WHERE setguid=?", CONNECTION_ASYNC); // Auras - PREPARE_STATEMENT(CHAR_INS_AURA, "INSERT INTO character_aura (guid, caster_guid, item_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) " - "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) + PrepareStatement(CHAR_INS_AURA, "INSERT INTO character_aura (guid, caster_guid, item_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) " + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); // Account data - PREPARE_STATEMENT(CHAR_SEL_ACCOUNT_DATA, "SELECT type, time, data FROM account_data WHERE accountId = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_REP_ACCOUNT_DATA, "REPLACE INTO account_data (accountId, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_ACCOUNT_DATA, "DELETE FROM account_data WHERE accountId = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_PLAYER_ACCOUNT_DATA, "SELECT type, time, data FROM character_account_data WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_REP_PLAYER_ACCOUNT_DATA, "REPLACE INTO character_account_data(guid, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_PLAYER_ACCOUNT_DATA, "DELETE FROM character_account_data WHERE guid = ?", CONNECTION_ASYNC) + PrepareStatement(CHAR_SEL_ACCOUNT_DATA, "SELECT type, time, data FROM account_data WHERE accountId = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_REP_ACCOUNT_DATA, "REPLACE INTO account_data (accountId, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_ACCOUNT_DATA, "DELETE FROM account_data WHERE accountId = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_PLAYER_ACCOUNT_DATA, "SELECT type, time, data FROM character_account_data WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_REP_PLAYER_ACCOUNT_DATA, "REPLACE INTO character_account_data(guid, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_PLAYER_ACCOUNT_DATA, "DELETE FROM character_account_data WHERE guid = ?", CONNECTION_ASYNC); // Tutorials - PREPARE_STATEMENT(CHAR_SEL_TUTORIALS, "SELECT tut0, tut1, tut2, tut3, tut4, tut5, tut6, tut7 FROM account_tutorial WHERE accountId = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_SEL_HAS_TUTORIALS, "SELECT 1 FROM account_tutorial WHERE accountId = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_INS_TUTORIALS, "INSERT INTO account_tutorial(tut0, tut1, tut2, tut3, tut4, tut5, tut6, tut7, accountId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_TUTORIALS, "UPDATE account_tutorial SET tut0 = ?, tut1 = ?, tut2 = ?, tut3 = ?, tut4 = ?, tut5 = ?, tut6 = ?, tut7 = ? WHERE accountId = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_TUTORIALS, "DELETE FROM account_tutorial WHERE accountId = ?", CONNECTION_ASYNC) + PrepareStatement(CHAR_SEL_TUTORIALS, "SELECT tut0, tut1, tut2, tut3, tut4, tut5, tut6, tut7 FROM account_tutorial WHERE accountId = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_HAS_TUTORIALS, "SELECT 1 FROM account_tutorial WHERE accountId = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_INS_TUTORIALS, "INSERT INTO account_tutorial(tut0, tut1, tut2, tut3, tut4, tut5, tut6, tut7, accountId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_TUTORIALS, "UPDATE account_tutorial SET tut0 = ?, tut1 = ?, tut2 = ?, tut3 = ?, tut4 = ?, tut5 = ?, tut6 = ?, tut7 = ? WHERE accountId = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_TUTORIALS, "DELETE FROM account_tutorial WHERE accountId = ?", CONNECTION_ASYNC); // Instance saves - PREPARE_STATEMENT(CHAR_INS_INSTANCE_SAVE, "INSERT INTO instance (id, map, resettime, difficulty, completedEncounters, data) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_INSTANCE_DATA, "UPDATE instance SET completedEncounters=?, data=? WHERE id=?", CONNECTION_ASYNC) + PrepareStatement(CHAR_INS_INSTANCE_SAVE, "INSERT INTO instance (id, map, resettime, difficulty, completedEncounters, data) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_INSTANCE_DATA, "UPDATE instance SET completedEncounters=?, data=? WHERE id=?", CONNECTION_ASYNC); // Game event saves - PREPARE_STATEMENT(CHAR_DEL_GAME_EVENT_SAVE, "DELETE FROM game_event_save WHERE eventEntry = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_INS_GAME_EVENT_SAVE, "INSERT INTO game_event_save (eventEntry, state, next_start) VALUES (?, ?, ?)", CONNECTION_ASYNC) + PrepareStatement(CHAR_DEL_GAME_EVENT_SAVE, "DELETE FROM game_event_save WHERE eventEntry = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_GAME_EVENT_SAVE, "INSERT INTO game_event_save (eventEntry, state, next_start) VALUES (?, ?, ?)", CONNECTION_ASYNC); // Game event condition saves - PREPARE_STATEMENT(CHAR_DEL_ALL_GAME_EVENT_CONDITION_SAVE, "DELETE FROM game_event_condition_save WHERE eventEntry = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_GAME_EVENT_CONDITION_SAVE, "DELETE FROM game_event_condition_save WHERE eventEntry = ? AND condition_id = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_INS_GAME_EVENT_CONDITION_SAVE, "INSERT INTO game_event_condition_save (eventEntry, condition_id, done) VALUES (?, ?, ?)", CONNECTION_ASYNC) + PrepareStatement(CHAR_DEL_ALL_GAME_EVENT_CONDITION_SAVE, "DELETE FROM game_event_condition_save WHERE eventEntry = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GAME_EVENT_CONDITION_SAVE, "DELETE FROM game_event_condition_save WHERE eventEntry = ? AND condition_id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_GAME_EVENT_CONDITION_SAVE, "INSERT INTO game_event_condition_save (eventEntry, condition_id, done) VALUES (?, ?, ?)", CONNECTION_ASYNC); // Petitions - PREPARE_STATEMENT(CHAR_SEL_PETITION, "SELECT ownerguid, name, type FROM petition WHERE petitionguid = ?", CONNECTION_SYNCH); - 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); + PrepareStatement(CHAR_SEL_PETITION, "SELECT ownerguid, name, type FROM petition WHERE petitionguid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_PETITION_SIGNATURE, "SELECT playerguid FROM petition_sign WHERE petitionguid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_DEL_ALL_PETITION_SIGNATURES, "DELETE FROM petition_sign WHERE playerguid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_PETITION_SIGNATURE, "DELETE FROM petition_sign WHERE playerguid = ? AND type = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_PETITION_BY_OWNER, "SELECT petitionguid FROM petition WHERE ownerguid = ? AND type = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_PETITION_TYPE, "SELECT type FROM petition WHERE petitionguid = ?", CONNECTION_SYNCH); + PrepareStatement(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); + PrepareStatement(CHAR_SEL_PETITION_SIG_BY_ACCOUNT, "SELECT playerguid FROM petition_sign WHERE player_account = ? AND petitionguid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_PETITION_OWNER_BY_GUID, "SELECT ownerguid FROM petition WHERE petitionguid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_PETITION_SIG_BY_GUID, "SELECT ownerguid, petitionguid FROM petition_sign WHERE playerguid = ?", CONNECTION_SYNCH); + PrepareStatement(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) - PREPARE_STATEMENT(CHAR_INS_ARENA_TEAM, "INSERT INTO arena_team (arenaTeamId, name, captainGuid, type, rating, backgroundColor, emblemStyle, emblemColor, borderStyle, borderColor) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_ARENA_TEAM_MEMBER, "INSERT INTO arena_team_member (arenaTeamId, guid) VALUES (?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_ARENA_TEAM, "DELETE FROM arena_team where arenaTeamId = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_ARENA_TEAM_MEMBERS, "DELETE FROM arena_team_member WHERE arenaTeamId = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_ARENA_TEAM_CAPTAIN, "UPDATE arena_team SET captainGuid = ? WHERE arenaTeamId = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_ARENA_TEAM_MEMBER, "DELETE FROM arena_team_member WHERE arenaTeamId = ? AND guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_ARENA_TEAM_STATS, "UPDATE arena_team SET rating = ?, weekGames = ?, weekWins = ?, seasonGames = ?, seasonWins = ?, rank = ? WHERE arenaTeamId = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_ARENA_TEAM_MEMBER, "UPDATE arena_team_member SET personalRating = ?, weekGames = ?, weekWins = ?, seasonGames = ?, seasonWins = ? WHERE arenaTeamId = ? AND guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_REP_CHARACTER_ARENA_STATS, "REPLACE INTO character_arena_stats (guid, slot, matchMakerRating) VALUES (?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_SEL_PLAYER_ARENA_TEAMS, "SELECT arena_team_member.arenaTeamId FROM arena_team_member JOIN arena_team ON arena_team_member.arenaTeamId = arena_team.arenaTeamId WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHARACTER_ARENAINFO, "SELECT arenaTeamId, weekGames, seasonGames, seasonWins, personalRating FROM arena_team_member WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_ARENA_TEAM, "INSERT INTO arena_team (arenaTeamId, name, captainGuid, type, rating, backgroundColor, emblemStyle, emblemColor, borderStyle, borderColor) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_ARENA_TEAM_MEMBER, "INSERT INTO arena_team_member (arenaTeamId, guid) VALUES (?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_ARENA_TEAM, "DELETE FROM arena_team where arenaTeamId = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_ARENA_TEAM_MEMBERS, "DELETE FROM arena_team_member WHERE arenaTeamId = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_ARENA_TEAM_CAPTAIN, "UPDATE arena_team SET captainGuid = ? WHERE arenaTeamId = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_ARENA_TEAM_MEMBER, "DELETE FROM arena_team_member WHERE arenaTeamId = ? AND guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_ARENA_TEAM_STATS, "UPDATE arena_team SET rating = ?, weekGames = ?, weekWins = ?, seasonGames = ?, seasonWins = ?, rank = ? WHERE arenaTeamId = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_ARENA_TEAM_MEMBER, "UPDATE arena_team_member SET personalRating = ?, weekGames = ?, weekWins = ?, seasonGames = ?, seasonWins = ? WHERE arenaTeamId = ? AND guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_REP_CHARACTER_ARENA_STATS, "REPLACE INTO character_arena_stats (guid, slot, matchMakerRating) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_PLAYER_ARENA_TEAMS, "SELECT arena_team_member.arenaTeamId FROM arena_team_member JOIN arena_team ON arena_team_member.arenaTeamId = arena_team.arenaTeamId WHERE guid = ?", CONNECTION_SYNCH); // Character battleground data - PREPARE_STATEMENT(CHAR_INS_PLAYER_BGDATA, "INSERT INTO character_battleground_data (guid, instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_PLAYER_BGDATA, "DELETE FROM character_battleground_data WHERE guid = ?", CONNECTION_ASYNC) + PrepareStatement(CHAR_INS_PLAYER_BGDATA, "INSERT INTO character_battleground_data (guid, instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_PLAYER_BGDATA, "DELETE FROM character_battleground_data WHERE guid = ?", CONNECTION_ASYNC); // Character homebind - PREPARE_STATEMENT(CHAR_INS_PLAYER_HOMEBIND, "INSERT INTO character_homebind (guid, mapId, zoneId, posX, posY, posZ) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_PLAYER_HOMEBIND, "UPDATE character_homebind SET mapId = ?, zoneId = ?, posX = ?, posY = ?, posZ = ? WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_PLAYER_HOMEBIND, "DELETE FROM character_homebind WHERE guid = ?", CONNECTION_ASYNC) + PrepareStatement(CHAR_INS_PLAYER_HOMEBIND, "INSERT INTO character_homebind (guid, mapId, zoneId, posX, posY, posZ) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_PLAYER_HOMEBIND, "UPDATE character_homebind SET mapId = ?, zoneId = ?, posX = ?, posY = ?, posZ = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_PLAYER_HOMEBIND, "DELETE FROM character_homebind WHERE guid = ?", CONNECTION_ASYNC); // Corpse - PREPARE_STATEMENT(CHAR_SEL_CORPSES, "SELECT posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, guildId, flags, dynFlags, time, corpseType, instanceId, phaseMask, corpseGuid, guid FROM corpse WHERE corpseType <> 0", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_INS_CORPSE, "INSERT INTO corpse (corpseGuid, guid, posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, guildId, flags, dynFlags, time, corpseType, instanceId, phaseMask) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_CORPSE, "DELETE FROM corpse WHERE corpseGuid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_PLAYER_CORPSES, "DELETE FROM corpse WHERE guid = ? AND corpseType <> 0", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_OLD_CORPSES, "DELETE FROM corpse WHERE corpseType = 0 OR time < (UNIX_TIMESTAMP(NOW()) - ?)", CONNECTION_ASYNC) + PrepareStatement(CHAR_SEL_CORPSES, "SELECT posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, guildId, flags, dynFlags, time, corpseType, instanceId, phaseMask, corpseGuid, guid FROM corpse WHERE corpseType <> 0", CONNECTION_SYNCH); + PrepareStatement(CHAR_INS_CORPSE, "INSERT INTO corpse (corpseGuid, guid, posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, guildId, flags, dynFlags, time, corpseType, instanceId, phaseMask) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CORPSE, "DELETE FROM corpse WHERE corpseGuid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_PLAYER_CORPSES, "DELETE FROM corpse WHERE guid = ? AND corpseType <> 0", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_OLD_CORPSES, "DELETE FROM corpse WHERE corpseType = 0 OR time < (UNIX_TIMESTAMP(NOW()) - ?)", CONNECTION_ASYNC); // Creature respawn - PREPARE_STATEMENT(CHAR_SEL_CREATURE_RESPAWNS, "SELECT guid, respawnTime FROM creature_respawn WHERE mapId = ? AND instanceId = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_REP_CREATURE_RESPAWN, "REPLACE INTO creature_respawn (guid, respawnTime, mapId, instanceId) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_CREATURE_RESPAWN, "DELETE FROM creature_respawn WHERE guid = ? AND mapId = ? AND instanceId = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE, "DELETE FROM creature_respawn WHERE mapId = ? AND instanceId = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_MAX_CREATURE_RESPAWNS, "SELECT MAX(respawnTime), instanceId FROM creature_respawn WHERE instanceId > 0 GROUP BY instanceId", CONNECTION_SYNCH) + PrepareStatement(CHAR_SEL_CREATURE_RESPAWNS, "SELECT guid, respawnTime FROM creature_respawn WHERE mapId = ? AND instanceId = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_REP_CREATURE_RESPAWN, "REPLACE INTO creature_respawn (guid, respawnTime, mapId, instanceId) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CREATURE_RESPAWN, "DELETE FROM creature_respawn WHERE guid = ? AND mapId = ? AND instanceId = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE, "DELETE FROM creature_respawn WHERE mapId = ? AND instanceId = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_MAX_CREATURE_RESPAWNS, "SELECT MAX(respawnTime), instanceId FROM creature_respawn WHERE instanceId > 0 GROUP BY instanceId", CONNECTION_SYNCH); // Gameobject respawn - PREPARE_STATEMENT(CHAR_SEL_GO_RESPAWNS, "SELECT guid, respawnTime FROM gameobject_respawn WHERE mapId = ? AND instanceId = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_REP_GO_RESPAWN, "REPLACE INTO gameobject_respawn (guid, respawnTime, mapId, instanceId) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_GO_RESPAWN, "DELETE FROM gameobject_respawn WHERE guid = ? AND mapId = ? AND instanceId = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_GO_RESPAWN_BY_INSTANCE, "DELETE FROM gameobject_respawn WHERE mapId = ? AND instanceId = ?", CONNECTION_ASYNC) + PrepareStatement(CHAR_SEL_GO_RESPAWNS, "SELECT guid, respawnTime FROM gameobject_respawn WHERE mapId = ? AND instanceId = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_REP_GO_RESPAWN, "REPLACE INTO gameobject_respawn (guid, respawnTime, mapId, instanceId) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GO_RESPAWN, "DELETE FROM gameobject_respawn WHERE guid = ? AND mapId = ? AND instanceId = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GO_RESPAWN_BY_INSTANCE, "DELETE FROM gameobject_respawn WHERE mapId = ? AND instanceId = ?", CONNECTION_ASYNC); // GM Tickets - PREPARE_STATEMENT(CHAR_SEL_GM_TICKETS, "SELECT ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, response, completed, escalated, viewed, haveTicket FROM gm_tickets", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_REP_GM_TICKET, "REPLACE INTO gm_tickets (ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, response, completed, escalated, viewed, haveTicket) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_GM_TICKET, "DELETE FROM gm_tickets WHERE ticketId = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_PLAYER_GM_TICKETS, "DELETE FROM gm_tickets WHERE guid = ?", CONNECTION_ASYNC) + PrepareStatement(CHAR_SEL_GM_TICKETS, "SELECT ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, response, completed, escalated, viewed, haveTicket FROM gm_tickets", CONNECTION_SYNCH); + PrepareStatement(CHAR_REP_GM_TICKET, "REPLACE INTO gm_tickets (ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, response, completed, escalated, viewed, haveTicket) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GM_TICKET, "DELETE FROM gm_tickets WHERE ticketId = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_PLAYER_GM_TICKETS, "DELETE FROM gm_tickets WHERE guid = ?", CONNECTION_ASYNC); // GM Survey/subsurvey/lag report - PREPARE_STATEMENT(CHAR_INS_GM_SURVEY, "INSERT INTO gm_surveys (guid, surveyId, mainSurvey, overallComment, createTime) VALUES (?, ?, ?, ?, UNIX_TIMESTAMP(NOW()))", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_INS_GM_SUBSURVEY, "INSERT INTO gm_subsurveys (surveyId, subsurveyId, rank, comment) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_INS_LAG_REPORT, "INSERT INTO lag_reports (guid, lagType, mapId, posX, posY, posZ, latency, createTime) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) + PrepareStatement(CHAR_INS_GM_SURVEY, "INSERT INTO gm_surveys (guid, surveyId, mainSurvey, overallComment, createTime) VALUES (?, ?, ?, ?, UNIX_TIMESTAMP(NOW()))", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_GM_SUBSURVEY, "INSERT INTO gm_subsurveys (surveyId, subsurveyId, rank, comment) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_LAG_REPORT, "INSERT INTO lag_reports (guid, lagType, mapId, posX, posY, posZ, latency, createTime) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); // For loading and deleting expired auctions at startup - PREPARE_STATEMENT(CHAR_SEL_EXPIRED_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, count, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE ah.time <= ?", CONNECTION_SYNCH) + PrepareStatement(CHAR_SEL_EXPIRED_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, count, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE ah.time <= ?", CONNECTION_SYNCH); // LFG Data - PREPARE_STATEMENT(CHAR_INS_LFG_DATA, "INSERT INTO lfg_data (guid, dungeon, state) VALUES (?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_LFG_DATA, "DELETE FROM lfg_data WHERE guid = ?", CONNECTION_ASYNC) + PrepareStatement(CHAR_INS_LFG_DATA, "INSERT INTO lfg_data (guid, dungeon, state) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_LFG_DATA, "DELETE FROM lfg_data WHERE guid = ?", CONNECTION_ASYNC); // Player saving - PREPARE_STATEMENT(CHAR_INS_CHARACTER, "INSERT INTO characters (guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, " - "map, instance_id, instance_mode_mask, position_x, position_y, position_z, orientation, " - "taximask, cinematic, " - "totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, resettalents_time, " - "extra_flags, stable_slots, at_login, zone, " - "death_expire_time, taxi_path, arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, " - "todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, health, power1, power2, power3, " - "power4, power5, power6, power7, latency, speccount, activespec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars, grantableLevels) VALUES " - "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_CHARACTER, "UPDATE characters SET name=?,race=?,class=?,gender=?,level=?,xp=?,money=?,playerBytes=?,playerBytes2=?,playerFlags=?," - "map=?,instance_id=?,instance_mode_mask=?,position_x=?,position_y=?,position_z=?,orientation=?,taximask=?,cinematic=?,totaltime=?,leveltime=?,rest_bonus=?," - "logout_time=?,is_logout_resting=?,resettalents_cost=?,resettalents_time=?,extra_flags=?,stable_slots=?,at_login=?,zone=?,death_expire_time=?,taxi_path=?," - "arenaPoints=?,totalHonorPoints=?,todayHonorPoints=?,yesterdayHonorPoints=?,totalKills=?,todayKills=?,yesterdayKills=?,chosenTitle=?,knownCurrencies=?," - "watchedFaction=?,drunk=?,health=?,power1=?,power2=?,power3=?,power4=?,power5=?,power6=?,power7=?,latency=?,speccount=?,activespec=?,exploredZones=?," - "equipmentCache=?,ammoId=?,knownTitles=?,actionBars=?,grantableLevels=?,online=? WHERE guid=?", CONNECTION_ASYNC); - - PREPARE_STATEMENT(CHAR_UPD_ADD_AT_LOGIN_FLAG, "UPDATE characters SET at_login = at_login | ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_REM_AT_LOGIN_FLAG, "UPDATE characters set at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_ALL_AT_LOGIN_FLAGS, "UPDATE characters SET at_login = at_login | ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_BUG_REPORT, "INSERT INTO bugreport (type, content) VALUES(?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_PETITION_NAME, "UPDATE petition SET name = ? WHERE petitionguid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_PETITION_SIGNATURE, "INSERT INTO petition_sign (ownerguid, petitionguid, playerguid, player_account) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_ACCOUNT_ONLINE, "UPDATE characters SET online = 0 WHERE account = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_GROUP, "INSERT INTO groups (guid, leaderGuid, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, groupType, difficulty, raiddifficulty) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_GROUP_MEMBER, "INSERT INTO group_member (guid, memberGuid, memberFlags, subgroup, roles) VALUES(?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_GROUP_MEMBER, "DELETE FROM group_member WHERE memberGuid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_GROUP_INSTANCE_PERM_BINDING, "DELETE FROM group_instance WHERE guid = ? AND (permanent = 1 OR instance IN (SELECT instance FROM character_instance WHERE guid = ?))", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_GROUP_LEADER, "UPDATE groups SET leaderGuid = ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_GROUP_TYPE, "UPDATE groups SET groupType = ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_GROUP_MEMBER_SUBGROUP, "UPDATE group_member SET subgroup = ? WHERE memberGuid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_GROUP_MEMBER_FLAG, "UPDATE group_member SET memberFlags = ? WHERE memberGuid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_GROUP_DIFFICULTY, "UPDATE groups SET difficulty = ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_GROUP_RAID_DIFFICULTY, "UPDATE groups SET raiddifficulty = ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_ALL_GM_TICKETS, "TRUNCATE TABLE gm_tickets", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_INVALID_SPELL, "DELETE FROM character_talent WHERE spell = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_DELETE_INFO, "UPDATE characters SET deleteInfos_Name = name, deleteInfos_Account = account, deleteDate = UNIX_TIMESTAMP(), name = '', account = 0 WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UDP_RESTORE_DELETE_INFO, "UPDATE characters SET name = ?, account = ?, deleteDate = NULL, deleteInfos_Name = NULL, deleteInfos_Account = NULL WHERE deleteDate IS NOT NULL AND guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_ZONE, "UPDATE characters SET zone = ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_LEVEL, "UPDATE characters SET level = ?, xp = 0 WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA, "DELETE FROM character_achievement_progress WHERE criteria = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_INVALID_ACHIEVMENT, "DELETE FROM character_achievement WHERE achievement = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_ADDON, "INSERT INTO addons (name, crc) VALUES (?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_INVALID_PET_SPELL, "DELETE FROM pet_spell WHERE spell = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_GROUP_INSTANCE_BY_INSTANCE, "DELETE FROM group_instance WHERE instance = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_GROUP_INSTANCE_BY_GUID, "DELETE FROM group_instance WHERE guid = ? AND instance = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_REP_GROUP_INSTANCE, "REPLACE INTO group_instance (guid, instance, permanent) VALUES (?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_INSTANCE_RESETTIME, "UPDATE instance SET resettime = ? WHERE id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_GLOBAL_INSTANCE_RESETTIME, "UPDATE instance_reset SET resettime = ? WHERE mapid = ? AND difficulty = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_CHAR_ONLINE, "UPDATE characters SET online = 1 WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_CHAR_NAME_AT_LOGIN, "UPDATE characters set name = ?, at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_WORLDSTATE, "UPDATE worldstates SET value = ? WHERE entry = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_WORLDSTATE, "INSERT INTO worldstates (entry, value) VALUES (?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID, "DELETE FROM character_instance WHERE guid = ? AND instance = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_CHAR_INSTANCE, "UPDATE character_instance SET instance = ?, permanent = ? WHERE guid = ? AND instance = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_CHAR_INSTANCE, "INSERT INTO character_instance (guid, instance, permanent) VALUES (?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_GENDER_PLAYERBYTES, "UPDATE characters SET gender = ?, playerBytes = ?, playerBytes2 = ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHARACTER_SKILL, "DELETE FROM character_skills WHERE guid = ? AND skill = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_ADD_CHARACTER_SOCIAL_FLAGS, "UPDATE character_social SET flags = flags | ? WHERE guid = ? AND friend = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_REM_CHARACTER_SOCIAL_FLAGS, "UPDATE character_social SET flags = flags & ~ ? WHERE guid = ? AND friend = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_CHARACTER_SOCIAL, "INSERT INTO character_social (guid, friend, flags) VALUES (?, ?, ?)", CONNECTION_ASYNC); - 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, knownTitles FROM characters WHERE guid = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_AT_LOGIN_TITLES, "SELECT at_login, knownTitles FROM characters WHERE guid = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_INSTANCE, "SELECT data, completedEncounters FROM instance WHERE map = ? AND id = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_PET_SPELL_LIST, "SELECT DISTINCT pet_spell.spell FROM pet_spell, character_pet WHERE character_pet.owner = ? AND character_pet.id = pet_spell.guid AND character_pet.id <> ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_PET, "SELECT id FROM character_pet WHERE owner = ? AND id <> ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_PETS, "SELECT id FROM character_pet WHERE owner = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_COD_ITEM_MAIL, "SELECT id, messageType, mailTemplateId, sender, subject, body, money, has_items FROM mail WHERE receiver = ? AND has_items <> 0 AND cod <> 0", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_SOCIAL, "SELECT DISTINCT guid FROM character_social WHERE friend = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_PET_AURA, "SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges FROM pet_aura WHERE guid = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_OLD_CHARS, "SELECT guid, deleteInfos_Account FROM characters WHERE deleteDate IS NOT NULL AND deleteDate < ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID, "SELECT arena_team_member.arenateamid FROM arena_team_member JOIN arena_team ON arena_team_member.arenateamid = arena_team.arenateamid WHERE guid = ? AND type = ? LIMIT 1", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_MAIL, "SELECT id, messageType, sender, receiver, subject, body, has_items, expire_time, deliver_time, money, cod, checked, stationery, mailTemplateId FROM mail WHERE receiver = ? ORDER BY id DESC", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_PLAYERBYTES2, "SELECT playerBytes2 FROM characters WHERE guid = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_PET_SPELL, "SELECT spell, active FROM pet_spell WHERE guid = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_PET_SPELL_COOLDOWN, "SELECT spell, time FROM pet_spell_cooldown WHERE guid = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_PET_DECLINED_NAME, "SELECT genitive, dative, accusative, instrumental, prepositional FROM character_pet_declinedname WHERE owner = ? AND id = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_GUID_BY_NAME, "SELECT guid FROM characters WHERE name = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_DEL_CHAR_AURA_FROZEN, "DELETE FROM character_aura WHERE spell = 9454 AND guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM, "SELECT COUNT(itemEntry) FROM character_inventory ci INNER JOIN item_instance ii ON ii.guid = ci.item WHERE itemEntry = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_MAIL_COUNT_ITEM, "SELECT COUNT(itemEntry) FROM mail_items mi INNER JOIN item_instance ii ON ii.guid = mi.item_guid WHERE itemEntry = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_AUCTIONHOUSE_COUNT_ITEM,"SELECT COUNT(itemEntry) FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE itemEntry = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_GUILD_BANK_COUNT_ITEM, "SELECT COUNT(itemEntry) FROM guild_bank_item gbi INNER JOIN item_instance ii ON ii.guid = gbi.item_guid WHERE itemEntry = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY, "SELECT ci.item, cb.slot AS bag, ci.slot, ci.guid, c.account, c.name FROM characters c INNER JOIN character_inventory ci ON ci.guid = c.guid INNER JOIN item_instance ii ON ii.guid = ci.item LEFT JOIN character_inventory cb ON cb.item = ci.bag WHERE ii.itemEntry = ? LIMIT ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_MAIL_ITEMS_BY_ENTRY, "SELECT mi.item_guid, m.sender, m.receiver, cs.account, cs.name, cr.account, cr.name FROM mail m INNER JOIN mail_items mi ON mi.mail_id = m.id INNER JOIN item_instance ii ON ii.guid = mi.item_guid INNER JOIN characters cs ON cs.guid = m.sender INNER JOIN characters cr ON cr.guid = m.receiver WHERE ii.itemEntry = ? LIMIT ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY, "SELECT ah.itemguid, ah.itemowner, c.account, c.name FROM auctionhouse ah INNER JOIN characters c ON c.guid = ah.itemowner INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE ii.itemEntry = ? LIMIT ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY, "SELECT gi.item_guid, gi.guildid, g.name FROM guild_bank_item gi INNER JOIN guild g ON g.guildid = gi.guildid INNER JOIN item_instance ii ON ii.guid = gi.item_guid WHERE ii.itemEntry = ? LIMIT ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND id = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT_2, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND entry = ? AND (slot = ? OR slot > ?)", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND (slot = ? OR slot > ?) ", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_DEL_CHAR_ACHIEVEMENT, "DELETE FROM character_achievement WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS, "DELETE FROM character_achievement_progress WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_REPUTATION_BY_FACTION, "DELETE FROM character_reputation WHERE guid = ? AND faction = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_CHAR_REPUTATION_BY_FACTION, "INSERT INTO character_reputation (guid, faction, standing, flags) VALUES (?, ?, ? , ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_CHAR_ARENA_POINTS, "UPDATE characters SET arenaPoints = (arenaPoints + ?) WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_ITEM_REFUND_INSTANCE, "DELETE FROM item_refund_instance WHERE item_guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_ITEM_REFUND_INSTANCE, "INSERT INTO item_refund_instance (item_guid, player_guid, paidMoney, paidExtendedCost) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_GROUP, "DELETE FROM groups WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_GROUP_MEMBER_ALL, "DELETE FROM group_member WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_CHAR_GIFT, "INSERT INTO character_gifts (guid, item_guid, entry, flags) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_INSTANCE_BY_INSTANCE, "DELETE FROM instance WHERE id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE, "DELETE FROM character_instance WHERE instance = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_INSTANCE_BY_MAP_DIFF, "DELETE FROM character_instance USING character_instance LEFT JOIN instance ON character_instance.instance = id WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_GROUP_INSTANCE_BY_MAP_DIFF, "DELETE FROM group_instance USING group_instance LEFT JOIN instance ON group_instance.instance = id WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_INSTANCE_BY_MAP_DIFF, "DELETE FROM instance WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_MAIL_ITEM_BY_ID, "DELETE FROM mail_items WHERE mail_id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_PET_DECLINEDNAME, "DELETE FROM character_pet_declinedname WHERE id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_ADD_CHAR_PET_DECLINEDNAME, "INSERT INTO character_pet_declinedname (id, owner, genitive, dative, accusative, instrumental, prepositional) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_CHAR_PET_NAME, "UPDATE character_pet SET name = ?, renamed = 1 WHERE owner = ? AND id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_PETITION, "INSERT INTO petition (ownerguid, petitionguid, name, type) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_PETITION_BY_GUID, "DELETE FROM petition WHERE petitionguid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE_BY_GUID, "DELETE FROM petition_sign WHERE petitionguid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UDP_CHAR_PET_SLOT_BY_SLOT_EXCLUDE_ID, "UPDATE character_pet SET slot = ? WHERE owner = ? AND slot = ? AND id <> ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UDP_CHAR_PET_SLOT_BY_SLOT, "UPDATE character_pet SET slot = ? WHERE owner = ? AND slot = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_CHAR_PET_SLOT_BY_ID, "UPDATE character_pet SET slot = ? WHERE owner = ? AND id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_PET_BY_ID, "DELETE FROM character_pet WHERE id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_PET_BY_SLOT, "DELETE FROM character_pet WHERE owner = ? AND (slot = ? OR slot > ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_PET_AURAS, "DELETE FROM pet_aura WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_PET_SPELLS, "DELETE FROM pet_spell WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_PET_SPELL_COOLDOWNS, "DELETE FROM pet_spell_cooldown WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_PET_SPELL_COOLDOWN, "INSERT INTO pet_spell_cooldown (guid, spell, time) VALUES (?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_PET_SPELL_BY_SPELL, "DELETE FROM pet_spell WHERE guid = ? and spell = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_PET_SPELL, "INSERT INTO pet_spell (guid, spell, active) VALUES (?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_PET_AURA, "INSERT INTO pet_aura (guid, caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_DECLINED_NAME, "DELETE FROM character_declinedname WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_CHAR_DECLINED_NAME, "INSERT INTO character_declinedname (guid, genitive, dative, accusative, instrumental, prepositional) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_FACTION_OR_RACE, "UPDATE characters SET name = ?, race = ?, at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_SKILL_LANGUAGES, "DELETE FROM character_skills WHERE skill IN (98, 113, 759, 111, 313, 109, 115, 315, 673, 137) AND guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_CHAR_SKILL_LANGUAGE, "INSERT INTO `character_skills` (guid, skill, value, max) VALUES (?, ?, 300, 300)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_CHAR_TAXI_PATH, "UPDATE characters SET taxi_path = '' WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_CHAR_TAXIMASK, "UPDATE characters SET taximask = ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS, "DELETE FROM character_queststatus WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_SOCIAL_BY_GUID, "DELETE FROM character_social WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_SOCIAL_BY_FRIEND, "DELETE FROM character_social WHERE friend = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT, "DELETE FROM character_achievement WHERE achievement = ? AND guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_CHAR_ACHIEVEMENT, "UPDATE character_achievement SET achievement = ? where achievement = ? AND guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_CHAR_INVENTORY_FACTION_CHANGE, "UPDATE item_instance ii, character_inventory ci SET ii.itemEntry = ? WHERE ii.itemEntry = ? AND ci.guid = ? AND ci.item = ii.guid", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_SPELL_BY_SPELL, "DELETE FROM character_spell WHERE spell = ? AND guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_CHAR_SPELL_FACTION_CHANGE, "UPDATE character_spell SET spell = ? where spell = ? AND guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_SEL_CHAR_REP_BY_FACTION, "SELECT standing FROM character_reputation WHERE faction = ? AND guid = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_DEL_CHAR_REP_BY_FACTION, "DELETE FROM character_reputation WHERE faction = ? AND guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_CHAR_REP_FACTION_CHANGE, "UPDATE character_reputation SET faction = ?, standing = ? WHERE faction = ? AND guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_CHAR_TITLES_FACTION_CHANGE, "UPDATE characters SET knownTitles = ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_RES_CHAR_TITLES_FACTION_CHANGE, "UPDATE characters SET chosenTitle = 0 WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_SPELL_COOLDOWN, "DELETE FROM character_spell_cooldown WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHARACTER, "DELETE FROM characters WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION, "DELETE FROM character_action WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_AURA, "DELETE FROM character_aura WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_GIFT, "DELETE FROM character_gifts WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_INSTANCE, "DELETE FROM character_instance WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_INVENTORY, "DELETE FROM character_inventory WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS_REWARDED, "DELETE FROM character_queststatus_rewarded WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_REPUTATION, "DELETE FROM character_reputation WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_SPELL, "DELETE FROM character_spell WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_MAIL, "DELETE FROM mail WHERE receiver = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_MAIL_ITEMS, "DELETE FROM mail_items WHERE receiver = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_PET_BY_OWNER, "DELETE FROM character_pet WHERE owner = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_PET_DECLINEDNAME_BY_OWNER, "DELETE FROM character_pet_declinedname WHERE owner = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_ACHIEVEMENTS, "DELETE FROM character_achievement WHERE guid = ? AND achievement NOT BETWEEN '456' AND '467' AND achievement NOT BETWEEN '1400' AND '1427' AND achievement NOT IN(1463, 3117, 3259)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_EQUIPMENTSETS, "DELETE FROM character_equipmentsets WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_GUILD_EVENTLOG_BY_PLAYER, "DELETE FROM guild_eventlog WHERE PlayerGuid1 = ? OR PlayerGuid2 = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_EVENTLOG_BY_PLAYER, "DELETE FROM guild_bank_eventlog WHERE PlayerGuid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_GLYPHS, "DELETE FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS_DAILY, "DELETE FROM character_queststatus_daily WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_TALENT, "DELETE FROM character_talent WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_SKILLS, "DELETE FROM character_skills WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UDP_CHAR_HONOR_POINTS, "UPDATE characters SET totalHonorPoints = ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UDP_CHAR_ARENA_POINTS, "UPDATE characters SET arenaPoints = ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UDP_CHAR_MONEY, "UPDATE characters SET money = ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_CHAR_ACTION, "INSERT INTO character_action (guid, spec, button, action, type) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_CHAR_ACTION, "UPDATE character_action SET action = ?, type = ? WHERE guid = ? AND button = ? AND spec = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION_BY_BUTTON_SPEC, "DELETE FROM character_action WHERE guid = ? and button = ? and spec = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_INVENTORY_BY_ITEM, "DELETE FROM character_inventory WHERE item = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_INVENTORY_BY_BAG_SLOT, "DELETE FROM character_inventory WHERE bag = ? AND slot = ? AND guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_MAIL, "UPDATE mail SET has_items = ?, expire_time = ?, deliver_time = ?, money = ?, cod = ?, checked = ? WHERE id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_REP_CHAR_QUESTSTATUS, "REPLACE INTO character_queststatus (guid, quest, status, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, itemcount1, itemcount2, itemcount3, itemcount4, playercount) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS_BY_QUEST, "DELETE FROM character_queststatus WHERE guid = ? AND quest = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_CHAR_QUESTSTATUS, "INSERT IGNORE INTO character_queststatus_rewarded (guid, quest) VALUES (?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS_REWARDED_BY_QUEST, "DELETE FROM character_queststatus_rewarded WHERE guid = ? AND quest = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_SKILL_BY_SKILL, "DELETE FROM character_skills WHERE guid = ? AND skill = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_CHAR_SKILLS, "INSERT INTO character_skills (guid, skill, value, max) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UDP_CHAR_SKILLS, "UPDATE character_skills SET value = ?, max = ? WHERE guid = ? AND skill = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_CHAR_SPELL, "INSERT INTO character_spell (guid, spell, active, disabled) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_STATS, "DELETE FROM character_stats WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_CHAR_STATS, "INSERT INTO character_stats (guid, maxhealth, maxpower1, maxpower2, maxpower3, maxpower4, maxpower5, maxpower6, maxpower7, strength, agility, stamina, intellect, spirit, armor, resHoly, resFire, resNature, resFrost, resShadow, resArcane, blockPct, dodgePct, parryPct, critPct, rangedCritPct, spellCritPct, attackPower, rangedAttackPower, spellPower, resilience) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_PETITION_BY_OWNER, "DELETE FROM petition WHERE ownerguid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER, "DELETE FROM petition_sign WHERE ownerguid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_PETITION_BY_OWNER_AND_TYPE, "DELETE FROM petition WHERE ownerguid = ? AND type = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER_AND_TYPE, "DELETE FROM petition_sign WHERE ownerguid = ? AND type = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_CHAR_GLYPHS, "INSERT INTO character_glyphs VALUES(?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_TALENT_BY_SPELL_SPEC, "DELETE FROM character_talent WHERE guid = ? and spell = ? and spec = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_CHAR_TALENT, "INSERT INTO character_talent (guid, spell, spec) VALUES (?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, "DELETE FROM character_action WHERE spec<>? AND guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND slot = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_INS_CHARACTER, "INSERT INTO characters (guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, " + "map, instance_id, instance_mode_mask, position_x, position_y, position_z, orientation, " + "taximask, cinematic, " + "totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, resettalents_time, " + "extra_flags, stable_slots, at_login, zone, " + "death_expire_time, taxi_path, arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, " + "todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, health, power1, power2, power3, " + "power4, power5, power6, power7, latency, speccount, activespec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars, grantableLevels) VALUES " + "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHARACTER, "UPDATE characters SET name=?,race=?,class=?,gender=?,level=?,xp=?,money=?,playerBytes=?,playerBytes2=?,playerFlags=?," + "map=?,instance_id=?,instance_mode_mask=?,position_x=?,position_y=?,position_z=?,orientation=?,taximask=?,cinematic=?,totaltime=?,leveltime=?,rest_bonus=?," + "logout_time=?,is_logout_resting=?,resettalents_cost=?,resettalents_time=?,extra_flags=?,stable_slots=?,at_login=?,zone=?,death_expire_time=?,taxi_path=?," + "arenaPoints=?,totalHonorPoints=?,todayHonorPoints=?,yesterdayHonorPoints=?,totalKills=?,todayKills=?,yesterdayKills=?,chosenTitle=?,knownCurrencies=?," + "watchedFaction=?,drunk=?,health=?,power1=?,power2=?,power3=?,power4=?,power5=?,power6=?,power7=?,latency=?,speccount=?,activespec=?,exploredZones=?," + "equipmentCache=?,ammoId=?,knownTitles=?,actionBars=?,grantableLevels=?,online=? WHERE guid=?", CONNECTION_ASYNC); + + PrepareStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG, "UPDATE characters SET at_login = at_login | ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_REM_AT_LOGIN_FLAG, "UPDATE characters set at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_ALL_AT_LOGIN_FLAGS, "UPDATE characters SET at_login = at_login | ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_BUG_REPORT, "INSERT INTO bugreport (type, content) VALUES(?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_PETITION_NAME, "UPDATE petition SET name = ? WHERE petitionguid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_PETITION_SIGNATURE, "INSERT INTO petition_sign (ownerguid, petitionguid, playerguid, player_account) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_ACCOUNT_ONLINE, "UPDATE characters SET online = 0 WHERE account = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_GROUP, "INSERT INTO groups (guid, leaderGuid, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, groupType, difficulty, raiddifficulty) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_GROUP_MEMBER, "INSERT INTO group_member (guid, memberGuid, memberFlags, subgroup, roles) VALUES(?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GROUP_MEMBER, "DELETE FROM group_member WHERE memberGuid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GROUP_INSTANCE_PERM_BINDING, "DELETE FROM group_instance WHERE guid = ? AND (permanent = 1 OR instance IN (SELECT instance FROM character_instance WHERE guid = ?))", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_GROUP_LEADER, "UPDATE groups SET leaderGuid = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_GROUP_TYPE, "UPDATE groups SET groupType = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP, "UPDATE group_member SET subgroup = ? WHERE memberGuid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_GROUP_MEMBER_FLAG, "UPDATE group_member SET memberFlags = ? WHERE memberGuid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_GROUP_DIFFICULTY, "UPDATE groups SET difficulty = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_GROUP_RAID_DIFFICULTY, "UPDATE groups SET raiddifficulty = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_ALL_GM_TICKETS, "TRUNCATE TABLE gm_tickets", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_INVALID_SPELL, "DELETE FROM character_talent WHERE spell = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_DELETE_INFO, "UPDATE characters SET deleteInfos_Name = name, deleteInfos_Account = account, deleteDate = UNIX_TIMESTAMP(), name = '', account = 0 WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UDP_RESTORE_DELETE_INFO, "UPDATE characters SET name = ?, account = ?, deleteDate = NULL, deleteInfos_Name = NULL, deleteInfos_Account = NULL WHERE deleteDate IS NOT NULL AND guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_ZONE, "UPDATE characters SET zone = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_LEVEL, "UPDATE characters SET level = ?, xp = 0 WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA, "DELETE FROM character_achievement_progress WHERE criteria = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_INVALID_ACHIEVMENT, "DELETE FROM character_achievement WHERE achievement = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_ADDON, "INSERT INTO addons (name, crc) VALUES (?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_INVALID_PET_SPELL, "DELETE FROM pet_spell WHERE spell = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GROUP_INSTANCE_BY_INSTANCE, "DELETE FROM group_instance WHERE instance = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GROUP_INSTANCE_BY_GUID, "DELETE FROM group_instance WHERE guid = ? AND instance = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_REP_GROUP_INSTANCE, "REPLACE INTO group_instance (guid, instance, permanent) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_INSTANCE_RESETTIME, "UPDATE instance SET resettime = ? WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_GLOBAL_INSTANCE_RESETTIME, "UPDATE instance_reset SET resettime = ? WHERE mapid = ? AND difficulty = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHAR_ONLINE, "UPDATE characters SET online = 1 WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHAR_NAME_AT_LOGIN, "UPDATE characters set name = ?, at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_WORLDSTATE, "UPDATE worldstates SET value = ? WHERE entry = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_WORLDSTATE, "INSERT INTO worldstates (entry, value) VALUES (?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID, "DELETE FROM character_instance WHERE guid = ? AND instance = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHAR_INSTANCE, "UPDATE character_instance SET instance = ?, permanent = ? WHERE guid = ? AND instance = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHAR_INSTANCE, "INSERT INTO character_instance (guid, instance, permanent) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_GENDER_PLAYERBYTES, "UPDATE characters SET gender = ?, playerBytes = ?, playerBytes2 = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHARACTER_SKILL, "DELETE FROM character_skills WHERE guid = ? AND skill = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_ADD_CHARACTER_SOCIAL_FLAGS, "UPDATE character_social SET flags = flags | ? WHERE guid = ? AND friend = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_REM_CHARACTER_SOCIAL_FLAGS, "UPDATE character_social SET flags = flags & ~ ? WHERE guid = ? AND friend = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHARACTER_SOCIAL, "INSERT INTO character_social (guid, friend, flags) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHARACTER_SOCIAL, "DELETE FROM character_social WHERE guid = ? AND friend = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHARACTER_SOCIAL_NOTE, "UPDATE character_social SET note = ? WHERE guid = ? AND friend = ?", CONNECTION_ASYNC); + PrepareStatement(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); + PrepareStatement(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); + PrepareStatement(CHAR_SEL_CHARACTER_ONLINE, "SELECT name, account, map, zone FROM characters WHERE online > 0", CONNECTION_SYNCH); + PrepareStatement(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); + PrepareStatement(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); + PrepareStatement(CHAR_SEL_CHAR_DEL_INFO, "SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHARS_BY_ACCOUNT_ID, "SELECT guid FROM characters WHERE account = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHAR_PINFO, "SELECT totaltime, level, money, account, race, class, map, zone FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(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); + PrepareStatement(CHAR_SEL_CHAR_HOMEBIND, "SELECT mapId, zoneId, posX, posY, posZ FROM character_homebind WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHAR_GUID_NAME_BY_ACC, "SELECT guid, name FROM characters WHERE account = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_POOL_QUEST_SAVE, "SELECT quest_id FROM pool_quest_save WHERE pool_id = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHARACTER_AT_LOGIN, "SELECT at_login FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHAR_CLASS_LVL_AT_LOGIN, "SELECT class, level, at_login, knownTitles FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHAR_AT_LOGIN_TITLES, "SELECT at_login, knownTitles FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_INSTANCE, "SELECT data, completedEncounters FROM instance WHERE map = ? AND id = ?", CONNECTION_SYNCH); + PrepareStatement(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); + PrepareStatement(CHAR_SEL_CHAR_SOCIAL, "SELECT DISTINCT guid FROM character_social WHERE friend = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHAR_OLD_CHARS, "SELECT guid, deleteInfos_Account FROM characters WHERE deleteDate IS NOT NULL AND deleteDate < ?", CONNECTION_SYNCH); + PrepareStatement(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); + PrepareStatement(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); + PrepareStatement(CHAR_SEL_CHAR_PLAYERBYTES2, "SELECT playerBytes2 FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHAR_GUID_BY_NAME, "SELECT guid FROM characters WHERE name = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_DEL_CHAR_AURA_FROZEN, "DELETE FROM character_aura WHERE spell = 9454 AND guid = ?", CONNECTION_ASYNC); + PrepareStatement(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); + PrepareStatement(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); + PrepareStatement(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); + PrepareStatement(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); + PrepareStatement(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); + PrepareStatement(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); + PrepareStatement(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); + PrepareStatement(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); + PrepareStatement(CHAR_DEL_CHAR_ACHIEVEMENT, "DELETE FROM character_achievement WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS, "DELETE FROM character_achievement_progress WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_REPUTATION_BY_FACTION, "DELETE FROM character_reputation WHERE guid = ? AND faction = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHAR_REPUTATION_BY_FACTION, "INSERT INTO character_reputation (guid, faction, standing, flags) VALUES (?, ?, ? , ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHAR_ARENA_POINTS, "UPDATE characters SET arenaPoints = (arenaPoints + ?) WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_ITEM_REFUND_INSTANCE, "DELETE FROM item_refund_instance WHERE item_guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_ITEM_REFUND_INSTANCE, "INSERT INTO item_refund_instance (item_guid, player_guid, paidMoney, paidExtendedCost) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GROUP, "DELETE FROM groups WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GROUP_MEMBER_ALL, "DELETE FROM group_member WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHAR_GIFT, "INSERT INTO character_gifts (guid, item_guid, entry, flags) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_INSTANCE_BY_INSTANCE, "DELETE FROM instance WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE, "DELETE FROM character_instance WHERE instance = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_INSTANCE_BY_MAP_DIFF, "DELETE FROM character_instance USING character_instance LEFT JOIN instance ON character_instance.instance = id WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GROUP_INSTANCE_BY_MAP_DIFF, "DELETE FROM group_instance USING group_instance LEFT JOIN instance ON group_instance.instance = id WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_INSTANCE_BY_MAP_DIFF, "DELETE FROM instance WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_MAIL_ITEM_BY_ID, "DELETE FROM mail_items WHERE mail_id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_PETITION, "INSERT INTO petition (ownerguid, petitionguid, name, type) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_PETITION_BY_GUID, "DELETE FROM petition WHERE petitionguid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_PETITION_SIGNATURE_BY_GUID, "DELETE FROM petition_sign WHERE petitionguid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_DECLINED_NAME, "DELETE FROM character_declinedname WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHAR_DECLINED_NAME, "INSERT INTO character_declinedname (guid, genitive, dative, accusative, instrumental, prepositional) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_FACTION_OR_RACE, "UPDATE characters SET name = ?, race = ?, at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_SKILL_LANGUAGES, "DELETE FROM character_skills WHERE skill IN (98, 113, 759, 111, 313, 109, 115, 315, 673, 137) AND guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHAR_SKILL_LANGUAGE, "INSERT INTO `character_skills` (guid, skill, value, max) VALUES (?, ?, 300, 300)", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHAR_TAXI_PATH, "UPDATE characters SET taxi_path = '' WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHAR_TAXIMASK, "UPDATE characters SET taximask = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_QUESTSTATUS, "DELETE FROM character_queststatus WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_SOCIAL_BY_GUID, "DELETE FROM character_social WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_SOCIAL_BY_FRIEND, "DELETE FROM character_social WHERE friend = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT, "DELETE FROM character_achievement WHERE achievement = ? AND guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHAR_ACHIEVEMENT, "UPDATE character_achievement SET achievement = ? where achievement = ? AND guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHAR_INVENTORY_FACTION_CHANGE, "UPDATE item_instance ii, character_inventory ci SET ii.itemEntry = ? WHERE ii.itemEntry = ? AND ci.guid = ? AND ci.item = ii.guid", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_SPELL_BY_SPELL, "DELETE FROM character_spell WHERE spell = ? AND guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHAR_SPELL_FACTION_CHANGE, "UPDATE character_spell SET spell = ? where spell = ? AND guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHAR_REP_BY_FACTION, "SELECT standing FROM character_reputation WHERE faction = ? AND guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_DEL_CHAR_REP_BY_FACTION, "DELETE FROM character_reputation WHERE faction = ? AND guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHAR_REP_FACTION_CHANGE, "UPDATE character_reputation SET faction = ?, standing = ? WHERE faction = ? AND guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHAR_TITLES_FACTION_CHANGE, "UPDATE characters SET knownTitles = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_RES_CHAR_TITLES_FACTION_CHANGE, "UPDATE characters SET chosenTitle = 0 WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_SPELL_COOLDOWN, "DELETE FROM character_spell_cooldown WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHARACTER, "DELETE FROM characters WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_ACTION, "DELETE FROM character_action WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_AURA, "DELETE FROM character_aura WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_GIFT, "DELETE FROM character_gifts WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_INSTANCE, "DELETE FROM character_instance WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_INVENTORY, "DELETE FROM character_inventory WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_QUESTSTATUS_REWARDED, "DELETE FROM character_queststatus_rewarded WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_REPUTATION, "DELETE FROM character_reputation WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_SPELL, "DELETE FROM character_spell WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_MAIL, "DELETE FROM mail WHERE receiver = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_MAIL_ITEMS, "DELETE FROM mail_items WHERE receiver = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_ACHIEVEMENTS, "DELETE FROM character_achievement WHERE guid = ? AND achievement NOT BETWEEN '456' AND '467' AND achievement NOT BETWEEN '1400' AND '1427' AND achievement NOT IN(1463, 3117, 3259)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_EQUIPMENTSETS, "DELETE FROM character_equipmentsets WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GUILD_EVENTLOG_BY_PLAYER, "DELETE FROM guild_eventlog WHERE PlayerGuid1 = ? OR PlayerGuid2 = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_GUILD_BANK_EVENTLOG_BY_PLAYER, "DELETE FROM guild_bank_eventlog WHERE PlayerGuid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_GLYPHS, "DELETE FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_QUESTSTATUS_DAILY, "DELETE FROM character_queststatus_daily WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_TALENT, "DELETE FROM character_talent WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_SKILLS, "DELETE FROM character_skills WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UDP_CHAR_HONOR_POINTS, "UPDATE characters SET totalHonorPoints = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UDP_CHAR_ARENA_POINTS, "UPDATE characters SET arenaPoints = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UDP_CHAR_MONEY, "UPDATE characters SET money = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHAR_ACTION, "INSERT INTO character_action (guid, spec, button, action, type) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHAR_ACTION, "UPDATE character_action SET action = ?, type = ? WHERE guid = ? AND button = ? AND spec = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_ACTION_BY_BUTTON_SPEC, "DELETE FROM character_action WHERE guid = ? and button = ? and spec = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_INVENTORY_BY_ITEM, "DELETE FROM character_inventory WHERE item = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_INVENTORY_BY_BAG_SLOT, "DELETE FROM character_inventory WHERE bag = ? AND slot = ? AND guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_MAIL, "UPDATE mail SET has_items = ?, expire_time = ?, deliver_time = ?, money = ?, cod = ?, checked = ? WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_REP_CHAR_QUESTSTATUS, "REPLACE INTO character_queststatus (guid, quest, status, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, itemcount1, itemcount2, itemcount3, itemcount4, playercount) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_QUESTSTATUS_BY_QUEST, "DELETE FROM character_queststatus WHERE guid = ? AND quest = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHAR_QUESTSTATUS, "INSERT IGNORE INTO character_queststatus_rewarded (guid, quest) VALUES (?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_QUESTSTATUS_REWARDED_BY_QUEST, "DELETE FROM character_queststatus_rewarded WHERE guid = ? AND quest = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_SKILL_BY_SKILL, "DELETE FROM character_skills WHERE guid = ? AND skill = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHAR_SKILLS, "INSERT INTO character_skills (guid, skill, value, max) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_UDP_CHAR_SKILLS, "UPDATE character_skills SET value = ?, max = ? WHERE guid = ? AND skill = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHAR_SPELL, "INSERT INTO character_spell (guid, spell, active, disabled) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_STATS, "DELETE FROM character_stats WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHAR_STATS, "INSERT INTO character_stats (guid, maxhealth, maxpower1, maxpower2, maxpower3, maxpower4, maxpower5, maxpower6, maxpower7, strength, agility, stamina, intellect, spirit, " + "armor, resHoly, resFire, resNature, resFrost, resShadow, resArcane, blockPct, dodgePct, parryPct, critPct, rangedCritPct, spellCritPct, attackPower, rangedAttackPower, " + "spellPower, resilience) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_PETITION_BY_OWNER, "DELETE FROM petition WHERE ownerguid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER, "DELETE FROM petition_sign WHERE ownerguid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_PETITION_BY_OWNER_AND_TYPE, "DELETE FROM petition WHERE ownerguid = ? AND type = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER_AND_TYPE, "DELETE FROM petition_sign WHERE ownerguid = ? AND type = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHAR_GLYPHS, "INSERT INTO character_glyphs VALUES(?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_TALENT_BY_SPELL_SPEC, "DELETE FROM character_talent WHERE guid = ? and spell = ? and spec = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_CHAR_TALENT, "INSERT INTO character_talent (guid, spell, spec) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, "DELETE FROM character_action WHERE spec<>? AND guid = ?", CONNECTION_ASYNC); + + // Items that hold loot or money + PrepareStatement(CHAR_SEL_ITEMCONTAINER_ITEMS, "SELECT item_id, item_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_prop, rnd_suffix FROM item_loot_items WHERE container_id = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_DEL_ITEMCONTAINER_ITEMS, "DELETE FROM item_loot_items WHERE container_id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_ITEMCONTAINER_ITEM, "DELETE FROM item_loot_items WHERE container_id = ? AND item_id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_ITEMCONTAINER_ITEMS, "INSERT INTO item_loot_items (container_id, item_id, item_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_prop, rnd_suffix) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_ITEMCONTAINER_MONEY, "SELECT money FROM item_loot_money WHERE container_id = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_DEL_ITEMCONTAINER_MONEY, "DELETE FROM item_loot_money WHERE container_id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_ITEMCONTAINER_MONEY, "INSERT INTO item_loot_money (container_id, money) VALUES (?, ?)", CONNECTION_ASYNC); // Calendar - PREPARE_STATEMENT(CHAR_REP_CALENDAR_EVENT, "REPLACE INTO calendar_events (id, creator, title, description, type, dungeon, eventtime, flags, time2) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CALENDAR_EVENT, "DELETE FROM calendar_events WHERE id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_REP_CALENDAR_INVITE, "REPLACE INTO calendar_invites (id, event, invitee, sender, status, statustime, rank, text) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CALENDAR_INVITE, "DELETE FROM calendar_invites WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_REP_CALENDAR_EVENT, "REPLACE INTO calendar_events (id, creator, title, description, type, dungeon, eventtime, flags, time2) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CALENDAR_EVENT, "DELETE FROM calendar_events WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_REP_CALENDAR_INVITE, "REPLACE INTO calendar_invites (id, event, invitee, sender, status, statustime, rank, text) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CALENDAR_INVITE, "DELETE FROM calendar_invites WHERE id = ?", CONNECTION_ASYNC); + + // Pet + PrepareStatement(CHAR_SEL_PET_SLOTS, "SELECT owner, slot FROM character_pet WHERE owner = ? AND slot >= ? AND slot <= ? ORDER BY slot", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_PET_SLOTS_DETAIL, "SELECT owner, id, entry, level, name FROM character_pet WHERE owner = ? AND slot >= ? AND slot <= ? ORDER BY slot", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_PET_ENTRY, "SELECT entry FROM character_pet WHERE owner = ? AND id = ? AND slot >= ? AND slot <= ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_PET_SLOT_BY_ID, "SELECT slot, entry FROM character_pet WHERE owner = ? AND id = ?", CONNECTION_ASYNC); + PrepareStatement(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); + PrepareStatement(CHAR_SEL_CHAR_PET, "SELECT id FROM character_pet WHERE owner = ? AND id <> ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHAR_PETS, "SELECT id FROM character_pet WHERE owner = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_DEL_CHAR_PET_DECLINEDNAME_BY_OWNER, "DELETE FROM character_pet_declinedname WHERE owner = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_PET_DECLINEDNAME, "DELETE FROM character_pet_declinedname WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_ADD_CHAR_PET_DECLINEDNAME, "INSERT INTO character_pet_declinedname (id, owner, genitive, dative, accusative, instrumental, prepositional) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(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); + PrepareStatement(CHAR_SEL_PET_SPELL, "SELECT spell, active FROM pet_spell WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_PET_SPELL_COOLDOWN, "SELECT spell, time FROM pet_spell_cooldown WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_PET_DECLINED_NAME, "SELECT genitive, dative, accusative, instrumental, prepositional FROM character_pet_declinedname WHERE owner = ? AND id = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_DEL_PET_AURAS, "DELETE FROM pet_aura WHERE guid = ?", CONNECTION_BOTH); + PrepareStatement(CHAR_DEL_PET_SPELLS, "DELETE FROM pet_spell WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_PET_SPELL_COOLDOWNS, "DELETE FROM pet_spell_cooldown WHERE guid = ?", CONNECTION_BOTH); + PrepareStatement(CHAR_INS_PET_SPELL_COOLDOWN, "INSERT INTO pet_spell_cooldown (guid, spell, time) VALUES (?, ?, ?)", CONNECTION_BOTH); + PrepareStatement(CHAR_DEL_PET_SPELL_BY_SPELL, "DELETE FROM pet_spell WHERE guid = ? and spell = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_PET_SPELL, "INSERT INTO pet_spell (guid, spell, active) VALUES (?, ?, ?)", CONNECTION_BOTH); + PrepareStatement(CHAR_INS_PET_AURA, "INSERT INTO pet_aura (guid, caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, " + "base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_BOTH); + PrepareStatement(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); + PrepareStatement(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT_2, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND entry = ? AND (slot = ? OR slot > ?)", CONNECTION_SYNCH); + PrepareStatement(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); + PrepareStatement(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND slot = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_DEL_CHAR_PET_BY_OWNER, "DELETE FROM character_pet WHERE owner = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHAR_PET_NAME, "UPDATE character_pet SET name = ?, renamed = 1 WHERE owner = ? AND id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UDP_CHAR_PET_SLOT_BY_SLOT_EXCLUDE_ID, "UPDATE character_pet SET slot = ? WHERE owner = ? AND slot = ? AND id <> ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UDP_CHAR_PET_SLOT_BY_SLOT, "UPDATE character_pet SET slot = ? WHERE owner = ? AND slot = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_UPD_CHAR_PET_SLOT_BY_ID, "UPDATE character_pet SET slot = ? WHERE owner = ? AND id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_PET_BY_ID, "DELETE FROM character_pet WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_CHAR_PET_BY_SLOT, "DELETE FROM character_pet WHERE owner = ? AND (slot = ? OR slot > ?)", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 181161978df..bfa7bc48cf5 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -60,10 +60,6 @@ enum CharacterDatabaseStatements CHAR_SEL_BANNED_NAME, CHAR_SEL_ENUM, CHAR_SEL_ENUM_DECLINED_NAME, - CHAR_SEL_PET_SLOTS, - CHAR_SEL_PET_SLOTS_DETAIL, - CHAR_SEL_PET_ENTRY, - CHAR_SEL_PET_SLOT_BY_ID, CHAR_SEL_FREE_NAME, CHAR_SEL_GUID_RACE_ACC_BY_NAME, CHAR_SEL_CHAR_RACE, @@ -369,19 +365,12 @@ enum CharacterDatabaseStatements CHAR_SEL_CHAR_CLASS_LVL_AT_LOGIN, CHAR_SEL_CHAR_AT_LOGIN_TITLES, 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, @@ -392,9 +381,6 @@ enum CharacterDatabaseStatements CHAR_SEL_MAIL_ITEMS_BY_ENTRY, CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY, CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY, - CHAR_SEL_CHAR_PET_BY_ENTRY, - CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT_2, - CHAR_SEL_CHAR_PET_BY_SLOT, CHAR_DEL_CHAR_ACHIEVEMENT, CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS, CHAR_DEL_CHAR_REPUTATION_BY_FACTION, @@ -411,24 +397,9 @@ enum CharacterDatabaseStatements CHAR_DEL_GROUP_INSTANCE_BY_MAP_DIFF, CHAR_DEL_INSTANCE_BY_MAP_DIFF, CHAR_DEL_MAIL_ITEM_BY_ID, - CHAR_DEL_CHAR_PET_DECLINEDNAME, - CHAR_ADD_CHAR_PET_DECLINEDNAME, - CHAR_UPD_CHAR_PET_NAME, CHAR_INS_PETITION, CHAR_DEL_PETITION_BY_GUID, CHAR_DEL_PETITION_SIGNATURE_BY_GUID, - CHAR_UDP_CHAR_PET_SLOT_BY_SLOT_EXCLUDE_ID, - CHAR_UDP_CHAR_PET_SLOT_BY_SLOT, - CHAR_UPD_CHAR_PET_SLOT_BY_ID, - CHAR_DEL_CHAR_PET_BY_ID, - CHAR_DEL_CHAR_PET_BY_SLOT, - CHAR_DEL_PET_AURAS, - CHAR_DEL_PET_SPELLS, - CHAR_DEL_PET_SPELL_COOLDOWNS, - CHAR_INS_PET_SPELL_COOLDOWN, - CHAR_DEL_PET_SPELL_BY_SPELL, - CHAR_INS_PET_SPELL, - CHAR_INS_PET_AURA, CHAR_DEL_CHAR_DECLINED_NAME, CHAR_INS_CHAR_DECLINED_NAME, CHAR_UPD_FACTION_OR_RACE, @@ -461,8 +432,6 @@ enum CharacterDatabaseStatements CHAR_DEL_CHAR_SPELL, CHAR_DEL_MAIL, CHAR_DEL_MAIL_ITEMS, - CHAR_DEL_CHAR_PET_BY_OWNER, - CHAR_DEL_CHAR_PET_DECLINEDNAME_BY_OWNER, CHAR_DEL_CHAR_ACHIEVEMENTS, CHAR_DEL_CHAR_EQUIPMENTSETS, CHAR_DEL_GUILD_EVENTLOG_BY_PLAYER, @@ -498,13 +467,54 @@ enum CharacterDatabaseStatements CHAR_DEL_CHAR_TALENT_BY_SPELL_SPEC, CHAR_INS_CHAR_TALENT, CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, - CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, CHAR_REP_CALENDAR_EVENT, CHAR_DEL_CALENDAR_EVENT, CHAR_REP_CALENDAR_INVITE, CHAR_DEL_CALENDAR_INVITE, + CHAR_SEL_PET_AURA, + CHAR_SEL_PET_SPELL, + CHAR_SEL_PET_SPELL_COOLDOWN, + CHAR_SEL_PET_DECLINED_NAME, + CHAR_DEL_PET_AURAS, + CHAR_DEL_PET_SPELL_COOLDOWNS, + CHAR_INS_PET_SPELL_COOLDOWN, + CHAR_DEL_PET_SPELL_BY_SPELL, + CHAR_INS_PET_SPELL, + CHAR_INS_PET_AURA, + + CHAR_DEL_PET_SPELLS, + CHAR_DEL_CHAR_PET_BY_OWNER, + CHAR_DEL_CHAR_PET_DECLINEDNAME_BY_OWNER, + CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, + CHAR_SEL_PET_SLOTS, + CHAR_SEL_PET_SLOTS_DETAIL, + CHAR_SEL_PET_ENTRY, + CHAR_SEL_PET_SLOT_BY_ID, + CHAR_SEL_PET_SPELL_LIST, + CHAR_SEL_CHAR_PET, + CHAR_SEL_CHAR_PETS, + CHAR_SEL_CHAR_PET_BY_ENTRY, + CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT_2, + CHAR_SEL_CHAR_PET_BY_SLOT, + CHAR_DEL_CHAR_PET_DECLINEDNAME, + CHAR_ADD_CHAR_PET_DECLINEDNAME, + CHAR_UPD_CHAR_PET_NAME, + CHAR_UDP_CHAR_PET_SLOT_BY_SLOT_EXCLUDE_ID, + CHAR_UDP_CHAR_PET_SLOT_BY_SLOT, + CHAR_UPD_CHAR_PET_SLOT_BY_ID, + CHAR_DEL_CHAR_PET_BY_ID, + CHAR_DEL_CHAR_PET_BY_SLOT, + + CHAR_SEL_ITEMCONTAINER_ITEMS, + CHAR_DEL_ITEMCONTAINER_ITEMS, + CHAR_DEL_ITEMCONTAINER_ITEM, + CHAR_INS_ITEMCONTAINER_ITEMS, + CHAR_SEL_ITEMCONTAINER_MONEY, + CHAR_DEL_ITEMCONTAINER_MONEY, + CHAR_INS_ITEMCONTAINER_MONEY, + MAX_CHARACTERDATABASE_STATEMENTS }; diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp index 31d9f5ec1f6..70d509af6fe 100644 --- a/src/server/shared/Database/Implementation/LoginDatabase.cpp +++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -22,69 +22,69 @@ void LoginDatabaseConnection::DoPrepareStatements() if (!m_reconnecting) m_stmts.resize(MAX_LOGINDATABASE_STATEMENTS); - PREPARE_STATEMENT(LOGIN_SEL_REALMLIST, "SELECT id, name, address, port, icon, flag, timezone, allowedSecurityLevel, population, gamebuild FROM realmlist WHERE flag <> 3 ORDER BY name", CONNECTION_SYNCH) - PREPARE_STATEMENT(LOGIN_DEL_EXPIRED_IP_BANS, "DELETE FROM ip_banned WHERE unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC) - PREPARE_STATEMENT(LOGIN_UPD_EXPIRED_ACCOUNT_BANS, "UPDATE account_banned SET active = 0 WHERE active = 1 AND unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC) - PREPARE_STATEMENT(LOGIN_SEL_IP_BANNED, "SELECT * FROM ip_banned WHERE ip = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(LOGIN_INS_IP_AUTO_BANNED, "INSERT INTO ip_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban')", CONNECTION_ASYNC) - PREPARE_STATEMENT(LOGIN_SEL_IP_BANNED_ALL, "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE (bandate = unbandate OR unbandate > UNIX_TIMESTAMP()) ORDER BY unbandate", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_SEL_IP_BANNED_BY_IP, "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE (bandate = unbandate OR unbandate > UNIX_TIMESTAMP()) AND ip LIKE CONCAT('%%', ?, '%%') ORDER BY unbandate", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BANNED, "SELECT bandate, unbandate FROM account_banned WHERE id = ? AND active = 1", CONNECTION_SYNCH) - PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BANNED_ALL, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 GROUP BY account.id", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 AND username LIKE CONCAT('%%', ?, '%%') GROUP BY account.id", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_INS_ACCOUNT_AUTO_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban', 1)", CONNECTION_ASYNC) - PREPARE_STATEMENT(LOGIN_DEL_ACCOUNT_BANNED, "DELETE FROM account_banned WHERE id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_SEL_SESSIONKEY, "SELECT a.sessionkey, a.id, aa.gmlevel FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE username = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(LOGIN_UPD_VS, "UPDATE account SET v = ?, s = ? WHERE username = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(LOGIN_UPD_LOGONPROOF, "UPDATE account SET sessionkey = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0, os = ? WHERE username = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(LOGIN_SEL_LOGONCHALLENGE, "SELECT a.sha_pass_hash, a.id, a.locked, a.last_ip, aa.gmlevel, a.v, a.s FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = ?", CONNECTION_SYNCH) - 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, username FROM account WHERE last_ip = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BY_ID, "SELECT 1 FROM account WHERE id = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_INS_IP_BANNED, "INSERT INTO ip_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(LOGIN_DEL_IP_NOT_BANNED, "DELETE FROM ip_banned WHERE ip = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(LOGIN_INS_ACCOUNT_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)", CONNECTION_ASYNC) - PREPARE_STATEMENT(LOGIN_UPD_ACCOUNT_NOT_BANNED, "UPDATE account_banned SET active = 0 WHERE id = ? AND active != 0", CONNECTION_ASYNC) - PREPARE_STATEMENT(LOGIN_DEL_REALM_CHARACTERS_BY_REALM, "DELETE FROM realmcharacters WHERE acctid = ? AND realmid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(LOGIN_DEL_REALM_CHARACTERS, "DELETE FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_INS_REALM_CHARACTERS, "INSERT INTO realmcharacters (numchars, acctid, realmid) VALUES (?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(LOGIN_SEL_SUM_REALM_CHARACTERS, "SELECT SUM(numchars) FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_INS_ACCOUNT, "INSERT INTO account(username, sha_pass_hash, joindate) VALUES(?, ?, NOW())", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_INS_REALM_CHARACTERS_INIT, "INSERT INTO realmcharacters (realmid, acctid, numchars) SELECT realmlist.id, account.id, 0 FROM realmlist, account LEFT JOIN realmcharacters ON acctid=account.id WHERE acctid IS NULL", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_UPD_EXPANSION, "UPDATE account SET expansion = ? WHERE id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_UPD_ACCOUNT_LOCK, "UPDATE account SET locked = ? WHERE id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_INS_LOG, "INSERT INTO logs (time, realm, type, level, string) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_UPD_USERNAME, "UPDATE account SET v = 0, s = 0, username = ?, sha_pass_hash = ? WHERE id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_UPD_PASSWORD, "UPDATE account SET v = 0, s = 0, sha_pass_hash = ? WHERE id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_UPD_MUTE_TIME, "UPDATE account SET mutetime = ? WHERE id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_UPD_LAST_IP, "UPDATE account SET last_ip = ? WHERE username = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_UPD_ACCOUNT_ONLINE, "UPDATE account SET online = 1 WHERE id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_UPD_UPTIME_PLAYERS, "UPDATE uptime SET uptime = ?, maxplayers = ? WHERE realmid = ? AND starttime = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_DEL_OLD_LOGS, "DELETE FROM logs WHERE (time + ?) < ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_DEL_ACCOUNT_ACCESS, "DELETE FROM account_access WHERE id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM, "DELETE FROM account_access WHERE id = ? AND (RealmID = ? OR RealmID = -1)", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_INS_ACCOUNT_ACCESS, "INSERT INTO account_access (id,gmlevel,RealmID) VALUES (?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_GET_ACCOUNT_ID_BY_USERNAME, "SELECT id FROM account WHERE username = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_GET_ACCOUNT_ACCESS_GMLEVEL, "SELECT gmlevel FROM account_access WHERE id = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_GET_GMLEVEL_BY_REALMID, "SELECT gmlevel FROM account_access WHERE id = ? AND (RealmID = ? OR RealmID = -1)", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_GET_USERNAME_BY_ID, "SELECT username FROM account WHERE id = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_SEL_CHECK_PASSWORD, "SELECT 1 FROM account WHERE id = ? AND sha_pass_hash = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_SEL_CHECK_PASSWORD_BY_NAME, "SELECT 1 FROM account WHERE username = ? AND sha_pass_hash = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_SEL_PINFO, "SELECT a.username, aa.gmlevel, a.email, a.last_ip, DATE_FORMAT(a.last_login, '%Y-%m-%d %T'), a.mutetime FROM account a LEFT JOIN account_access aa ON (a.id = aa.id AND (aa.RealmID = ? OR aa.RealmID = -1)) WHERE a.id = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_SEL_PINFO_BANS, "SELECT unbandate, bandate = unbandate, bannedby, banreason FROM account_banned WHERE id = ? AND active ORDER BY bandate ASC LIMIT 1", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_SEL_GM_ACCOUNTS, "SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= ? AND (aa.realmid = -1 OR aa.realmid = ?)", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_INFO, "SELECT a.username, a.last_ip, aa.gmlevel, a.expansion FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.id = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_ACCESS_GMLEVEL_TEST, "SELECT 1 FROM account_access WHERE id = ? AND gmlevel > ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_ACCESS, "SELECT a.id, aa.gmlevel, aa.RealmID FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_RECRUITER, "SELECT 1 FROM account WHERE recruiter = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_SEL_BANS, "SELECT 1 FROM account_banned WHERE id = ? AND active = 1 UNION SELECT 1 FROM ip_banned WHERE ip = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_WHOIS, "SELECT username, email, last_ip FROM account WHERE id = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_SEL_REALMLIST_SECURITY_LEVEL, "SELECT allowedSecurityLevel from realmlist WHERE id = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(LOGIN_DEL_ACCOUNT, "DELETE FROM account WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_SEL_REALMLIST, "SELECT id, name, address, port, icon, flag, timezone, allowedSecurityLevel, population, gamebuild FROM realmlist WHERE flag <> 3 ORDER BY name", CONNECTION_SYNCH); + PrepareStatement(LOGIN_DEL_EXPIRED_IP_BANS, "DELETE FROM ip_banned WHERE unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC); + PrepareStatement(LOGIN_UPD_EXPIRED_ACCOUNT_BANS, "UPDATE account_banned SET active = 0 WHERE active = 1 AND unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC); + PrepareStatement(LOGIN_SEL_IP_BANNED, "SELECT * FROM ip_banned WHERE ip = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_INS_IP_AUTO_BANNED, "INSERT INTO ip_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban')", CONNECTION_ASYNC); + PrepareStatement(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); + PrepareStatement(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); + PrepareStatement(LOGIN_SEL_ACCOUNT_BANNED, "SELECT bandate, unbandate FROM account_banned WHERE id = ? AND active = 1", CONNECTION_SYNCH); + PrepareStatement(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); + PrepareStatement(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); + PrepareStatement(LOGIN_INS_ACCOUNT_AUTO_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban', 1)", CONNECTION_ASYNC); + PrepareStatement(LOGIN_DEL_ACCOUNT_BANNED, "DELETE FROM account_banned WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(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); + PrepareStatement(LOGIN_UPD_VS, "UPDATE account SET v = ?, s = ? WHERE username = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_UPD_LOGONPROOF, "UPDATE account SET sessionkey = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0, os = ? WHERE username = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_SEL_LOGONCHALLENGE, "SELECT a.sha_pass_hash, a.id, a.locked, a.last_ip, aa.gmlevel, a.v, a.s FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_UPD_FAILEDLOGINS, "UPDATE account SET failed_logins = failed_logins + 1 WHERE username = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_SEL_FAILEDLOGINS, "SELECT id, failed_logins FROM account WHERE username = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME, "SELECT id FROM account WHERE username = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_SEL_ACCOUNT_LIST_BY_NAME, "SELECT id, username FROM account WHERE username = ?", CONNECTION_SYNCH); + PrepareStatement(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); + PrepareStatement(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL, "SELECT id, username FROM account WHERE email = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_SEL_NUM_CHARS_ON_REALM, "SELECT numchars FROM realmcharacters WHERE realmid = ? AND acctid= ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_SEL_ACCOUNT_BY_IP, "SELECT id, username FROM account WHERE last_ip = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_SEL_ACCOUNT_BY_ID, "SELECT 1 FROM account WHERE id = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_INS_IP_BANNED, "INSERT INTO ip_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(LOGIN_DEL_IP_NOT_BANNED, "DELETE FROM ip_banned WHERE ip = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_INS_ACCOUNT_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)", CONNECTION_ASYNC); + PrepareStatement(LOGIN_UPD_ACCOUNT_NOT_BANNED, "UPDATE account_banned SET active = 0 WHERE id = ? AND active != 0", CONNECTION_ASYNC); + PrepareStatement(LOGIN_DEL_REALM_CHARACTERS_BY_REALM, "DELETE FROM realmcharacters WHERE acctid = ? AND realmid = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_DEL_REALM_CHARACTERS, "DELETE FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_INS_REALM_CHARACTERS, "INSERT INTO realmcharacters (numchars, acctid, realmid) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(LOGIN_SEL_SUM_REALM_CHARACTERS, "SELECT SUM(numchars) FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_INS_ACCOUNT, "INSERT INTO account(username, sha_pass_hash, joindate) VALUES(?, ?, NOW())", CONNECTION_ASYNC); + PrepareStatement(LOGIN_INS_REALM_CHARACTERS_INIT, "INSERT INTO realmcharacters (realmid, acctid, numchars) SELECT realmlist.id, account.id, 0 FROM realmlist, account LEFT JOIN realmcharacters ON acctid=account.id WHERE acctid IS NULL", CONNECTION_ASYNC); + PrepareStatement(LOGIN_UPD_EXPANSION, "UPDATE account SET expansion = ? WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_UPD_ACCOUNT_LOCK, "UPDATE account SET locked = ? WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_INS_LOG, "INSERT INTO logs (time, realm, type, level, string) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(LOGIN_UPD_USERNAME, "UPDATE account SET v = 0, s = 0, username = ?, sha_pass_hash = ? WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_UPD_PASSWORD, "UPDATE account SET v = 0, s = 0, sha_pass_hash = ? WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_UPD_MUTE_TIME, "UPDATE account SET mutetime = ? WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_UPD_LAST_IP, "UPDATE account SET last_ip = ? WHERE username = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_UPD_ACCOUNT_ONLINE, "UPDATE account SET online = 1 WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_UPD_UPTIME_PLAYERS, "UPDATE uptime SET uptime = ?, maxplayers = ? WHERE realmid = ? AND starttime = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_DEL_OLD_LOGS, "DELETE FROM logs WHERE (time + ?) < ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_DEL_ACCOUNT_ACCESS, "DELETE FROM account_access WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM, "DELETE FROM account_access WHERE id = ? AND (RealmID = ? OR RealmID = -1)", CONNECTION_ASYNC); + PrepareStatement(LOGIN_INS_ACCOUNT_ACCESS, "INSERT INTO account_access (id,gmlevel,RealmID) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(LOGIN_GET_ACCOUNT_ID_BY_USERNAME, "SELECT id FROM account WHERE username = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_GET_ACCOUNT_ACCESS_GMLEVEL, "SELECT gmlevel FROM account_access WHERE id = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_GET_GMLEVEL_BY_REALMID, "SELECT gmlevel FROM account_access WHERE id = ? AND (RealmID = ? OR RealmID = -1)", CONNECTION_SYNCH); + PrepareStatement(LOGIN_GET_USERNAME_BY_ID, "SELECT username FROM account WHERE id = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_SEL_CHECK_PASSWORD, "SELECT 1 FROM account WHERE id = ? AND sha_pass_hash = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_SEL_CHECK_PASSWORD_BY_NAME, "SELECT 1 FROM account WHERE username = ? AND sha_pass_hash = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_SEL_PINFO, "SELECT a.username, aa.gmlevel, a.email, a.last_ip, DATE_FORMAT(a.last_login, '%Y-%m-%d %T'), a.mutetime FROM account a LEFT JOIN account_access aa ON (a.id = aa.id AND (aa.RealmID = ? OR aa.RealmID = -1)) WHERE a.id = ?", CONNECTION_SYNCH); + PrepareStatement(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); + PrepareStatement(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); + PrepareStatement(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); + PrepareStatement(LOGIN_SEL_ACCOUNT_ACCESS_GMLEVEL_TEST, "SELECT 1 FROM account_access WHERE id = ? AND gmlevel > ?", CONNECTION_SYNCH); + PrepareStatement(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); + PrepareStatement(LOGIN_SEL_ACCOUNT_RECRUITER, "SELECT 1 FROM account WHERE recruiter = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_SEL_BANS, "SELECT 1 FROM account_banned WHERE id = ? AND active = 1 UNION SELECT 1 FROM ip_banned WHERE ip = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_SEL_ACCOUNT_WHOIS, "SELECT username, email, last_ip FROM account WHERE id = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_SEL_REALMLIST_SECURITY_LEVEL, "SELECT allowedSecurityLevel from realmlist WHERE id = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_DEL_ACCOUNT, "DELETE FROM account WHERE id = ?", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/LoginDatabase.h b/src/server/shared/Database/Implementation/LoginDatabase.h index b4f6713d118..798016d553d 100644 --- a/src/server/shared/Database/Implementation/LoginDatabase.h +++ b/src/server/shared/Database/Implementation/LoginDatabase.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp index c491852b1bd..399a4eeb031 100644 --- a/src/server/shared/Database/Implementation/WorldDatabase.cpp +++ b/src/server/shared/Database/Implementation/WorldDatabase.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -22,73 +22,74 @@ void WorldDatabaseConnection::DoPrepareStatements() if (!m_reconnecting) m_stmts.resize(MAX_WORLDDATABASE_STATEMENTS); - PREPARE_STATEMENT(WORLD_SEL_QUEST_POOLS, "SELECT entry, pool_entry FROM pool_quest", CONNECTION_SYNCH) - PREPARE_STATEMENT(WORLD_DEL_CRELINKED_RESPAWN, "DELETE FROM linked_respawn WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(WORLD_REP_CREATURE_LINKED_RESPAWN, "REPLACE INTO linked_respawn (guid, linkedGuid) VALUES (?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(WORLD_SEL_CREATURE_TEXT, "SELECT entry, groupid, id, text, type, language, probability, emote, duration, sound FROM creature_text", CONNECTION_SYNCH) - PREPARE_STATEMENT(WORLD_SEL_SMART_SCRIPTS, "SELECT entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_x, target_y, target_z, target_o FROM smart_scripts ORDER BY entryorguid, source_type, id, link", CONNECTION_SYNCH) - PREPARE_STATEMENT(WORLD_SEL_SMARTAI_WP, "SELECT entry, pointid, position_x, position_y, position_z FROM waypoints ORDER BY entry, pointid", CONNECTION_SYNCH) - PREPARE_STATEMENT(WORLD_DEL_GAMEOBJECT, "DELETE FROM gameobject WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_DEL_EVENT_GAMEOBJECT, "DELETE FROM game_event_gameobject WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_INS_GRAVEYARD_ZONE, "INSERT INTO game_graveyard_zone (id, ghost_zone, faction) VALUES (?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_DEL_GRAVEYARD_ZONE, "DELETE FROM game_graveyard_zone WHERE id = ? AND ghost_zone = ? AND faction = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_INS_GAME_TELE, "INSERT INTO game_tele (id, position_x, position_y, position_z, orientation, map, name) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_DEL_GAME_TELE, "DELETE FROM game_tele WHERE name = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_INS_NPC_VENODR, "INSERT INTO npc_vendor (entry, item, maxcount, incrtime, extendedcost) VALUES(?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_DEL_NPC_VENDOR, "DELETE FROM npc_vendor WHERE entry = ? AND item = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_SEL_NPC_VENDOR_REF, "SELECT item, maxcount, incrtime, ExtendedCost FROM npc_vendor WHERE entry = ? ORDER BY slot ASC", CONNECTION_SYNCH); - PREPARE_STATEMENT(WORLD_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); - PREPARE_STATEMENT(WORLD_UPD_CREATURE_POSITION, "UPDATE creature SET position_x = ?, position_y = ?, position_z = ?, orientation = ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_UPD_CREATURE_SPAWN_DISTANCE, "UPDATE creature SET spawndist = ?, MovementType = ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_UPD_CREATURE_SPAWN_TIME_SECS, "UPDATE creature SET spawntimesecs = ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_INS_CREATURE_FORMATION, "INSERT INTO creature_formations (leaderGUID, memberGUID, dist, angle, groupAI) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_INS_WAYPOINT_DATA, "INSERT INTO waypoint_data (id, point, position_x, position_y, position_z) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_DEL_WAYPOINT_DATA, "DELETE FROM waypoint_data WHERE id = ? AND point = ?", CONNECTION_ASYNC); - 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_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); - PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_SCRIPT_X, "UPDATE waypoint_scripts SET x = ? WHERE guid = ?", CONNECTION_ASYNC); - 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, unit_flags2, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_SCRIPT_BY_ID, "SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(WORLD_SEL_IP2NATION_COUNTRY, "SELECT c.country FROM ip2nationCountries c, ip2nation i WHERE i.ip < ? AND c.code = i.country ORDER BY i.ip DESC LIMIT 0,1", CONNECTION_SYNCH); - PREPARE_STATEMENT(WORLD_SEL_ITEM_TEMPLATE_BY_NAME, "SELECT entry FROM item_template WHERE name = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(WORLD_SEL_CREATURE_BY_ID, "SELECT guid FROM creature WHERE id = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(WORLD_SEL_GAMEOBJECT_NEAREST, "SELECT guid, id, position_x, position_y, position_z, map, (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) AS order_ FROM gameobject WHERE map = ? AND (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) <= ? ORDER BY order_", CONNECTION_SYNCH); - PREPARE_STATEMENT(WORLD_INS_CREATURE, "INSERT INTO creature (guid, id , map, spawnMask, phaseMask, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, currentwaypoint, curhealth, curmana, MovementType, npcflag, unit_flags, dynamicflags) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_DEL_GAME_EVENT_CREATURE, "DELETE FROM game_event_creature WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_DEL_GAME_EVENT_MODEL_EQUIP, "DELETE FROM game_event_model_equip WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_INS_GAMEOBJECT, "INSERT INTO gameobject (guid, id, map, spawnMask, phaseMask, position_x, position_y, position_z, orientation, rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_INS_DISABLES, "INSERT INTO disables (entry, sourceType, flags, comment) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_SEL_DISABLES, "SELECT entry FROM disables WHERE entry = ? AND sourceType = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(WORLD_DEL_DISABLES, "DELETE FROM disables WHERE entry = ? AND sourceType = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_SEL_QUEST_POOLS, "SELECT entry, pool_entry FROM pool_quest", CONNECTION_SYNCH); + PrepareStatement(WORLD_DEL_CRELINKED_RESPAWN, "DELETE FROM linked_respawn WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_REP_CREATURE_LINKED_RESPAWN, "REPLACE INTO linked_respawn (guid, linkedGuid) VALUES (?, ?)", CONNECTION_ASYNC); + PrepareStatement(WORLD_SEL_CREATURE_TEXT, "SELECT entry, groupid, id, text, type, language, probability, emote, duration, sound FROM creature_text", CONNECTION_SYNCH); + PrepareStatement(WORLD_SEL_SMART_SCRIPTS, "SELECT entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_x, target_y, target_z, target_o FROM smart_scripts ORDER BY entryorguid, source_type, id, link", CONNECTION_SYNCH); + PrepareStatement(WORLD_SEL_SMARTAI_WP, "SELECT entry, pointid, position_x, position_y, position_z FROM waypoints ORDER BY entry, pointid", CONNECTION_SYNCH); + PrepareStatement(WORLD_DEL_GAMEOBJECT, "DELETE FROM gameobject WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_DEL_EVENT_GAMEOBJECT, "DELETE FROM game_event_gameobject WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_INS_GRAVEYARD_ZONE, "INSERT INTO game_graveyard_zone (id, ghost_zone, faction) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(WORLD_DEL_GRAVEYARD_ZONE, "DELETE FROM game_graveyard_zone WHERE id = ? AND ghost_zone = ? AND faction = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_INS_GAME_TELE, "INSERT INTO game_tele (id, position_x, position_y, position_z, orientation, map, name) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(WORLD_DEL_GAME_TELE, "DELETE FROM game_tele WHERE name = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_INS_NPC_VENDOR, "INSERT INTO npc_vendor (entry, item, maxcount, incrtime, extendedcost) VALUES(?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(WORLD_DEL_NPC_VENDOR, "DELETE FROM npc_vendor WHERE entry = ? AND item = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_SEL_NPC_VENDOR_REF, "SELECT item, maxcount, incrtime, ExtendedCost FROM npc_vendor WHERE entry = ? ORDER BY slot ASC", CONNECTION_SYNCH); + PrepareStatement(WORLD_UPD_CREATURE_MOVEMENT_TYPE, "UPDATE creature SET MovementType = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_UPD_CREATURE_FACTION, "UPDATE creature_template SET faction_A = ?, faction_H = ? WHERE entry = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_UPD_CREATURE_NPCFLAG, "UPDATE creature_template SET npcflag = ? WHERE entry = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_UPD_CREATURE_POSITION, "UPDATE creature SET position_x = ?, position_y = ?, position_z = ?, orientation = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_UPD_CREATURE_SPAWN_DISTANCE, "UPDATE creature SET spawndist = ?, MovementType = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_UPD_CREATURE_SPAWN_TIME_SECS, "UPDATE creature SET spawntimesecs = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_INS_CREATURE_FORMATION, "INSERT INTO creature_formations (leaderGUID, memberGUID, dist, angle, groupAI) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(WORLD_INS_WAYPOINT_DATA, "INSERT INTO waypoint_data (id, point, position_x, position_y, position_z) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(WORLD_DEL_WAYPOINT_DATA, "DELETE FROM waypoint_data WHERE id = ? AND point = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_UPD_WAYPOINT_DATA_POINT, "UPDATE waypoint_data SET point = point - 1 WHERE id = ? AND point > ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_UPD_WAYPOINT_DATA_POSITION, "UPDATE waypoint_data SET position_x = ?, position_y = ?, position_z = ? where id = ? AND point = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_UPD_WAYPOINT_DATA_WPGUID, "UPDATE waypoint_data SET wpguid = ? WHERE id = ? and point = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_SEL_WAYPOINT_DATA_MAX_ID, "SELECT MAX(id) FROM waypoint_data", CONNECTION_SYNCH); + PrepareStatement(WORLD_SEL_WAYPOINT_DATA_MAX_POINT, "SELECT MAX(point) FROM waypoint_data WHERE id = ?", CONNECTION_SYNCH); + PrepareStatement(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); + PrepareStatement(WORLD_SEL_WAYPOINT_DATA_POS_BY_ID, "SELECT point, position_x, position_y, position_z FROM waypoint_data WHERE id = ?", CONNECTION_SYNCH); + PrepareStatement(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); + PrepareStatement(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); + PrepareStatement(WORLD_SEL_WAYPOINT_DATA_BY_WPGUID, "SELECT id, point FROM waypoint_data WHERE wpguid = ?", CONNECTION_SYNCH); + PrepareStatement(WORLD_SEL_WAYPOINT_DATA_ALL_BY_WPGUID, "SELECT id, point, delay, move_flag, action, action_chance FROM waypoint_data WHERE wpguid = ?", CONNECTION_SYNCH); + PrepareStatement(WORLD_UPD_WAYPOINT_DATA_ALL_WPGUID, "UPDATE waypoint_data SET wpguid = 0", CONNECTION_ASYNC); + PrepareStatement(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); + PrepareStatement(WORLD_SEL_WAYPOINT_DATA_WPGUID_BY_ID, "SELECT wpguid FROM waypoint_data WHERE id = ? and wpguid <> 0", CONNECTION_SYNCH); + PrepareStatement(WOLRD_SEL_WAYPOINT_DATA_ACTION, "SELECT DISTINCT action FROM waypoint_data", CONNECTION_SYNCH); + PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPTS_MAX_ID, "SELECT MAX(guid) FROM waypoint_scripts", CONNECTION_SYNCH); + PrepareStatement(WORLD_INS_CREATURE_ADDON, "INSERT INTO creature_addon(guid, path_id) VALUES (?, ?)", CONNECTION_ASYNC); + PrepareStatement(WORLD_UPD_CREATURE_ADDON_PATH, "UPDATE creature_addon SET path_id = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_DEL_CREATURE_ADDON, "DELETE FROM creature_addon WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_SEL_CREATURE_ADDON_BY_GUID, "SELECT guid FROM creature_addon WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(WORLD_INS_WAYPOINT_SCRIPT, "INSERT INTO waypoint_scripts (guid) VALUES (?)", CONNECTION_ASYNC); + PrepareStatement(WORLD_DEL_WAYPOINT_SCRIPT, "DELETE FROM waypoint_scripts WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_UPD_WAYPOINT_SCRIPT_ID, "UPDATE waypoint_scripts SET id = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_UPD_WAYPOINT_SCRIPT_X, "UPDATE waypoint_scripts SET x = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_UPD_WAYPOINT_SCRIPT_Y, "UPDATE waypoint_scripts SET y = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_UPD_WAYPOINT_SCRIPT_Z, "UPDATE waypoint_scripts SET z = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_UPD_WAYPOINT_SCRIPT_O, "UPDATE waypoint_scripts SET o = ? WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID, "SELECT id FROM waypoint_scripts WHERE guid = ?", CONNECTION_SYNCH); + PrepareStatement(WORLD_DEL_CREATURE, "DELETE FROM creature WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_INS_CREATURE_TRANSPORT, "INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(WORLD_UPD_CREATURE_TRANSPORT_EMOTE, "UPDATE creature_transport SET emote = ? WHERE transport_entry = ? AND guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_SEL_COMMANDS, "SELECT name, security, help FROM command", CONNECTION_SYNCH); + PrepareStatement(WORLD_SEL_CREATURE_TEMPLATE, "SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH); + PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPT_BY_ID, "SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = ?", CONNECTION_SYNCH); + PrepareStatement(WORLD_SEL_IP2NATION_COUNTRY, "SELECT c.country FROM ip2nationCountries c, ip2nation i WHERE i.ip < ? AND c.code = i.country ORDER BY i.ip DESC LIMIT 0,1", CONNECTION_SYNCH); + PrepareStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME, "SELECT entry FROM item_template WHERE name = ?", CONNECTION_SYNCH); + PrepareStatement(WORLD_SEL_CREATURE_BY_ID, "SELECT guid FROM creature WHERE id = ?", CONNECTION_SYNCH); + PrepareStatement(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); + PrepareStatement(WORLD_SEL_CREATURE_NEAREST, "SELECT guid, id, position_x, position_y, position_z, map, (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) AS order_ FROM creature WHERE map = ? AND (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) <= ? ORDER BY order_", CONNECTION_SYNCH); + PrepareStatement(WORLD_INS_CREATURE, "INSERT INTO creature (guid, id , map, spawnMask, phaseMask, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, currentwaypoint, curhealth, curmana, MovementType, npcflag, unit_flags, dynamicflags) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(WORLD_DEL_GAME_EVENT_CREATURE, "DELETE FROM game_event_creature WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_DEL_GAME_EVENT_MODEL_EQUIP, "DELETE FROM game_event_model_equip WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(WORLD_INS_GAMEOBJECT, "INSERT INTO gameobject (guid, id, map, spawnMask, phaseMask, position_x, position_y, position_z, orientation, rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(WORLD_INS_DISABLES, "INSERT INTO disables (entry, sourceType, flags, comment) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(WORLD_SEL_DISABLES, "SELECT entry FROM disables WHERE entry = ? AND sourceType = ?", CONNECTION_SYNCH); + PrepareStatement(WORLD_DEL_DISABLES, "DELETE FROM disables WHERE entry = ? AND sourceType = ?", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/WorldDatabase.h b/src/server/shared/Database/Implementation/WorldDatabase.h index 195d2ea8da5..30cc45c535a 100644 --- a/src/server/shared/Database/Implementation/WorldDatabase.h +++ b/src/server/shared/Database/Implementation/WorldDatabase.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -54,7 +54,7 @@ enum WorldDatabaseStatements WORLD_DEL_GRAVEYARD_ZONE, WORLD_INS_GAME_TELE, WORLD_DEL_GAME_TELE, - WORLD_INS_NPC_VENODR, + WORLD_INS_NPC_VENDOR, WORLD_DEL_NPC_VENDOR, WORLD_SEL_NPC_VENDOR_REF, WORLD_UPD_CREATURE_MOVEMENT_TYPE, @@ -104,6 +104,7 @@ enum WorldDatabaseStatements WORLD_SEL_ITEM_TEMPLATE_BY_NAME, WORLD_SEL_CREATURE_BY_ID, WORLD_SEL_GAMEOBJECT_NEAREST, + WORLD_SEL_CREATURE_NEAREST, WORLD_SEL_GAMEOBJECT_TARGET, WORLD_INS_CREATURE, WORLD_DEL_GAME_EVENT_CREATURE, diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp index c6d2a165ca2..10ff16b5ddd 100644 --- a/src/server/shared/Database/MySQLConnection.cpp +++ b/src/server/shared/Database/MySQLConnection.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -63,9 +63,6 @@ MySQLConnection::~MySQLConnection() for (size_t i = 0; i < m_stmts.size(); ++i) delete m_stmts[i]; - for (PreparedStatementMap::const_iterator itr = m_queries.begin(); itr != m_queries.end(); ++itr) - free((void *)m_queries[itr->first].first); - mysql_close(m_Mysql); } @@ -150,8 +147,6 @@ bool MySQLConnection::Open() bool MySQLConnection::PrepareStatements() { DoPrepareStatements(); - for (PreparedStatementMap::const_iterator itr = m_queries.begin(); itr != m_queries.end(); ++itr) - PrepareStatement(itr->first, itr->second.first, itr->second.second); return !m_prepareError; } @@ -424,6 +419,8 @@ MySQLPreparedStatement* MySQLConnection::GetPreparedStatement(uint32 index) void MySQLConnection::PrepareStatement(uint32 index, const char* sql, ConnectionFlags flags) { + m_queries.insert(PreparedStatementMap::value_type(index, std::make_pair(sql, flags))); + // For reconnection case if (m_reconnecting) delete m_stmts[index]; diff --git a/src/server/shared/Database/MySQLConnection.h b/src/server/shared/Database/MySQLConnection.h index b0b79ac0a33..989c447fcd5 100644 --- a/src/server/shared/Database/MySQLConnection.h +++ b/src/server/shared/Database/MySQLConnection.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -62,9 +62,7 @@ struct MySQLConnectionInfo std::string port_or_socket; }; -typedef std::map<uint32 /*index*/, std::pair<const char* /*query*/, ConnectionFlags /*sync/async*/> > PreparedStatementMap; - -#define PREPARE_STATEMENT(a, b, c) m_queries[a] = std::make_pair(strdup(b), c); +typedef std::map<uint32 /*index*/, std::pair<std::string /*query*/, ConnectionFlags /*sync/async*/> > PreparedStatementMap; class MySQLConnection { diff --git a/src/server/shared/Database/MySQLThreading.h b/src/server/shared/Database/MySQLThreading.h index 038ec4ee794..67e2295e82c 100644 --- a/src/server/shared/Database/MySQLThreading.h +++ b/src/server/shared/Database/MySQLThreading.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp index 21aef0f1834..86010e61686 100644 --- a/src/server/shared/Database/PreparedStatement.cpp +++ b/src/server/shared/Database/PreparedStatement.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -33,7 +33,7 @@ void PreparedStatement::BindParameters() { ASSERT (m_stmt); - uint32 i = 0; + uint8 i = 0; for (; i < statement_data.size(); i++) { switch (statement_data[i].type) @@ -74,6 +74,9 @@ void PreparedStatement::BindParameters() case TYPE_STRING: m_stmt->setString(i, statement_data[i].str.c_str()); break; + case TYPE_NULL: + m_stmt->setNull(i); + break; } } #ifdef _DEBUG @@ -191,6 +194,14 @@ void PreparedStatement::setString(const uint8 index, const std::string& value) statement_data[index].type = TYPE_STRING; } +void PreparedStatement::setNull(const uint8 index) +{ + if (index >= statement_data.size()) + statement_data.resize(index+1); + + statement_data[index].type = TYPE_NULL; +} + MySQLPreparedStatement::MySQLPreparedStatement(MYSQL_STMT* stmt) : m_Mstmt(stmt), m_bind(NULL) @@ -230,11 +241,16 @@ void MySQLPreparedStatement::ClearParameters() } } +static bool ParamenterIndexAssertFail(uint32 stmtIndex, uint8 index, uint32 paramCount) +{ + sLog->outError(LOG_FILTER_SQL_DRIVER, "Attempted to bind parameter %u%s on a PreparedStatement %u (statement has only %u parameters)", uint32(index) + 1, (index == 1 ? "st" : (index == 2 ? "nd" : (index == 3 ? "rd" : "nd"))), stmtIndex, paramCount); + return false; +} + //- Bind on mysql level bool MySQLPreparedStatement::CheckValidIndex(uint8 index) { - if (index >= m_paramCount) - return false; + ASSERT(index < m_paramCount || ParamenterIndexAssertFail(m_stmt->m_index, index, m_paramCount)); if (m_paramsSet[index]) sLog->outWarn(LOG_FILTER_SQL, "[WARNING] Prepared Statement (id: %u) trying to bind value on already bound index (%u).", m_stmt->m_index, index); @@ -337,11 +353,26 @@ void MySQLPreparedStatement::setString(const uint8 index, const char* value) param->buffer = new char[len]; param->buffer_length = len; param->is_null_value = 0; + delete param->length; param->length = new unsigned long(len-1); memcpy(param->buffer, value, len); } +void MySQLPreparedStatement::setNull(const uint8 index) +{ + CheckValidIndex(index); + m_paramsSet[index] = true; + MYSQL_BIND* param = &m_bind[index]; + param->buffer_type = MYSQL_TYPE_NULL; + delete [] static_cast<char *>(param->buffer); + param->buffer = NULL; + param->buffer_length = 0; + param->is_null_value = 1; + delete param->length; + param->length = NULL; +} + void MySQLPreparedStatement::setValue(MYSQL_BIND* param, enum_field_types type, const void* value, uint32 len, bool isUnsigned) { param->buffer_type = type; @@ -355,59 +386,62 @@ void MySQLPreparedStatement::setValue(MYSQL_BIND* param, enum_field_types type, memcpy(param->buffer, value, len); } -std::string MySQLPreparedStatement::getQueryString(const char *query) +std::string MySQLPreparedStatement::getQueryString(std::string const& sqlPattern) const { - std::string queryString = query; + std::string queryString = sqlPattern; - uint32 pos = 0; + size_t pos = 0; for (uint32 i = 0; i < m_stmt->statement_data.size(); i++) { - pos = queryString.find("?", pos); - std::stringstream replace; - - replace << '\''; + pos = queryString.find('?', pos); + std::stringstream ss; switch (m_stmt->statement_data[i].type) { case TYPE_BOOL: - replace << (m_stmt->statement_data[i].data.boolean ? '1' : '0'); + ss << uint16(m_stmt->statement_data[i].data.boolean); break; case TYPE_UI8: - replace << uint16(m_stmt->statement_data[i].data.ui8); // stringstream will append a character with that code instead of numeric representation + ss << uint16(m_stmt->statement_data[i].data.ui8); // stringstream will append a character with that code instead of numeric representation break; case TYPE_UI16: - replace << m_stmt->statement_data[i].data.ui16; + ss << m_stmt->statement_data[i].data.ui16; break; case TYPE_UI32: - replace << m_stmt->statement_data[i].data.ui32; + ss << m_stmt->statement_data[i].data.ui32; break; case TYPE_I8: - replace << int16(m_stmt->statement_data[i].data.i8); // stringstream will append a character with that code instead of numeric representation + ss << int16(m_stmt->statement_data[i].data.i8); // stringstream will append a character with that code instead of numeric representation break; case TYPE_I16: - replace << m_stmt->statement_data[i].data.i16; + ss << m_stmt->statement_data[i].data.i16; break; case TYPE_I32: - replace << m_stmt->statement_data[i].data.i32; + ss << m_stmt->statement_data[i].data.i32; break; case TYPE_UI64: - replace << m_stmt->statement_data[i].data.ui64; + ss << m_stmt->statement_data[i].data.ui64; break; case TYPE_I64: - replace << m_stmt->statement_data[i].data.i64; + ss << m_stmt->statement_data[i].data.i64; break; case TYPE_FLOAT: - replace << m_stmt->statement_data[i].data.f; + ss << m_stmt->statement_data[i].data.f; break; case TYPE_DOUBLE: - replace << m_stmt->statement_data[i].data.d; + ss << m_stmt->statement_data[i].data.d; break; case TYPE_STRING: - replace << m_stmt->statement_data[i].str; + ss << '\'' << m_stmt->statement_data[i].str << '\''; + break; + case TYPE_NULL: + ss << "NULL"; break; } - replace << '\''; - queryString.replace(pos, 1, replace.str()); + + std::string replaceStr = ss.str(); + queryString.replace(pos, 1, replaceStr); + pos += replaceStr.length(); } return queryString; diff --git a/src/server/shared/Database/PreparedStatement.h b/src/server/shared/Database/PreparedStatement.h index 90ea435d1f9..2cab6e40de0 100644 --- a/src/server/shared/Database/PreparedStatement.h +++ b/src/server/shared/Database/PreparedStatement.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -55,7 +55,8 @@ enum PreparedStatementValueType TYPE_I64, TYPE_FLOAT, TYPE_DOUBLE, - TYPE_STRING + TYPE_STRING, + TYPE_NULL }; struct PreparedStatementData @@ -91,6 +92,7 @@ class PreparedStatement void setFloat(const uint8 index, const float value); void setDouble(const uint8 index, const double value); void setString(const uint8 index, const std::string& value); + void setNull(const uint8 index); protected: void BindParameters(); @@ -125,6 +127,7 @@ class MySQLPreparedStatement void setFloat(const uint8 index, const float value); void setDouble(const uint8 index, const double value); void setString(const uint8 index, const char* value); + void setNull(const uint8 index); protected: MYSQL_STMT* GetSTMT() { return m_Mstmt; } @@ -132,7 +135,7 @@ class MySQLPreparedStatement PreparedStatement* m_stmt; void ClearParameters(); bool CheckValidIndex(uint8 index); - std::string getQueryString(const char *query); + std::string getQueryString(std::string const& sqlPattern) const; private: void setValue(MYSQL_BIND* param, enum_field_types type, const void* value, uint32 len, bool isUnsigned); diff --git a/src/server/shared/Database/QueryHolder.cpp b/src/server/shared/Database/QueryHolder.cpp index ed228c74667..38496860955 100644 --- a/src/server/shared/Database/QueryHolder.cpp +++ b/src/server/shared/Database/QueryHolder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Database/QueryHolder.h b/src/server/shared/Database/QueryHolder.h index 86b3b5955bd..fd2cbcacbcc 100644 --- a/src/server/shared/Database/QueryHolder.h +++ b/src/server/shared/Database/QueryHolder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Database/QueryResult.cpp b/src/server/shared/Database/QueryResult.cpp index cb21c088d00..1e2538664bd 100644 --- a/src/server/shared/Database/QueryResult.cpp +++ b/src/server/shared/Database/QueryResult.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Database/QueryResult.h b/src/server/shared/Database/QueryResult.h index be7fa7b649c..1a721ce9e96 100644 --- a/src/server/shared/Database/QueryResult.h +++ b/src/server/shared/Database/QueryResult.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Database/SQLOperation.h b/src/server/shared/Database/SQLOperation.h index 401535e39f7..0c000848477 100644 --- a/src/server/shared/Database/SQLOperation.h +++ b/src/server/shared/Database/SQLOperation.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Database/Transaction.cpp b/src/server/shared/Database/Transaction.cpp index 5aecda87797..a1c900a51b9 100644 --- a/src/server/shared/Database/Transaction.cpp +++ b/src/server/shared/Database/Transaction.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Database/Transaction.h b/src/server/shared/Database/Transaction.h index 805d48f76cf..026cc1fdf96 100644 --- a/src/server/shared/Database/Transaction.h +++ b/src/server/shared/Database/Transaction.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -29,6 +29,9 @@ class Transaction friend class TransactionTask; friend class MySQLConnection; + template <typename T> + friend class DatabaseWorkerPool; + public: Transaction() : _cleanedUp(false) {} ~Transaction() { Cleanup(); } @@ -65,4 +68,4 @@ class TransactionTask : public SQLOperation SQLTransaction m_trans; }; -#endif
\ No newline at end of file +#endif diff --git a/src/server/shared/Debugging/Errors.h b/src/server/shared/Debugging/Errors.h index 6ce3d926f4c..3d10740f149 100644 --- a/src/server/shared/Debugging/Errors.h +++ b/src/server/shared/Debugging/Errors.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Define.h b/src/server/shared/Define.h index 0f7c2163b7e..682167a96e3 100644 --- a/src/server/shared/Define.h +++ b/src/server/shared/Define.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Dynamic/FactoryHolder.h b/src/server/shared/Dynamic/FactoryHolder.h index 830e6d8b67d..f0b45a8924b 100644 --- a/src/server/shared/Dynamic/FactoryHolder.h +++ b/src/server/shared/Dynamic/FactoryHolder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Dynamic/HashNamespace.h b/src/server/shared/Dynamic/HashNamespace.h index c7b5a817b76..afb55ae0e00 100644 --- a/src/server/shared/Dynamic/HashNamespace.h +++ b/src/server/shared/Dynamic/HashNamespace.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Dynamic/LinkedList.h b/src/server/shared/Dynamic/LinkedList.h index 3969e22aa14..a7c230554e2 100644 --- a/src/server/shared/Dynamic/LinkedList.h +++ b/src/server/shared/Dynamic/LinkedList.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Dynamic/LinkedReference/RefManager.h b/src/server/shared/Dynamic/LinkedReference/RefManager.h index 1c6e6956dbd..e3a42b4bdc9 100644 --- a/src/server/shared/Dynamic/LinkedReference/RefManager.h +++ b/src/server/shared/Dynamic/LinkedReference/RefManager.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Dynamic/LinkedReference/Reference.h b/src/server/shared/Dynamic/LinkedReference/Reference.h index 22921b075fe..4c3630b175d 100644 --- a/src/server/shared/Dynamic/LinkedReference/Reference.h +++ b/src/server/shared/Dynamic/LinkedReference/Reference.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -20,7 +20,7 @@ #define _REFERENCE_H #include "Dynamic/LinkedList.h" -#include <assert.h> +#include "Errors.h" // for ASSERT //===================================================== @@ -45,7 +45,7 @@ template <class TO, class FROM> class Reference : public LinkedListElement // Create new link void link(TO* toObj, FROM* fromObj) { - assert(fromObj); // fromObj MUST not be NULL + ASSERT(fromObj); // fromObj MUST not be NULL if (isValid()) unlink(); if (toObj != NULL) diff --git a/src/server/shared/Dynamic/ObjectRegistry.h b/src/server/shared/Dynamic/ObjectRegistry.h index bb3227514a7..2d7f12b0069 100644 --- a/src/server/shared/Dynamic/ObjectRegistry.h +++ b/src/server/shared/Dynamic/ObjectRegistry.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Dynamic/TypeContainer.h b/src/server/shared/Dynamic/TypeContainer.h index 67789d8ff42..10d6ba324c4 100644 --- a/src/server/shared/Dynamic/TypeContainer.h +++ b/src/server/shared/Dynamic/TypeContainer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Dynamic/TypeContainerFunctions.h b/src/server/shared/Dynamic/TypeContainerFunctions.h index 5011ec1c1be..22f8be4ed5f 100644 --- a/src/server/shared/Dynamic/TypeContainerFunctions.h +++ b/src/server/shared/Dynamic/TypeContainerFunctions.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Dynamic/TypeContainerVisitor.h b/src/server/shared/Dynamic/TypeContainerVisitor.h index 155989f15f6..800a21bed5d 100644 --- a/src/server/shared/Dynamic/TypeContainerVisitor.h +++ b/src/server/shared/Dynamic/TypeContainerVisitor.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ template<class VISITOR, class TYPE_CONTAINER> void VisitorHelper(VISITOR &v, TYP } // terminate condition for container list -template<class VISITOR> void VisitorHelper(VISITOR &v, ContainerList<TypeNull> &c) +template<class VISITOR> void VisitorHelper(VISITOR &/*v*/, ContainerList<TypeNull> &/*c*/) { } diff --git a/src/server/shared/Dynamic/TypeList.h b/src/server/shared/Dynamic/TypeList.h index 4967ab0fbc0..f32a0ef1d64 100644 --- a/src/server/shared/Dynamic/TypeList.h +++ b/src/server/shared/Dynamic/TypeList.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Dynamic/UnorderedMap.h b/src/server/shared/Dynamic/UnorderedMap.h index 5d485efa89b..701e7f339e2 100644 --- a/src/server/shared/Dynamic/UnorderedMap.h +++ b/src/server/shared/Dynamic/UnorderedMap.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Dynamic/UnorderedSet.h b/src/server/shared/Dynamic/UnorderedSet.h index 8c8d7c0d5dc..862358e7fe7 100644 --- a/src/server/shared/Dynamic/UnorderedSet.h +++ b/src/server/shared/Dynamic/UnorderedSet.h @@ -1,20 +1,20 @@ /* -* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> -* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> -* -* 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 <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> + * + * 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 <http://www.gnu.org/licenses/>. + */ #ifndef TRINITY_UNORDERED_SET_H #define TRINITY_UNORDERED_SET_H diff --git a/src/server/shared/Logging/Appender.cpp b/src/server/shared/Logging/Appender.cpp index 0bfcc8abbd2..f2f5da53dae 100644 --- a/src/server/shared/Logging/Appender.cpp +++ b/src/server/shared/Logging/Appender.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Logging/Appender.h b/src/server/shared/Logging/Appender.h index 89d0016ce2b..6a0f0bdac26 100644 --- a/src/server/shared/Logging/Appender.h +++ b/src/server/shared/Logging/Appender.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Logging/AppenderConsole.cpp b/src/server/shared/Logging/AppenderConsole.cpp index be6dc6c807f..d0af761188c 100644 --- a/src/server/shared/Logging/AppenderConsole.cpp +++ b/src/server/shared/Logging/AppenderConsole.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Logging/AppenderConsole.h b/src/server/shared/Logging/AppenderConsole.h index ad7d9543cdb..3319c84e887 100644 --- a/src/server/shared/Logging/AppenderConsole.h +++ b/src/server/shared/Logging/AppenderConsole.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Logging/AppenderDB.cpp b/src/server/shared/Logging/AppenderDB.cpp index d85a4db9f7a..86677eeedd8 100644 --- a/src/server/shared/Logging/AppenderDB.cpp +++ b/src/server/shared/Logging/AppenderDB.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -18,8 +18,8 @@ #include "AppenderDB.h" #include "Database/DatabaseEnv.h" -AppenderDB::AppenderDB(uint8 id, std::string const& name, LogLevel level, uint8 realmId): -Appender(id, name, APPENDER_DB, level), realm(realmId), enable(false) +AppenderDB::AppenderDB(uint8 id, std::string const& name, LogLevel level, uint32 realmId) + : Appender(id, name, APPENDER_DB, level), realm(realmId), enable(false) { } @@ -41,8 +41,8 @@ void AppenderDB::_write(LogMessage& message) PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_LOG); stmt->setUInt64(0, message.mtime); stmt->setUInt32(1, realm); - stmt->setUInt8(2, message.type); - stmt->setUInt8(3, message.level); + stmt->setUInt8(2, uint8(message.type)); + stmt->setUInt8(3, uint8(message.level)); stmt->setString(4, message.text); LoginDatabase.Execute(stmt); break; diff --git a/src/server/shared/Logging/AppenderDB.h b/src/server/shared/Logging/AppenderDB.h index 4399195b181..5ab9a1ee423 100644 --- a/src/server/shared/Logging/AppenderDB.h +++ b/src/server/shared/Logging/AppenderDB.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -23,12 +23,12 @@ class AppenderDB: public Appender { public: - AppenderDB(uint8 _id, std::string const& _name, LogLevel level, uint8 realmId); + AppenderDB(uint8 _id, std::string const& _name, LogLevel level, uint32 realmId); ~AppenderDB(); void setEnable(bool enable); private: - uint8 realm; + uint32 realm; bool enable; void _write(LogMessage& message); }; diff --git a/src/server/shared/Logging/AppenderFile.cpp b/src/server/shared/Logging/AppenderFile.cpp index 67adff39aae..7b0bac03d03 100644 --- a/src/server/shared/Logging/AppenderFile.cpp +++ b/src/server/shared/Logging/AppenderFile.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Logging/AppenderFile.h b/src/server/shared/Logging/AppenderFile.h index e9cb858f625..934370d70b4 100644 --- a/src/server/shared/Logging/AppenderFile.h +++ b/src/server/shared/Logging/AppenderFile.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index d8914ac8ee0..4048f056f46 100644 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -169,7 +169,7 @@ void Log::CreateLoggerFromConfig(const char* name) return; LogLevel level = LOG_LEVEL_DISABLED; - int32 type = -1; + uint8 type = uint8(-1); std::string options = "Logger."; options.append(name); @@ -190,7 +190,7 @@ void Log::CreateLoggerFromConfig(const char* name) return; } - type = atoi(*iter); + type = uint8(atoi(*iter)); if (type > MaxLogFilter) { fprintf(stderr, "Log::CreateLoggerFromConfig: Wrong type %u for logger %s\n", type, name); @@ -334,7 +334,7 @@ bool Log::SetLogLevel(std::string const& name, const char* newLevelc, bool isLog bool Log::ShouldLog(LogFilterType type, LogLevel level) const { - LoggerMap::const_iterator it = loggers.find(type); + LoggerMap::const_iterator it = loggers.find(uint8(type)); if (it != loggers.end()) { LogLevel loggerLevel = it->second.getLogLevel(); diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h index b66e774b527..26fcc40c5e0 100644 --- a/src/server/shared/Logging/Log.h +++ b/src/server/shared/Logging/Log.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Logging/LogOperation.cpp b/src/server/shared/Logging/LogOperation.cpp index b36dd3a8b1e..f3d3649aa97 100644 --- a/src/server/shared/Logging/LogOperation.cpp +++ b/src/server/shared/Logging/LogOperation.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Logging/LogOperation.h b/src/server/shared/Logging/LogOperation.h index d872670d756..0a0dde3bb61 100644 --- a/src/server/shared/Logging/LogOperation.h +++ b/src/server/shared/Logging/LogOperation.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Logging/LogWorker.cpp b/src/server/shared/Logging/LogWorker.cpp index a12faaf224c..857deb926fe 100644 --- a/src/server/shared/Logging/LogWorker.cpp +++ b/src/server/shared/Logging/LogWorker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Logging/LogWorker.h b/src/server/shared/Logging/LogWorker.h index ea1744f9790..78571b596d7 100644 --- a/src/server/shared/Logging/LogWorker.h +++ b/src/server/shared/Logging/LogWorker.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Logging/Logger.cpp b/src/server/shared/Logging/Logger.cpp index 10276eb3acb..641a9ea1a4b 100644 --- a/src/server/shared/Logging/Logger.cpp +++ b/src/server/shared/Logging/Logger.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Logging/Logger.h b/src/server/shared/Logging/Logger.h index 9d13f08620f..46436a8022e 100644 --- a/src/server/shared/Logging/Logger.h +++ b/src/server/shared/Logging/Logger.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index c03c1a4572a..5553b04f461 100644 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Packets/WorldPacket.h b/src/server/shared/Packets/WorldPacket.h index 7ab95bc496d..7ec2b5d1e1e 100644 --- a/src/server/shared/Packets/WorldPacket.h +++ b/src/server/shared/Packets/WorldPacket.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/SystemConfig.h b/src/server/shared/SystemConfig.h index 2431ebb7165..a6076273522 100644 --- a/src/server/shared/SystemConfig.h +++ b/src/server/shared/SystemConfig.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Threading/Callback.h b/src/server/shared/Threading/Callback.h index 3e1e7ac692f..f6bc1581857 100644 --- a/src/server/shared/Threading/Callback.h +++ b/src/server/shared/Threading/Callback.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/shared/Threading/LockedQueue.h b/src/server/shared/Threading/LockedQueue.h index 7f78dc07db8..d356d01606f 100644 --- a/src/server/shared/Threading/LockedQueue.h +++ b/src/server/shared/Threading/LockedQueue.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Threading/Threading.cpp b/src/server/shared/Threading/Threading.cpp index f31db8fbdcd..bd96c359616 100644 --- a/src/server/shared/Threading/Threading.cpp +++ b/src/server/shared/Threading/Threading.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Threading/Threading.h b/src/server/shared/Threading/Threading.h index 7cc74574873..3f2c121d666 100644 --- a/src/server/shared/Threading/Threading.h +++ b/src/server/shared/Threading/Threading.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Utilities/ByteConverter.h b/src/server/shared/Utilities/ByteConverter.h index 05e8b8cc959..ffa467bb812 100644 --- a/src/server/shared/Utilities/ByteConverter.h +++ b/src/server/shared/Utilities/ByteConverter.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Utilities/EventProcessor.cpp b/src/server/shared/Utilities/EventProcessor.cpp index b4f67471323..aeb67869882 100644 --- a/src/server/shared/Utilities/EventProcessor.cpp +++ b/src/server/shared/Utilities/EventProcessor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Utilities/EventProcessor.h b/src/server/shared/Utilities/EventProcessor.h index 0f1a7c15216..69e14b98484 100644 --- a/src/server/shared/Utilities/EventProcessor.h +++ b/src/server/shared/Utilities/EventProcessor.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Utilities/ServiceWin32.cpp b/src/server/shared/Utilities/ServiceWin32.cpp index 390b1a35010..3a49eace3aa 100644 --- a/src/server/shared/Utilities/ServiceWin32.cpp +++ b/src/server/shared/Utilities/ServiceWin32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Utilities/ServiceWin32.h b/src/server/shared/Utilities/ServiceWin32.h index f810a0e5624..bc2917d4bcb 100644 --- a/src/server/shared/Utilities/ServiceWin32.h +++ b/src/server/shared/Utilities/ServiceWin32.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Utilities/SignalHandler.h b/src/server/shared/Utilities/SignalHandler.h index a478c1f58d9..8b49d586dcd 100644 --- a/src/server/shared/Utilities/SignalHandler.h +++ b/src/server/shared/Utilities/SignalHandler.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Utilities/Timer.h b/src/server/shared/Utilities/Timer.h index 4d3f02f6688..5bc19a2b779 100644 --- a/src/server/shared/Utilities/Timer.h +++ b/src/server/shared/Utilities/Timer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp index 407d0704619..0d9314c48a3 100644 --- a/src/server/shared/Utilities/Util.cpp +++ b/src/server/shared/Utilities/Util.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -20,6 +20,7 @@ #include "Common.h" #include "utf8.h" #include "SFMT.h" +#include "Errors.h" // for ASSERT #include <ace/TSS_T.h> #include <ace/INET_Addr.h> @@ -28,19 +29,19 @@ static SFMTRandTSS sfmtRand; int32 irand(int32 min, int32 max) { - assert(max >= min); + ASSERT(max >= min); return int32(sfmtRand->IRandom(min, max)); } uint32 urand(uint32 min, uint32 max) { - assert(max >= min); + ASSERT(max >= min); return sfmtRand->URandom(min, max); } float frand(float min, float max) { - assert(max >= min); + ASSERT(max >= min); return float(sfmtRand->Random() * (max - min) + min); } @@ -163,9 +164,9 @@ int32 MoneyStringToMoney(const std::string& moneyString) for (Tokenizer::const_iterator itr = tokens.begin(); itr != tokens.end(); ++itr) { std::string tokenString(*itr); - uint32 gCount = std::count(tokenString.begin(), tokenString.end(), 'g'); - uint32 sCount = std::count(tokenString.begin(), tokenString.end(), 's'); - uint32 cCount = std::count(tokenString.begin(), tokenString.end(), 'c'); + size_t gCount = std::count(tokenString.begin(), tokenString.end(), 'g'); + size_t sCount = std::count(tokenString.begin(), tokenString.end(), 's'); + size_t cCount = std::count(tokenString.begin(), tokenString.end(), 'c'); if (gCount + sCount + cCount != 1) return 0; diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index f46fc991cc7..10c2e866a7d 100644 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -352,11 +352,6 @@ std::string ByteArrayToHexStr(uint8 const* bytes, uint32 length, bool reverse = #ifndef _FLAG96 #define _FLAG96 -#ifndef PAIR64_HIPART -#define PAIR64_HIPART(x) (uint32)((uint64(x) >> 32) & UI64LIT(0x00000000FFFFFFFF)) -#define PAIR64_LOPART(x) (uint32)(uint64(x) & UI64LIT(0x00000000FFFFFFFF)) -#endif - // simple class for not-modifyable list template <typename T> class HookList @@ -404,8 +399,8 @@ public: flag96(uint64 p1, uint32 p2) { - part[0] = PAIR64_LOPART(p1); - part[1] = PAIR64_HIPART(p1); + part[0] = (uint32)(p1 & UI64LIT(0x00000000FFFFFFFF)); + part[1] = (uint32)((p1 >> 32) & UI64LIT(0x00000000FFFFFFFF)); part[2] = p2; } diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt index 556edb5a2c7..413d6487480 100644 --- a/src/server/worldserver/CMakeLists.txt +++ b/src/server/worldserver/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # 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/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index 23eeca11f66..66740f18cce 100644 --- a/src/server/worldserver/CommandLine/CliRunnable.cpp +++ b/src/server/worldserver/CommandLine/CliRunnable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/worldserver/CommandLine/CliRunnable.h b/src/server/worldserver/CommandLine/CliRunnable.h index af5691367b3..bd14413ef2e 100644 --- a/src/server/worldserver/CommandLine/CliRunnable.h +++ b/src/server/worldserver/CommandLine/CliRunnable.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index 16fbca2597d..5287847fa6f 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index 7587a9d1904..fe872c1977f 100644 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -254,7 +254,7 @@ int Master::Run() } ///- Launch the world listener socket - uint16 wsport = sWorld->getIntConfig(CONFIG_PORT_WORLD); + uint16 wsport = uint16(sWorld->getIntConfig(CONFIG_PORT_WORLD)); std::string bind_ip = ConfigMgr::GetStringDefault("BindIP", "0.0.0.0"); if (sWorldSocketMgr->StartNetwork(wsport, bind_ip.c_str()) == -1) @@ -364,7 +364,7 @@ bool Master::_StartDB() return false; } - async_threads = ConfigMgr::GetIntDefault("WorldDatabase.WorkerThreads", 1); + async_threads = uint8(ConfigMgr::GetIntDefault("WorldDatabase.WorkerThreads", 1)); if (async_threads < 1 || async_threads > 32) { sLog->outError(LOG_FILTER_WORLDSERVER, "World database: invalid number of worker threads specified. " @@ -372,7 +372,7 @@ bool Master::_StartDB() return false; } - synch_threads = ConfigMgr::GetIntDefault("WorldDatabase.SynchThreads", 1); + synch_threads = uint8(ConfigMgr::GetIntDefault("WorldDatabase.SynchThreads", 1)); ///- Initialise the world database if (!WorldDatabase.Open(dbstring, async_threads, synch_threads)) { @@ -388,7 +388,7 @@ bool Master::_StartDB() return false; } - async_threads = ConfigMgr::GetIntDefault("CharacterDatabase.WorkerThreads", 1); + async_threads = uint8(ConfigMgr::GetIntDefault("CharacterDatabase.WorkerThreads", 1)); if (async_threads < 1 || async_threads > 32) { sLog->outError(LOG_FILTER_WORLDSERVER, "Character database: invalid number of worker threads specified. " @@ -396,7 +396,7 @@ bool Master::_StartDB() return false; } - synch_threads = ConfigMgr::GetIntDefault("CharacterDatabase.SynchThreads", 2); + synch_threads = uint8(ConfigMgr::GetIntDefault("CharacterDatabase.SynchThreads", 2)); ///- Initialise the Character database if (!CharacterDatabase.Open(dbstring, async_threads, synch_threads)) @@ -413,7 +413,7 @@ bool Master::_StartDB() return false; } - async_threads = ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1); + async_threads = uint8(ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1)); if (async_threads < 1 || async_threads > 32) { sLog->outError(LOG_FILTER_WORLDSERVER, "Login database: invalid number of worker threads specified. " @@ -421,7 +421,7 @@ bool Master::_StartDB() return false; } - synch_threads = ConfigMgr::GetIntDefault("LoginDatabase.SynchThreads", 1); + synch_threads = uint8(ConfigMgr::GetIntDefault("LoginDatabase.SynchThreads", 1)); ///- Initialise the login database if (!LoginDatabase.Open(dbstring, async_threads, synch_threads)) { diff --git a/src/server/worldserver/Master.h b/src/server/worldserver/Master.h index 548cd02c64a..4f07c24e8f8 100644 --- a/src/server/worldserver/Master.h +++ b/src/server/worldserver/Master.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/worldserver/RemoteAccess/RARunnable.cpp b/src/server/worldserver/RemoteAccess/RARunnable.cpp index 7a1fff51afd..8d57ef6c3b2 100644 --- a/src/server/worldserver/RemoteAccess/RARunnable.cpp +++ b/src/server/worldserver/RemoteAccess/RARunnable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 @@ -35,7 +35,7 @@ RARunnable::RARunnable() { - ACE_Reactor_Impl* imp = NULL; + ACE_Reactor_Impl* imp; #if defined (ACE_HAS_EVENT_POLL) || defined (ACE_HAS_DEV_POLL) imp = new ACE_Dev_Poll_Reactor(); @@ -61,7 +61,7 @@ void RARunnable::run() ACE_Acceptor<RASocket, ACE_SOCK_ACCEPTOR> acceptor; - uint16 raport = ConfigMgr::GetIntDefault("Ra.Port", 3443); + uint16 raport = uint16(ConfigMgr::GetIntDefault("Ra.Port", 3443)); std::string stringip = ConfigMgr::GetStringDefault("Ra.IP", "0.0.0.0"); ACE_INET_Addr listen_addr(raport, stringip.c_str()); diff --git a/src/server/worldserver/RemoteAccess/RARunnable.h b/src/server/worldserver/RemoteAccess/RARunnable.h index 9b3e93cc5fa..6597e7c742f 100644 --- a/src/server/worldserver/RemoteAccess/RARunnable.h +++ b/src/server/worldserver/RemoteAccess/RARunnable.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp index 18c90aa5ba5..75c95d5ea98 100644 --- a/src/server/worldserver/RemoteAccess/RASocket.cpp +++ b/src/server/worldserver/RemoteAccess/RASocket.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ RASocket::RASocket() { - _minLevel = ConfigMgr::GetIntDefault("RA.MinLevel", 3); + _minLevel = uint8(ConfigMgr::GetIntDefault("RA.MinLevel", 3)); } RASocket::~RASocket() @@ -332,7 +332,7 @@ int RASocket::subnegotiate() //! Just send back end of subnegotiation packet uint8 const reply[2] = {0xFF, 0xF0}; - return peer().send(reply, 2); + return int(peer().send(reply, 2)); } int RASocket::svc(void) diff --git a/src/server/worldserver/RemoteAccess/RASocket.h b/src/server/worldserver/RemoteAccess/RASocket.h index 450245a0ff4..d23d1f0d5fd 100644 --- a/src/server/worldserver/RemoteAccess/RASocket.h +++ b/src/server/worldserver/RemoteAccess/RASocket.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/worldserver/TCSoap/TCSoap.cpp b/src/server/worldserver/TCSoap/TCSoap.cpp index 40b35df9aee..5d578a19124 100644 --- a/src/server/worldserver/TCSoap/TCSoap.cpp +++ b/src/server/worldserver/TCSoap/TCSoap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/worldserver/TCSoap/TCSoap.h b/src/server/worldserver/TCSoap/TCSoap.h index 51ffb3a91c8..ccdc7b1f89f 100644 --- a/src/server/worldserver/TCSoap/TCSoap.h +++ b/src/server/worldserver/TCSoap/TCSoap.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/server/worldserver/WorldThread/WorldRunnable.cpp b/src/server/worldserver/WorldThread/WorldRunnable.cpp index 42cfaae41ec..01208e3ef3a 100644 --- a/src/server/worldserver/WorldThread/WorldRunnable.cpp +++ b/src/server/worldserver/WorldThread/WorldRunnable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/worldserver/WorldThread/WorldRunnable.h b/src/server/worldserver/WorldThread/WorldRunnable.h index 31ae51f064d..38fc96a9f9f 100644 --- a/src/server/worldserver/WorldThread/WorldRunnable.h +++ b/src/server/worldserver/WorldThread/WorldRunnable.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index fafc1362cad..68cf3994e3b 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -280,15 +280,6 @@ vmap.enableLOS = 1 vmap.enableHeight = 1 # -# vmap.ignoreSpellIds -# Description: These spells are ignored for LoS calculation. -# List of ids with delimiter ','. -# Example: "7720,1337" -# Default: "7720" - -vmap.ignoreSpellIds = "7720" - -# # vmap.petLOS # Description: Check line of sight for pets, to avoid them attacking through walls. # Default: 1 - (Enabled, each pet attack will be checked for line of sight) diff --git a/src/server/worldserver/worldserver.rc b/src/server/worldserver/worldserver.rc index 2f778e599a1..c2e5d5e168e 100644 --- a/src/server/worldserver/worldserver.rc +++ b/src/server/worldserver/worldserver.rc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index a956655ffaa..0386f27d3df 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # 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/tools/map_extractor/CMakeLists.txt b/src/tools/map_extractor/CMakeLists.txt index 55a136f6329..9fb8d5713d7 100644 --- a/src/tools/map_extractor/CMakeLists.txt +++ b/src/tools/map_extractor/CMakeLists.txt @@ -1,5 +1,5 @@ # Copyright (C) 2005-2009 MaNGOS project <http://getmangos.com/> -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # 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/tools/vmap4_assembler/CMakeLists.txt b/src/tools/vmap4_assembler/CMakeLists.txt index e4f57646c49..55b6514d091 100644 --- a/src/tools/vmap4_assembler/CMakeLists.txt +++ b/src/tools/vmap4_assembler/CMakeLists.txt @@ -1,5 +1,5 @@ # Copyright (C) 2005-2009 MaNGOS project <http://getmangos.com/> -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # 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/tools/vmap4_extractor/CMakeLists.txt b/src/tools/vmap4_extractor/CMakeLists.txt index 5c98d84eb17..19798e46475 100644 --- a/src/tools/vmap4_extractor/CMakeLists.txt +++ b/src/tools/vmap4_extractor/CMakeLists.txt @@ -1,5 +1,5 @@ # Copyright (C) 2005-2009 MaNGOS project <http://getmangos.com/> -# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> +# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> # # 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/tools/vmap4_extractor/model.cpp b/src/tools/vmap4_extractor/model.cpp index 57f9b421dbe..c642f73ccae 100644 --- a/src/tools/vmap4_extractor/model.cpp +++ b/src/tools/vmap4_extractor/model.cpp @@ -77,8 +77,7 @@ bool Model::ConvertToVMAPModel(const char * outfilename) return false; } fwrite(szRawVMAPMagic, 8, 1, output); - uint32 nVertices = 0; - nVertices = header.nBoundingVertices; + uint32 nVertices = header.nBoundingVertices; fwrite(&nVertices, sizeof(int), 1, output); uint32 nofgroups = 1; fwrite(&nofgroups,sizeof(uint32), 1, output); @@ -91,8 +90,7 @@ bool Model::ConvertToVMAPModel(const char * outfilename) wsize = sizeof(branches) + sizeof(uint32) * branches; fwrite(&wsize, sizeof(int), 1, output); fwrite(&branches,sizeof(branches), 1, output); - uint32 nIndexes = 0; - nIndexes = header.nBoundingTriangles; + uint32 nIndexes = header.nBoundingTriangles; fwrite(&nIndexes,sizeof(uint32), 1, output); fwrite("INDX",4, 1, output); wsize = sizeof(uint32) + sizeof(unsigned short) * nIndexes; diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp index 40a22a2a6e0..186f9c8606e 100644 --- a/src/tools/vmap4_extractor/vmapexport.cpp +++ b/src/tools/vmap4_extractor/vmapexport.cpp @@ -470,7 +470,7 @@ int main(int argc, char ** argv) //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx // Create the working directory if (mkdir(szWorkDirWmo -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) , 0711 #endif )) |
