diff options
| author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-08-06 10:03:44 +0200 |
|---|---|---|
| committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-08-06 10:03:44 +0200 |
| commit | 820f002135c03fb200488756479d878430019caa (patch) | |
| tree | 9312532f983f477b2337bc55a70291fb03a444ed /src | |
| parent | 7b2ee373b14d9b37919804ec68e92567acd763c0 (diff) | |
| parent | dc8385f4c0e192e037924e1d2c29be200fffc0d7 (diff) | |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/game/Miscellaneous/SharedDefines.h
src/server/scripts/Commands/cs_reload.cpp
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 3 | ||||
| -rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 32 | ||||
| -rw-r--r-- | src/server/game/Globals/ObjectMgr.h | 18 | ||||
| -rw-r--r-- | src/server/game/Miscellaneous/SharedDefines.h | 1 | ||||
| -rw-r--r-- | src/server/game/World/World.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_npc.cpp | 12 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_reload.cpp | 44 |
7 files changed, 56 insertions, 58 deletions
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 7602663296a..27fb8e83546 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -640,7 +640,8 @@ enum UnitFlags UNIT_FLAG_UNK_28 = 0x10000000, UNIT_FLAG_UNK_29 = 0x20000000, // used in Feing Death spell UNIT_FLAG_SHEATHE = 0x40000000, - UNIT_FLAG_UNK_31 = 0x80000000 + UNIT_FLAG_UNK_31 = 0x80000000, + MAX_UNIT_FLAGS = 33 }; // Value masks for UNIT_FIELD_FLAGS_2 diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 1e98c7d3d3a..038a3147ab6 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -7220,59 +7220,59 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string const& TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest relations from %s in %u ms", count, table.c_str(), GetMSTimeDiffToNow(oldMSTime)); } -void ObjectMgr::LoadGameobjectQuestRelations() +void ObjectMgr::LoadGameobjectQuestStarters() { - LoadQuestRelationsHelper(_goQuestRelations, "gameobject_questrelation", true, true); + LoadQuestRelationsHelper(_goQuestRelations, "gameobject_queststarter", true, true); for (QuestRelations::iterator itr = _goQuestRelations.begin(); itr != _goQuestRelations.end(); ++itr) { GameObjectTemplate const* goInfo = GetGameObjectTemplate(itr->first); if (!goInfo) - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject_questrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second); + TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject_queststarter` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second); else if (goInfo->type != GAMEOBJECT_TYPE_QUESTGIVER) - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject_questrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second); + TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject_queststarter` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second); } } -void ObjectMgr::LoadGameobjectInvolvedRelations() +void ObjectMgr::LoadGameobjectQuestEnders() { - LoadQuestRelationsHelper(_goQuestInvolvedRelations, "gameobject_involvedrelation", false, true); + LoadQuestRelationsHelper(_goQuestInvolvedRelations, "gameobject_questender", false, true); for (QuestRelations::iterator itr = _goQuestInvolvedRelations.begin(); itr != _goQuestInvolvedRelations.end(); ++itr) { GameObjectTemplate const* goInfo = GetGameObjectTemplate(itr->first); if (!goInfo) - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject_involvedrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second); + TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject_questender` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second); else if (goInfo->type != GAMEOBJECT_TYPE_QUESTGIVER) - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject_involvedrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second); + TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject_questender` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second); } } -void ObjectMgr::LoadCreatureQuestRelations() +void ObjectMgr::LoadCreatureQuestStarters() { - LoadQuestRelationsHelper(_creatureQuestRelations, "creature_questrelation", true, false); + LoadQuestRelationsHelper(_creatureQuestRelations, "creature_queststarter", true, false); for (QuestRelations::iterator itr = _creatureQuestRelations.begin(); itr != _creatureQuestRelations.end(); ++itr) { CreatureTemplate const* cInfo = GetCreatureTemplate(itr->first); if (!cInfo) - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `creature_questrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second); + TC_LOG_ERROR(LOG_FILTER_SQL, "Table `creature_queststarter` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second); else if (!(cInfo->npcflag & UNIT_NPC_FLAG_QUESTGIVER)) - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `creature_questrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); + TC_LOG_ERROR(LOG_FILTER_SQL, "Table `creature_queststarter` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); } } -void ObjectMgr::LoadCreatureInvolvedRelations() +void ObjectMgr::LoadCreatureQuestEnders() { - LoadQuestRelationsHelper(_creatureQuestInvolvedRelations, "creature_involvedrelation", false, false); + LoadQuestRelationsHelper(_creatureQuestInvolvedRelations, "creature_questender", false, false); for (QuestRelations::iterator itr = _creatureQuestInvolvedRelations.begin(); itr != _creatureQuestInvolvedRelations.end(); ++itr) { CreatureTemplate const* cInfo = GetCreatureTemplate(itr->first); if (!cInfo) - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `creature_involvedrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second); + TC_LOG_ERROR(LOG_FILTER_SQL, "Table `creature_questender` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second); else if (!(cInfo->npcflag & UNIT_NPC_FLAG_QUESTGIVER)) - TC_LOG_ERROR(LOG_FILTER_SQL, "Table `creature_involvedrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); + TC_LOG_ERROR(LOG_FILTER_SQL, "Table `creature_questender` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); } } diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 5cbad8c6ebc..4779700c092 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -847,21 +847,21 @@ class ObjectMgr } void LoadQuests(); - void LoadQuestRelations() + void LoadQuestStartersAndEnders() { TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading GO Start Quest Data..."); - LoadGameobjectQuestRelations(); + LoadGameobjectQuestStarters(); TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading GO End Quest Data..."); - LoadGameobjectInvolvedRelations(); + LoadGameobjectQuestEnders(); TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading Creature Start Quest Data..."); - LoadCreatureQuestRelations(); + LoadCreatureQuestStarters(); TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading Creature End Quest Data..."); - LoadCreatureInvolvedRelations(); + LoadCreatureQuestEnders(); } - void LoadGameobjectQuestRelations(); - void LoadGameobjectInvolvedRelations(); - void LoadCreatureQuestRelations(); - void LoadCreatureInvolvedRelations(); + void LoadGameobjectQuestStarters(); + void LoadGameobjectQuestEnders(); + void LoadCreatureQuestStarters(); + void LoadCreatureQuestEnders(); QuestRelations* GetGOQuestRelationMap() { diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 5ca07c095aa..b671c03c63f 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -1431,6 +1431,7 @@ enum Mechanics MECHANIC_SAPPED = 30, MECHANIC_ENRAGED = 31, MECHANIC_WOUNDED = 32, + MAX_MECHANIC = 33 }; // Used for spell 42292 Immune Movement Impairment and Loss of Control (0x49967ca6) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 622ac03eac8..f6001e2ac7a 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1510,8 +1510,8 @@ void World::SetInitialWorldSettings() TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading Quest POI"); sObjectMgr->LoadQuestPOI(); - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading Quests Relations..."); - sObjectMgr->LoadQuestRelations(); // must be after quest load + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading Quests Starters and Enders..."); + sObjectMgr->LoadQuestStartersAndEnders(); // must be after quest load TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading Objects Pooling Data..."); sPoolMgr->LoadFromDB(); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 99446c1f1ca..56610c1ea29 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -75,9 +75,7 @@ struct MechanicImmune char const* text; }; -#define MECHANIC_MAX 33 - -MechanicImmune const mechanicImmunes[MECHANIC_MAX] = +MechanicImmune const mechanicImmunes[MAX_MECHANIC] = { { MECHANIC_NONE , "MECHANIC_NONE" }, { MECHANIC_CHARM , "MECHANIC_CHARM" }, @@ -121,9 +119,7 @@ struct UnitFlag char const* text; }; -#define UNIT_FLAGS_MAX 33 - -UnitFlag const unitFlags[UNIT_FLAGS_MAX] = +UnitFlag const unitFlags[MAX_UNIT_FLAGS] = { { UNIT_FLAG_SERVER_CONTROLLED , "UNIT_FLAG_SERVER_CONTROLLED" }, { UNIT_FLAG_NON_ATTACKABLE , "UNIT_FLAG_NON_ATTACKABLE" }, @@ -745,7 +741,7 @@ public: handler->PSendSysMessage(LANG_NPCINFO_HEALTH, target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth()); handler->PSendSysMessage(LANG_NPCINFO_UNIT_FIELD_FLAGS, target->GetUInt32Value(UNIT_FIELD_FLAGS)); - for (uint8 i = 0; i < UNIT_FLAGS_MAX; ++i) + for (uint8 i = 0; i < MAX_UNIT_FLAGS; ++i) if (target->GetUInt32Value(UNIT_FIELD_FLAGS) & unitFlags[i].flag) handler->PSendSysMessage(unitFlags[i].text, unitFlags[i].flag); @@ -763,7 +759,7 @@ public: handler->PSendSysMessage(npcFlagTexts[i].text, npcFlagTexts[i].flag); handler->PSendSysMessage(LANG_NPCINFO_MECHANIC_IMMUNE, mechanicImmuneMask); - for (uint8 i = 0; i < MECHANIC_MAX; ++i) + for (uint8 i = 0; i < MAX_MECHANIC; ++i) if ((mechanicImmuneMask << 1) & mechanicImmunes[i].flag) handler->PSendSysMessage(mechanicImmunes[i].text, mechanicImmunes[i].flag); diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 6b846338ea2..5ba9e240d50 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -78,11 +78,11 @@ public: { "conditions", SEC_ADMINISTRATOR, true, &HandleReloadConditions, "", NULL }, { "config", SEC_ADMINISTRATOR, true, &HandleReloadConfigCommand, "", NULL }, { "creature_text", SEC_ADMINISTRATOR, true, &HandleReloadCreatureText, "", NULL }, - { "creature_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestInvRelationsCommand, "", NULL }, + { "creature_questender", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestEnderCommand, "", NULL }, { "creature_linked_respawn", SEC_GAMEMASTER, true, &HandleReloadLinkedRespawnCommand, "", NULL }, { "creature_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesCreatureCommand, "", NULL }, { "creature_onkill_reputation", SEC_ADMINISTRATOR, true, &HandleReloadOnKillReputationCommand, "", NULL }, - { "creature_questrelation", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestRelationsCommand, "", NULL }, + { "creature_queststarter", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestStarterCommand, "", NULL }, { "creature_summon_groups", SEC_ADMINISTRATOR, true, &HandleReloadCreatureSummonGroupsCommand, "", NULL }, { "creature_template", SEC_ADMINISTRATOR, true, &HandleReloadCreatureTemplateCommand, "", NULL }, //{ "db_script_string", SEC_ADMINISTRATOR, true, &HandleReloadDbScriptStringCommand, "", NULL }, @@ -92,9 +92,9 @@ public: { "fishing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesFishingCommand, "", NULL }, { "game_graveyard_zone", SEC_ADMINISTRATOR, true, &HandleReloadGameGraveyardZoneCommand, "", NULL }, { "game_tele", SEC_ADMINISTRATOR, true, &HandleReloadGameTeleCommand, "", NULL }, - { "gameobject_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestInvRelationsCommand, "", NULL }, + { "gameobject_questender", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestEnderCommand, "", NULL }, { "gameobject_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesGameobjectCommand, "", NULL }, - { "gameobject_questrelation", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestRelationsCommand, "", NULL }, + { "gameobject_queststarter", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestStarterCommand, "", NULL }, { "gm_tickets", SEC_ADMINISTRATOR, true, &HandleReloadGMTicketsCommand, "", NULL }, { "gossip_menu", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuCommand, "", NULL }, { "gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuOptionCommand, "", NULL }, @@ -243,8 +243,8 @@ public: HandleReloadQuestTemplateCommand(handler, "a"); TC_LOG_INFO(LOG_FILTER_GENERAL, "Re-Loading Quests Relations..."); - sObjectMgr->LoadQuestRelations(); - handler->SendGlobalGMSysMessage("DB tables `*_questrelation` and `*_involvedrelation` reloaded."); + sObjectMgr->LoadQuestStartersAndEnders(); + handler->SendGlobalGMSysMessage("DB tables `*_queststarter` and `*_questender` reloaded."); return true; } @@ -515,11 +515,11 @@ public: return true; } - static bool HandleReloadCreatureQuestRelationsCommand(ChatHandler* handler, const char* /*args*/) + static bool HandleReloadCreatureQuestStarterCommand(ChatHandler* handler, const char* /*args*/) { - TC_LOG_INFO(LOG_FILTER_GENERAL, "Loading Quests Relations... (`creature_questrelation`)"); - sObjectMgr->LoadCreatureQuestRelations(); - handler->SendGlobalGMSysMessage("DB table `creature_questrelation` (creature quest givers) reloaded."); + TC_LOG_INFO(LOG_FILTER_GENERAL, "Loading Quests Relations... (`creature_queststarter`)"); + sObjectMgr->LoadCreatureQuestStarters(); + handler->SendGlobalGMSysMessage("DB table `creature_queststarter` reloaded."); return true; } @@ -531,11 +531,11 @@ public: return true; } - static bool HandleReloadCreatureQuestInvRelationsCommand(ChatHandler* handler, const char* /*args*/) + static bool HandleReloadCreatureQuestEnderCommand(ChatHandler* handler, const char* /*args*/) { - TC_LOG_INFO(LOG_FILTER_GENERAL, "Loading Quests Relations... (`creature_involvedrelation`)"); - sObjectMgr->LoadCreatureInvolvedRelations(); - handler->SendGlobalGMSysMessage("DB table `creature_involvedrelation` (creature quest takers) reloaded."); + TC_LOG_INFO(LOG_FILTER_GENERAL, "Loading Quests Relations... (`creature_questender`)"); + sObjectMgr->LoadCreatureQuestEnders(); + handler->SendGlobalGMSysMessage("DB table `creature_questender` reloaded."); return true; } @@ -557,19 +557,19 @@ public: return true; } - static bool HandleReloadGOQuestRelationsCommand(ChatHandler* handler, const char* /*args*/) + static bool HandleReloadGOQuestStarterCommand(ChatHandler* handler, const char* /*args*/) { - TC_LOG_INFO(LOG_FILTER_GENERAL, "Loading Quests Relations... (`gameobject_questrelation`)"); - sObjectMgr->LoadGameobjectQuestRelations(); - handler->SendGlobalGMSysMessage("DB table `gameobject_questrelation` (gameobject quest givers) reloaded."); + TC_LOG_INFO(LOG_FILTER_GENERAL, "Loading Quests Relations... (`gameobject_queststarter`)"); + sObjectMgr->LoadGameobjectQuestStarters(); + handler->SendGlobalGMSysMessage("DB table `gameobject_queststarter` reloaded."); return true; } - static bool HandleReloadGOQuestInvRelationsCommand(ChatHandler* handler, const char* /*args*/) + static bool HandleReloadGOQuestEnderCommand(ChatHandler* handler, const char* /*args*/) { - TC_LOG_INFO(LOG_FILTER_GENERAL, "Loading Quests Relations... (`gameobject_involvedrelation`)"); - sObjectMgr->LoadGameobjectInvolvedRelations(); - handler->SendGlobalGMSysMessage("DB table `gameobject_involvedrelation` (gameobject quest takers) reloaded."); + TC_LOG_INFO(LOG_FILTER_GENERAL, "Loading Quests Relations... (`gameobject_questender`)"); + sObjectMgr->LoadGameobjectQuestEnders(); + handler->SendGlobalGMSysMessage("DB table `gameobject_questender` reloaded."); return true; } |
