Core: header cleanup, split realmlist, boost compatibility, cotire, remove stormlib/zlib and stormlib/bzip2 and instead use dep sources
This commit is contained in:
1 parent
7fff6c424f
commit
5ff847159c
1243 files changed
+29780
-36517
No files matched your search
@@ -22,14 +22,17 @@ Comment: All learn related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "Chat.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "DBCStores.h"
|
||||
#include "Language.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "Player.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Pet.h"
|
||||
#include "Player.h"
|
||||
#include "RBAC.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class learn_commandscript : public CommandScript
|
||||
{
|
||||
@@ -48,7 +51,7 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> learnAllCommandTable =
|
||||
{
|
||||
{ "my", rbac::RBAC_PERM_COMMAND_LEARN_ALL_MY, false, NULL, "", learnAllMyCommandTable },
|
||||
{ "my", rbac::RBAC_PERM_COMMAND_LEARN_ALL_MY, false, nullptr, "", learnAllMyCommandTable },
|
||||
{ "gm", rbac::RBAC_PERM_COMMAND_LEARN_ALL_GM, false, &HandleLearnAllGMCommand, "" },
|
||||
{ "crafts", rbac::RBAC_PERM_COMMAND_LEARN_ALL_CRAFTS, false, &HandleLearnAllCraftsCommand, "" },
|
||||
{ "default", rbac::RBAC_PERM_COMMAND_LEARN_ALL_DEFAULT, false, &HandleLearnAllDefaultCommand, "" },
|
||||
@@ -58,13 +61,13 @@ public:
|
||||
|
||||
static std::vector<ChatCommand> learnCommandTable =
|
||||
{
|
||||
{ "all", rbac::RBAC_PERM_COMMAND_LEARN_ALL, false, NULL, "", learnAllCommandTable },
|
||||
{ "all", rbac::RBAC_PERM_COMMAND_LEARN_ALL, false, nullptr, "", learnAllCommandTable },
|
||||
{ "", rbac::RBAC_PERM_COMMAND_LEARN, false, &HandleLearnCommand, "" },
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "learn", rbac::RBAC_PERM_COMMAND_LEARN, false, NULL, "", learnCommandTable },
|
||||
{ "learn", rbac::RBAC_PERM_COMMAND_LEARN, false, nullptr, "", learnCommandTable },
|
||||
{ "unlearn", rbac::RBAC_PERM_COMMAND_UNLEARN, false, &HandleUnLearnCommand, "" },
|
||||
};
|
||||
return commandTable;
|
||||
@@ -86,7 +89,7 @@ public:
|
||||
if (!spell || !sSpellMgr->GetSpellInfo(spell))
|
||||
return false;
|
||||
|
||||
char const* all = strtok(NULL, " ");
|
||||
char const* all = strtok(nullptr, " ");
|
||||
bool allRanks = all ? (strncmp(all, "all", strlen(all)) == 0) : false;
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell);
|
||||
@@ -150,12 +153,8 @@ public:
|
||||
return true;
|
||||
uint32 family = classEntry->spellfamily;
|
||||
|
||||
for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i)
|
||||
for (SkillLineAbilityEntry const* entry : sSkillLineAbilityStore)
|
||||
{
|
||||
SkillLineAbilityEntry const* entry = sSkillLineAbilityStore.LookupEntry(i);
|
||||
if (!entry)
|
||||
continue;
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(entry->spellId);
|
||||
if (!spellInfo)
|
||||
continue;
|
||||
@@ -192,12 +191,8 @@ public:
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
uint32 classMask = player->getClassMask();
|
||||
|
||||
for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
|
||||
for (TalentEntry const* talentInfo : sTalentStore)
|
||||
{
|
||||
TalentEntry const* talentInfo = sTalentStore.LookupEntry(i);
|
||||
if (!talentInfo)
|
||||
continue;
|
||||
|
||||
TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
|
||||
if (!talentTabInfo)
|
||||
continue;
|
||||
@@ -269,12 +264,8 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
|
||||
for (TalentEntry const* talentInfo : sTalentStore)
|
||||
{
|
||||
TalentEntry const* talentInfo = sTalentStore.LookupEntry(i);
|
||||
if (!talentInfo)
|
||||
continue;
|
||||
|
||||
TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
|
||||
if (!talentTabInfo)
|
||||
continue;
|
||||
@@ -286,7 +277,7 @@ public:
|
||||
// search highest talent rank
|
||||
uint32 spellId = 0;
|
||||
|
||||
for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
|
||||
for (int8 rank = MAX_TALENT_RANK - 1; rank >= 0; --rank)
|
||||
{
|
||||
if (talentInfo->RankID[rank] != 0)
|
||||
{
|
||||
@@ -314,9 +305,9 @@ public:
|
||||
|
||||
static bool HandleLearnAllLangCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
// skipping UNIVERSAL language (0)
|
||||
for (uint8 i = 1; i < LANGUAGES_COUNT; ++i)
|
||||
handler->GetSession()->GetPlayer()->LearnSpell(lang_description[i].spell_id, false);
|
||||
for (LanguageDesc const& langDesc : lang_description)
|
||||
if (uint32 langSpellId = langDesc.spell_id)
|
||||
handler->GetSession()->GetPlayer()->LearnSpell(langSpellId, false);
|
||||
|
||||
handler->SendSysMessage(LANG_COMMAND_LEARN_ALL_LANG);
|
||||
return true;
|
||||
@@ -384,7 +375,7 @@ public:
|
||||
|
||||
std::string name;
|
||||
|
||||
SkillLineEntry const* targetSkillInfo = NULL;
|
||||
SkillLineEntry const* targetSkillInfo = nullptr;
|
||||
for (uint32 i = 1; i < sSkillLineStore.GetNumRows(); ++i)
|
||||
{
|
||||
SkillLineEntry const* skillInfo = sSkillLineStore.LookupEntry(i);
|
||||
@@ -421,12 +412,8 @@ public:
|
||||
{
|
||||
uint32 classmask = player->getClassMask();
|
||||
|
||||
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
|
||||
for (SkillLineAbilityEntry const* skillLine : sSkillLineAbilityStore)
|
||||
{
|
||||
SkillLineAbilityEntry const* skillLine = sSkillLineAbilityStore.LookupEntry(j);
|
||||
if (!skillLine)
|
||||
continue;
|
||||
|
||||
// wrong skill
|
||||
if (skillLine->skillId != skillId)
|
||||
continue;
|
||||
@@ -461,7 +448,7 @@ public:
|
||||
if (!spellId)
|
||||
return false;
|
||||
|
||||
char const* allStr = strtok(NULL, " ");
|
||||
char const* allStr = strtok(nullptr, " ");
|
||||
bool allRanks = allStr ? (strncmp(allStr, "all", strlen(allStr)) == 0) : false;
|
||||
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
|
||||
Reference in new issue
Block a user