Merge branch 'master' into UlagtheCleaverQuestFix
This commit is contained in:
@@ -117,6 +117,7 @@ if( WIN32 )
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.7;Location]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.7;Location]/lib/opt"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.6;Location]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.6;Location]/lib/opt"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.7;Location]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.7;Location]/lib/opt"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.6;Location]/lib"
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
# Copyright (C) 2008-2018 TrinityCore <https://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
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
macro(GroupSources dir)
|
||||
# Skip this if WITH_SOURCE_TREE is not set (empty string).
|
||||
if (NOT ${WITH_SOURCE_TREE} STREQUAL "")
|
||||
# Include all header and c files
|
||||
file(GLOB_RECURSE elements RELATIVE ${dir} *.h *.hpp *.c *.cpp *.cc)
|
||||
|
||||
foreach(element ${elements})
|
||||
# Extract filename and directory
|
||||
get_filename_component(element_name ${element} NAME)
|
||||
get_filename_component(element_dir ${element} DIRECTORY)
|
||||
|
||||
if (NOT ${element_dir} STREQUAL "")
|
||||
# If the file is in a subdirectory use it as source group.
|
||||
if (${WITH_SOURCE_TREE} STREQUAL "flat")
|
||||
# Build flat structure by using only the first subdirectory.
|
||||
string(FIND ${element_dir} "/" delemiter_pos)
|
||||
if (NOT ${delemiter_pos} EQUAL -1)
|
||||
string(SUBSTRING ${element_dir} 0 ${delemiter_pos} group_name)
|
||||
source_group("${group_name}" FILES ${dir}/${element})
|
||||
else()
|
||||
# Build hierarchical structure.
|
||||
# File is in root directory.
|
||||
source_group("${element_dir}" FILES ${dir}/${element})
|
||||
endif()
|
||||
else()
|
||||
# Use the full hierarchical structure to build source_groups.
|
||||
string(REPLACE "/" "\\" group_name ${element_dir})
|
||||
source_group("${group_name}" FILES ${dir}/${element})
|
||||
endif()
|
||||
else()
|
||||
# If the file is in the root directory, place it in the root source_group.
|
||||
source_group("\\" FILES ${dir}/${element})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endmacro()
|
||||
+41
-31
@@ -1,19 +1,19 @@
|
||||
# output generic information about the core and buildtype chosen
|
||||
message("")
|
||||
message("* AzerothCore revision : ${rev_hash} ${rev_date} (${rev_branch} branch)")
|
||||
message("* AzerothCore revision : ${rev_hash} ${rev_date} (${rev_branch} branch)")
|
||||
if( UNIX )
|
||||
message("* AzerothCore buildtype : ${CMAKE_BUILD_TYPE}")
|
||||
message("* AzerothCore buildtype : ${CMAKE_BUILD_TYPE}")
|
||||
endif()
|
||||
message("")
|
||||
|
||||
# output information about installation-directories and locations
|
||||
|
||||
message("* Install core to : ${CMAKE_INSTALL_PREFIX}")
|
||||
message("* Install core to : ${CMAKE_INSTALL_PREFIX}")
|
||||
if( UNIX )
|
||||
message("* Install libraries to : ${LIBSDIR}")
|
||||
message("* Install libraries to : ${LIBSDIR}")
|
||||
endif()
|
||||
|
||||
message("* Install configs to : ${CONF_DIR}")
|
||||
message("* Install configs to : ${CONF_DIR}")
|
||||
add_definitions(-D_CONF_DIR="\\"${CONF_DIR}\\"")
|
||||
|
||||
message("")
|
||||
@@ -21,69 +21,69 @@ message("")
|
||||
# Show infomation about the options selected during configuration
|
||||
|
||||
if( SERVERS )
|
||||
message("* Build world/auth : Yes (default)")
|
||||
message("* Build world/auth : Yes (default)")
|
||||
else()
|
||||
message("* Build world/authserver : No")
|
||||
message("* Build world/authserver : No")
|
||||
endif()
|
||||
|
||||
if( SCRIPTS )
|
||||
message("* Build with scripts : Yes (default)")
|
||||
message("* Build with scripts : Yes (default)")
|
||||
add_definitions(-DSCRIPTS)
|
||||
else()
|
||||
message("* Build with scripts : No")
|
||||
message("* Build with scripts : No")
|
||||
endif()
|
||||
|
||||
if( TOOLS )
|
||||
message("* Build map/vmap tools : Yes")
|
||||
message("* Build map/vmap tools : Yes")
|
||||
add_definitions(-DNO_CORE_FUNCS)
|
||||
else()
|
||||
message("* Build map/vmap tools : No (default)")
|
||||
message("* Build map/vmap tools : No (default)")
|
||||
endif()
|
||||
|
||||
if( USE_COREPCH )
|
||||
message("* Build core w/PCH : Yes (default)")
|
||||
message("* Build core w/PCH : Yes (default)")
|
||||
else()
|
||||
message("* Build core w/PCH : No")
|
||||
message("* Build core w/PCH : No")
|
||||
endif()
|
||||
|
||||
if( USE_SCRIPTPCH )
|
||||
message("* Build scripts w/PCH : Yes (default)")
|
||||
message("* Build scripts w/PCH : Yes (default)")
|
||||
else()
|
||||
message("* Build scripts w/PCH : No")
|
||||
message("* Build scripts w/PCH : No")
|
||||
endif()
|
||||
|
||||
if( WITH_WARNINGS )
|
||||
message("* Show all warnings : Yes")
|
||||
message("* Show all warnings : Yes")
|
||||
else()
|
||||
message("* Show compile-warnings : No (default)")
|
||||
message("* Show compile-warnings : No (default)")
|
||||
endif()
|
||||
|
||||
if( WITH_COREDEBUG )
|
||||
message("* Use coreside debug : Yes")
|
||||
message("* Use coreside debug : Yes")
|
||||
add_definitions(-DTRINITY_DEBUG)
|
||||
else()
|
||||
message("* Use coreside debug : No (default)")
|
||||
message("* Use coreside debug : No (default)")
|
||||
endif()
|
||||
|
||||
if ( UNIX )
|
||||
if( WITH_PERFTOOLS )
|
||||
message("* Use unix gperftools : Yes")
|
||||
message("* Use unix gperftools : Yes")
|
||||
add_definitions(-DPERF_TOOLS)
|
||||
else()
|
||||
message("* Use unix gperftools : No (default)")
|
||||
message("* Use unix gperftools : No (default)")
|
||||
endif()
|
||||
endif( UNIX )
|
||||
|
||||
if( WIN32 )
|
||||
if( USE_MYSQL_SOURCES )
|
||||
message("* Use MySQL sourcetree : Yes (default)")
|
||||
message("* Use MySQL sourcetree : Yes (default)")
|
||||
else()
|
||||
message("* Use MySQL sourcetree : No")
|
||||
message("* Use MySQL sourcetree : No")
|
||||
endif()
|
||||
endif( WIN32 )
|
||||
|
||||
if ( WITHOUT_GIT )
|
||||
message("* Use GIT revision hash : No")
|
||||
message("* Use GIT revision hash : No")
|
||||
message("")
|
||||
message(" *** WITHOUT_GIT - WARNING!")
|
||||
message(" *** By choosing the WITHOUT_GIT option you have waived all rights for support,")
|
||||
@@ -94,7 +94,7 @@ if ( WITHOUT_GIT )
|
||||
message(" *** version of git for the revision-hash to work, and be allowede to ask for")
|
||||
message(" *** support if needed.")
|
||||
else()
|
||||
message("* Use GIT revision hash : Yes")
|
||||
message("* Use GIT revision hash : Yes (default)")
|
||||
endif()
|
||||
|
||||
if ( NOJEM )
|
||||
@@ -108,24 +108,34 @@ endif()
|
||||
# Performance optimization options:
|
||||
|
||||
if( ENABLE_EXTRAS )
|
||||
message("* Enable extra features : Yes (default)")
|
||||
message("* Enable extra features : Yes (default)")
|
||||
add_definitions(-DENABLE_EXTRAS)
|
||||
else()
|
||||
message("* Enable extra features : No")
|
||||
message("* Enable extra features : No")
|
||||
endif()
|
||||
|
||||
if( ENABLE_VMAP_CHECKS )
|
||||
message("* Enable vmap DisableMgr checks : Yes (default)")
|
||||
message("* Enable vmap DisableMgr checks : Yes (default)")
|
||||
add_definitions(-DENABLE_VMAP_CHECKS)
|
||||
else()
|
||||
message("* Enable vmap DisableMgr checks : No")
|
||||
message("* Enable vmap DisableMgr checks : No")
|
||||
endif()
|
||||
|
||||
if( ENABLE_EXTRA_LOGS )
|
||||
message("* Enable extra logging functions : Yes")
|
||||
message("* Enable extra logging functions : Yes")
|
||||
add_definitions(-DENABLE_EXTRA_LOGS)
|
||||
else()
|
||||
message("* Enable extra logging functions : No (default)")
|
||||
message("* Enable extra logging functions : No (default)")
|
||||
endif()
|
||||
|
||||
if(WIN32 AND NOT CMAKE_VERSION VERSION_LESS 2.8.12)
|
||||
if(NOT WITH_SOURCE_TREE STREQUAL "no")
|
||||
message("* Show source tree : Yes - \"${WITH_SOURCE_TREE}\"")
|
||||
else()
|
||||
message("* Show source tree : No")
|
||||
endif()
|
||||
else()
|
||||
message("* Show source tree : No (For UNIX default)")
|
||||
endif()
|
||||
|
||||
message("")
|
||||
|
||||
@@ -78,6 +78,9 @@ include_directories(
|
||||
${OPENSSL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
# Group sources
|
||||
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_library(shared STATIC
|
||||
${shared_STAT_SRCS}
|
||||
${shared_STAT_PCH_SRC}
|
||||
|
||||
@@ -15,7 +15,7 @@ void WorldDatabaseConnection::DoPrepareStatements()
|
||||
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, BroadcastTextID, TextRange FROM creature_text", CONNECTION_SYNCH);
|
||||
PrepareStatement(WORLD_SEL_CREATURE_TEXT, "SELECT CreatureID, GroupID, ID, Text, Type, Language, Probability, Emote, Duration, Sound, BroadcastTextId, TextRange 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);
|
||||
|
||||
@@ -61,6 +61,9 @@ include_directories(
|
||||
${OPENSSL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
# Group sources
|
||||
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_executable(authserver
|
||||
${authserver_SRCS}
|
||||
${authserver_PCH_SRC}
|
||||
|
||||
@@ -2878,13 +2878,12 @@ void AchievementGlobalMgr::LoadRewardLocales()
|
||||
|
||||
m_achievementRewardLocales.clear(); // need for reload case
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, subject_loc1, text_loc1, subject_loc2, text_loc2, subject_loc3, text_loc3, subject_loc4, text_loc4, "
|
||||
"subject_loc5, text_loc5, subject_loc6, text_loc6, subject_loc7, text_loc7, subject_loc8, text_loc8"
|
||||
" FROM locales_achievement_reward");
|
||||
// 0 1 2 3
|
||||
QueryResult result = WorldDatabase.Query("SELECT ID, Locale, Subject, Text FROM achievement_reward_locale");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
sLog->outString(">> Loaded 0 achievement reward locale strings. DB table `locales_achievement_reward` is empty");
|
||||
sLog->outErrorDb(">> Loaded 0 achievement reward locale strings. DB table `achievement_reward_locale` is empty");
|
||||
sLog->outString();
|
||||
return;
|
||||
}
|
||||
@@ -2893,24 +2892,27 @@ void AchievementGlobalMgr::LoadRewardLocales()
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
uint32 ID = fields[0].GetUInt32();
|
||||
std::string LocaleName = fields[1].GetString();
|
||||
std::string Subject = fields[2].GetString();
|
||||
std::string Text = fields[3].GetString();
|
||||
|
||||
if (m_achievementRewards.find(entry) == m_achievementRewards.end())
|
||||
if (m_achievementRewards.find(ID) == m_achievementRewards.end())
|
||||
{
|
||||
sLog->outErrorDb("Table `locales_achievement_reward` (Entry: %u) has locale strings for non-existing achievement reward.", entry);
|
||||
sLog->outErrorDb("Table `achievement_reward_locale` (Entry: %u) has locale strings for non-existing achievement reward.", ID);
|
||||
continue;
|
||||
}
|
||||
|
||||
AchievementRewardLocale& data = m_achievementRewardLocales[entry];
|
||||
AchievementRewardLocale& data = m_achievementRewardLocales[ID];
|
||||
LocaleConstant locale = GetLocaleByName(LocaleName);
|
||||
if (locale == LOCALE_enUS)
|
||||
continue;
|
||||
|
||||
ObjectMgr::AddLocaleString(Subject, locale, data.Subject);
|
||||
ObjectMgr::AddLocaleString(Text, locale, data.Text);
|
||||
|
||||
for (int i = 1; i < TOTAL_LOCALES; ++i)
|
||||
{
|
||||
LocaleConstant locale = (LocaleConstant) i;
|
||||
ObjectMgr::AddLocaleString(fields[1 + 2 * (i - 1)].GetString(), locale, data.subject);
|
||||
ObjectMgr::AddLocaleString(fields[1 + 2 * (i - 1) + 1].GetString(), locale, data.text);
|
||||
}
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded %lu achievement reward locale strings in %u ms", (unsigned long)m_achievementRewardLocales.size(), GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString(">> Loaded %lu Achievement Reward Locale strings in %u ms", (unsigned long)m_achievementRewardLocales.size(), GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
@@ -232,8 +232,8 @@ typedef std::map<uint32, AchievementReward> AchievementRewards;
|
||||
|
||||
struct AchievementRewardLocale
|
||||
{
|
||||
StringVector subject;
|
||||
StringVector text;
|
||||
StringVector Subject;
|
||||
StringVector Text;
|
||||
};
|
||||
|
||||
typedef std::map<uint32, AchievementRewardLocale> AchievementRewardLocales;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "CreatureTextMgr.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "Transport.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
Battlefield::Battlefield()
|
||||
{
|
||||
@@ -583,7 +584,7 @@ BfGraveyard* Battlefield::GetGraveyardById(uint32 id) const
|
||||
return NULL;
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const * Battlefield::GetClosestGraveyard(Player* player)
|
||||
GraveyardStruct const * Battlefield::GetClosestGraveyard(Player* player)
|
||||
{
|
||||
BfGraveyard* closestGY = NULL;
|
||||
float maxdist = -1;
|
||||
@@ -604,7 +605,7 @@ WorldSafeLocsEntry const * Battlefield::GetClosestGraveyard(Player* player)
|
||||
}
|
||||
|
||||
if (closestGY)
|
||||
return sWorldSafeLocsStore.LookupEntry(closestGY->GetGraveyardId());
|
||||
return sGraveyard->GetGraveyard(closestGY->GetGraveyardId());
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -682,7 +683,7 @@ void BfGraveyard::SetSpirit(Creature* spirit, TeamId team)
|
||||
|
||||
float BfGraveyard::GetDistance(Player* player)
|
||||
{
|
||||
const WorldSafeLocsEntry* safeLoc = sWorldSafeLocsStore.LookupEntry(m_GraveyardId);
|
||||
const GraveyardStruct* safeLoc = sGraveyard->GetGraveyard(m_GraveyardId);
|
||||
return player->GetDistance2d(safeLoc->x, safeLoc->y);
|
||||
}
|
||||
|
||||
@@ -744,7 +745,7 @@ void BfGraveyard::GiveControlTo(TeamId team)
|
||||
|
||||
void BfGraveyard::RelocateDeadPlayers()
|
||||
{
|
||||
WorldSafeLocsEntry const* closestGrave = NULL;
|
||||
GraveyardStruct const* closestGrave = NULL;
|
||||
for (GuidSet::const_iterator itr = m_ResurrectQueue.begin(); itr != m_ResurrectQueue.end(); ++itr)
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(*itr);
|
||||
|
||||
@@ -285,7 +285,7 @@ class Battlefield : public ZoneScript
|
||||
|
||||
// Graveyard methods
|
||||
// Find which graveyard the player must be teleported to to be resurrected by spiritguide
|
||||
WorldSafeLocsEntry const * GetClosestGraveyard(Player* player);
|
||||
GraveyardStruct const * GetClosestGraveyard(Player* player);
|
||||
|
||||
virtual void AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid);
|
||||
void RemovePlayerFromResurrectQueue(uint64 player_guid);
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "BattlegroundRV.h"
|
||||
#include "Transport.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "GameGraveyard.h"
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
@@ -40,7 +41,7 @@ namespace Trinity
|
||||
class BattlegroundChatBuilder
|
||||
{
|
||||
public:
|
||||
BattlegroundChatBuilder(ChatMsg msgtype, int32 textId, Player const* source, va_list* args = NULL)
|
||||
BattlegroundChatBuilder(ChatMsg msgtype, uint32 textId, Player const* source, va_list* args = NULL)
|
||||
: _msgtype(msgtype), _textId(textId), _source(source), _args(args) { }
|
||||
|
||||
void operator()(WorldPacket& data, LocaleConstant loc_idx)
|
||||
@@ -69,7 +70,7 @@ namespace Trinity
|
||||
}
|
||||
|
||||
ChatMsg _msgtype;
|
||||
int32 _textId;
|
||||
uint32 _textId;
|
||||
Player const* _source;
|
||||
va_list* _args;
|
||||
};
|
||||
@@ -77,7 +78,7 @@ namespace Trinity
|
||||
class Battleground2ChatBuilder
|
||||
{
|
||||
public:
|
||||
Battleground2ChatBuilder(ChatMsg msgtype, int32 textId, Player const* source, int32 arg1, int32 arg2)
|
||||
Battleground2ChatBuilder(ChatMsg msgtype, uint32 textId, Player const* source, int32 arg1, int32 arg2)
|
||||
: _msgtype(msgtype), _textId(textId), _source(source), _arg1(arg1), _arg2(arg2) {}
|
||||
|
||||
void operator()(WorldPacket& data, LocaleConstant loc_idx)
|
||||
@@ -94,10 +95,10 @@ namespace Trinity
|
||||
|
||||
private:
|
||||
ChatMsg _msgtype;
|
||||
int32 _textId;
|
||||
uint32 _textId;
|
||||
Player const* _source;
|
||||
int32 _arg1;
|
||||
int32 _arg2;
|
||||
uint32 _arg1;
|
||||
uint32 _arg2;
|
||||
};
|
||||
} // namespace Trinity
|
||||
|
||||
@@ -1434,7 +1435,7 @@ void Battleground::RelocateDeadPlayers(uint64 queueIndex)
|
||||
std::vector<uint64>& ghostList = m_ReviveQueue[queueIndex];
|
||||
if (!ghostList.empty())
|
||||
{
|
||||
WorldSafeLocsEntry const* closestGrave = NULL;
|
||||
GraveyardStruct const* closestGrave = NULL;
|
||||
for (std::vector<uint64>::const_iterator itr = ghostList.begin(); itr != ghostList.end(); ++itr)
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(*itr);
|
||||
@@ -1692,7 +1693,7 @@ bool Battleground::AddSpiritGuide(uint32 type, float x, float y, float z, float
|
||||
return false;
|
||||
}
|
||||
|
||||
void Battleground::SendMessageToAll(int32 entry, ChatMsg type, Player const* source)
|
||||
void Battleground::SendMessageToAll(uint32 entry, ChatMsg type, Player const* source)
|
||||
{
|
||||
if (!entry)
|
||||
return;
|
||||
@@ -1702,7 +1703,7 @@ void Battleground::SendMessageToAll(int32 entry, ChatMsg type, Player const* sou
|
||||
BroadcastWorker(bg_do);
|
||||
}
|
||||
|
||||
void Battleground::PSendMessageToAll(int32 entry, ChatMsg type, Player const* source, ...)
|
||||
void Battleground::PSendMessageToAll(uint32 entry, ChatMsg type, Player const* source, ...)
|
||||
{
|
||||
if (!entry)
|
||||
return;
|
||||
@@ -1717,7 +1718,7 @@ void Battleground::PSendMessageToAll(int32 entry, ChatMsg type, Player const* so
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void Battleground::SendWarningToAll(int32 entry, ...)
|
||||
void Battleground::SendWarningToAll(uint32 entry, ...)
|
||||
{
|
||||
if (!entry)
|
||||
return;
|
||||
@@ -1742,7 +1743,7 @@ void Battleground::SendWarningToAll(int32 entry, ...)
|
||||
}
|
||||
}
|
||||
|
||||
void Battleground::SendMessage2ToAll(int32 entry, ChatMsg type, Player const* source, int32 arg1, int32 arg2)
|
||||
void Battleground::SendMessage2ToAll(uint32 entry, ChatMsg type, Player const* source, uint32 arg1, uint32 arg2)
|
||||
{
|
||||
Trinity::Battleground2ChatBuilder bg_builder(type, entry, source, arg1, arg2);
|
||||
Trinity::LocalizedPacketDo<Trinity::Battleground2ChatBuilder> bg_do(bg_builder);
|
||||
@@ -1914,9 +1915,9 @@ void Battleground::SetBgRaid(TeamId teamId, Group* bg_raid)
|
||||
old_raid = bg_raid;
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const* Battleground::GetClosestGraveyard(Player* player)
|
||||
GraveyardStruct const* Battleground::GetClosestGraveyard(Player* player)
|
||||
{
|
||||
return sObjectMgr->GetClosestGraveyard(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), player->GetBgTeamId());
|
||||
return sGraveyard->GetClosestGraveyard(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), player->GetBgTeamId());
|
||||
}
|
||||
|
||||
void Battleground::StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
|
||||
|
||||
@@ -31,7 +31,7 @@ class BattlegroundRV;
|
||||
class BattlegroundIC;
|
||||
|
||||
struct PvPDifficultyEntry;
|
||||
struct WorldSafeLocsEntry;
|
||||
struct GraveyardStruct;
|
||||
|
||||
enum BattlegroundDesertionType
|
||||
{
|
||||
@@ -488,12 +488,12 @@ class Battleground
|
||||
void EndBattleground(TeamId winnerTeamId);
|
||||
void BlockMovement(Player* player);
|
||||
|
||||
void SendWarningToAll(int32 entry, ...);
|
||||
void SendMessageToAll(int32 entry, ChatMsg type, Player const* source = NULL);
|
||||
void PSendMessageToAll(int32 entry, ChatMsg type, Player const* source, ...);
|
||||
void SendWarningToAll(uint32 entry, ...);
|
||||
void SendMessageToAll(uint32 entry, ChatMsg type, Player const* source = NULL);
|
||||
void PSendMessageToAll(uint32 entry, ChatMsg type, Player const* source, ...);
|
||||
|
||||
// specialized version with 2 string id args
|
||||
void SendMessage2ToAll(int32 entry, ChatMsg type, Player const* source, int32 strId1 = 0, int32 strId2 = 0);
|
||||
void SendMessage2ToAll(uint32 entry, ChatMsg type, Player const* source, uint32 strId1 = 0, uint32 strId2 = 0);
|
||||
|
||||
// Raid Group
|
||||
Group* GetBgRaid(TeamId teamId) const { return m_BgRaids[teamId]; }
|
||||
@@ -541,7 +541,7 @@ class Battleground
|
||||
virtual void HandlePlayerResurrect(Player* /*player*/) {}
|
||||
|
||||
// Death related
|
||||
virtual WorldSafeLocsEntry const* GetClosestGraveyard(Player* player);
|
||||
virtual GraveyardStruct const* GetClosestGraveyard(Player* player);
|
||||
|
||||
virtual void AddPlayer(Player* player); // must be implemented in BG subclass
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "DisableMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "BattlegroundQueue.h"
|
||||
#include "GameGraveyard.h"
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
@@ -649,7 +650,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
|
||||
else
|
||||
{
|
||||
uint32 startId = fields[5].GetUInt32();
|
||||
if (WorldSafeLocsEntry const* start = sWorldSafeLocsStore.LookupEntry(startId))
|
||||
if (GraveyardStruct const* start = sGraveyard->GetGraveyard(startId))
|
||||
{
|
||||
data.Team1StartLocX = start->x;
|
||||
data.Team1StartLocY = start->y;
|
||||
@@ -658,12 +659,12 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog->outError("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `AllianceStartLoc`. BG not created.", data.bgTypeId, startId);
|
||||
sLog->outError("Table `battleground_template` for id %u have non-existed `game_graveyard` table id %u in field `AllianceStartLoc`. BG not created.", data.bgTypeId, startId);
|
||||
continue;
|
||||
}
|
||||
|
||||
startId = fields[7].GetUInt32();
|
||||
if (WorldSafeLocsEntry const* start = sWorldSafeLocsStore.LookupEntry(startId))
|
||||
if (GraveyardStruct const* start = sGraveyard->GetGraveyard(startId))
|
||||
{
|
||||
data.Team2StartLocX = start->x;
|
||||
data.Team2StartLocY = start->y;
|
||||
@@ -672,7 +673,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog->outError("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `HordeStartLoc`. BG not created.", data.bgTypeId, startId);
|
||||
sLog->outError("Table `battleground_template` for id %u have non-existed `game_graveyard` table id %u in field `HordeStartLoc`. BG not created.", data.bgTypeId, startId);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "Player.h"
|
||||
#include "Util.h"
|
||||
#include "WorldSession.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
BattlegroundAB::BattlegroundAB()
|
||||
{
|
||||
@@ -424,10 +425,10 @@ void BattlegroundAB::EndBattleground(TeamId winnerTeamId)
|
||||
_bgEvents.Reset();
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const* BattlegroundAB::GetClosestGraveyard(Player* player)
|
||||
GraveyardStruct const* BattlegroundAB::GetClosestGraveyard(Player* player)
|
||||
{
|
||||
WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(BG_AB_GraveyardIds[BG_AB_SPIRIT_ALIANCE + player->GetTeamId()]);
|
||||
WorldSafeLocsEntry const* nearestEntry = entry;
|
||||
GraveyardStruct const* entry = sGraveyard->GetGraveyard(BG_AB_GraveyardIds[BG_AB_SPIRIT_ALIANCE + player->GetTeamId()]);
|
||||
GraveyardStruct const* nearestEntry = entry;
|
||||
|
||||
float pX = player->GetPositionX();
|
||||
float pY = player->GetPositionY();
|
||||
@@ -437,7 +438,7 @@ WorldSafeLocsEntry const* BattlegroundAB::GetClosestGraveyard(Player* player)
|
||||
for (uint8 i = BG_AB_NODE_STABLES; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
|
||||
if (_capturePointInfo[i]._ownerTeamId == player->GetTeamId())
|
||||
{
|
||||
entry = sWorldSafeLocsStore.LookupEntry(BG_AB_GraveyardIds[i]);
|
||||
entry = sGraveyard->GetGraveyard(BG_AB_GraveyardIds[i]);
|
||||
dist = (entry->x - pX)*(entry->x - pX) + (entry->y - pY)*(entry->y - pY);
|
||||
if (dist < minDist)
|
||||
{
|
||||
|
||||
@@ -235,7 +235,7 @@ class BattlegroundAB : public Battleground
|
||||
bool SetupBattleground();
|
||||
void Init();
|
||||
void EndBattleground(TeamId winnerTeamId);
|
||||
WorldSafeLocsEntry const* GetClosestGraveyard(Player* player);
|
||||
GraveyardStruct const* GetClosestGraveyard(Player* player);
|
||||
|
||||
void UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true);
|
||||
void FillInitialWorldStates(WorldPacket& data);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "SpellAuras.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "WorldSession.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
BattlegroundAV::BattlegroundAV()
|
||||
{
|
||||
@@ -1174,23 +1175,23 @@ void BattlegroundAV::SendMineWorldStates(uint32 mine)
|
||||
UpdateWorldState(BG_AV_MineWorldStates[mine][owner], 1);
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const* BattlegroundAV::GetClosestGraveyard(Player* player)
|
||||
GraveyardStruct const* BattlegroundAV::GetClosestGraveyard(Player* player)
|
||||
{
|
||||
WorldSafeLocsEntry const* pGraveyard = NULL;
|
||||
WorldSafeLocsEntry const* entry = NULL;
|
||||
GraveyardStruct const* pGraveyard = NULL;
|
||||
GraveyardStruct const* entry = NULL;
|
||||
float dist = 0;
|
||||
float minDist = 0;
|
||||
float x, y;
|
||||
|
||||
player->GetPosition(x, y);
|
||||
|
||||
pGraveyard = sWorldSafeLocsStore.LookupEntry(BG_AV_GraveyardIds[player->GetTeamId()+7]);
|
||||
pGraveyard = sGraveyard->GetGraveyard(BG_AV_GraveyardIds[player->GetTeamId()+7]);
|
||||
minDist = (pGraveyard->x - x)*(pGraveyard->x - x)+(pGraveyard->y - y)*(pGraveyard->y - y);
|
||||
|
||||
for (uint8 i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i)
|
||||
if (m_Nodes[i].OwnerId == player->GetTeamId() && m_Nodes[i].State == POINT_CONTROLED)
|
||||
{
|
||||
entry = sWorldSafeLocsStore.LookupEntry(BG_AV_GraveyardIds[i]);
|
||||
entry = sGraveyard->GetGraveyard(BG_AV_GraveyardIds[i]);
|
||||
if (entry)
|
||||
{
|
||||
dist = (entry->x - x)*(entry->x - x)+(entry->y - y)*(entry->y - y);
|
||||
|
||||
@@ -1591,7 +1591,7 @@ class BattlegroundAV : public Battleground
|
||||
|
||||
void EndBattleground(TeamId winnerTeamId);
|
||||
|
||||
WorldSafeLocsEntry const* GetClosestGraveyard(Player* player);
|
||||
GraveyardStruct const* GetClosestGraveyard(Player* player);
|
||||
|
||||
/* achievement req. */
|
||||
bool IsBothMinesControlledByTeam(TeamId teamId) const;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "Player.h"
|
||||
#include "Util.h"
|
||||
#include "WorldSession.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
BattlegroundEY::BattlegroundEY()
|
||||
{
|
||||
@@ -309,11 +310,11 @@ bool BattlegroundEY::SetupBattleground()
|
||||
AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY);
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const* sg = NULL;
|
||||
sg = sWorldSafeLocsStore.LookupEntry(BG_EY_GRAVEYARD_MAIN_ALLIANCE);
|
||||
GraveyardStruct const* sg = NULL;
|
||||
sg = sGraveyard->GetGraveyard(BG_EY_GRAVEYARD_MAIN_ALLIANCE);
|
||||
AddSpiritGuide(BG_EY_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, TEAM_ALLIANCE);
|
||||
|
||||
sg = sWorldSafeLocsStore.LookupEntry(BG_EY_GRAVEYARD_MAIN_HORDE);
|
||||
sg = sGraveyard->GetGraveyard(BG_EY_GRAVEYARD_MAIN_HORDE);
|
||||
AddSpiritGuide(BG_EY_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, TEAM_HORDE);
|
||||
|
||||
for (uint32 i = BG_EY_OBJECT_DOOR_A; i < BG_EY_OBJECT_MAX; ++i)
|
||||
@@ -480,7 +481,7 @@ void BattlegroundEY::EventTeamCapturedPoint(TeamId teamId, uint32 point)
|
||||
if (BgCreatures[point])
|
||||
DelCreature(point);
|
||||
|
||||
WorldSafeLocsEntry const* sg = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[point].GraveYardId);
|
||||
GraveyardStruct const* sg = sGraveyard->GetGraveyard(m_CapturingPointTypes[point].GraveYardId);
|
||||
AddSpiritGuide(point, sg->x, sg->y, sg->z, 3.124139f, teamId);
|
||||
|
||||
UpdatePointsIcons(point);
|
||||
@@ -565,10 +566,10 @@ void BattlegroundEY::FillInitialWorldStates(WorldPacket& data)
|
||||
data << uint32(PROGRESS_BAR_STATUS) << uint32(0);
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveyard(Player* player)
|
||||
GraveyardStruct const* BattlegroundEY::GetClosestGraveyard(Player* player)
|
||||
{
|
||||
WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(BG_EY_GRAVEYARD_MAIN_ALLIANCE + player->GetTeamId());
|
||||
WorldSafeLocsEntry const* nearestEntry = entry;
|
||||
GraveyardStruct const* entry = sGraveyard->GetGraveyard(BG_EY_GRAVEYARD_MAIN_ALLIANCE + player->GetTeamId());
|
||||
GraveyardStruct const* nearestEntry = entry;
|
||||
|
||||
float pX = player->GetPositionX();
|
||||
float pY = player->GetPositionY();
|
||||
@@ -579,7 +580,7 @@ WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveyard(Player* player)
|
||||
for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
|
||||
if (_capturePointInfo[i].IsUnderControl(player->GetTeamId()))
|
||||
{
|
||||
entry = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[i].GraveYardId);
|
||||
entry = sGraveyard->GetGraveyard(m_CapturingPointTypes[i].GraveYardId);
|
||||
dist = (entry->x - pX)*(entry->x - pX) + (entry->y - pY)*(entry->y - pY) + (entry->z - pZ)*(entry->z - pZ);
|
||||
if (dist < minDist)
|
||||
{
|
||||
|
||||
@@ -336,7 +336,7 @@ class BattlegroundEY : public Battleground
|
||||
void HandleBuffUse(uint64 buff_guid);
|
||||
void HandleAreaTrigger(Player* player, uint32 trigger);
|
||||
void HandleKillPlayer(Player* player, Player* killer);
|
||||
WorldSafeLocsEntry const* GetClosestGraveyard(Player* player);
|
||||
GraveyardStruct const* GetClosestGraveyard(Player* player);
|
||||
bool SetupBattleground();
|
||||
void Init();
|
||||
void EndBattleground(TeamId winnerTeamId);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "Transport.h"
|
||||
#include "WorldSession.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
BattlegroundIC::BattlegroundIC()
|
||||
{
|
||||
@@ -950,7 +951,7 @@ void BattlegroundIC::EventPlayerDamagedGO(Player* /*player*/, GameObject* /*go*/
|
||||
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveyard(Player* player)
|
||||
GraveyardStruct const* BattlegroundIC::GetClosestGraveyard(Player* player)
|
||||
{
|
||||
// Is there any occupied node for this team?
|
||||
std::vector<uint8> nodes;
|
||||
@@ -958,7 +959,7 @@ WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveyard(Player* player)
|
||||
if (nodePoint[i].faction == player->GetTeamId() && !nodePoint[i].needChange) // xinef: controlled by faction and not contested!
|
||||
nodes.push_back(i);
|
||||
|
||||
WorldSafeLocsEntry const* good_entry = NULL;
|
||||
GraveyardStruct const* good_entry = NULL;
|
||||
// If so, select the closest node to place ghost on
|
||||
if (!nodes.empty())
|
||||
{
|
||||
@@ -968,7 +969,7 @@ WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveyard(Player* player)
|
||||
float mindist = 999999.0f;
|
||||
for (uint8 i = 0; i < nodes.size(); ++i)
|
||||
{
|
||||
WorldSafeLocsEntry const*entry = sWorldSafeLocsStore.LookupEntry(BG_IC_GraveyardIds[nodes[i]]);
|
||||
GraveyardStruct const*entry = sGraveyard->GetGraveyard(BG_IC_GraveyardIds[nodes[i]]);
|
||||
if (!entry)
|
||||
continue;
|
||||
float dist = (entry->x - plr_x)*(entry->x - plr_x)+(entry->y - plr_y)*(entry->y - plr_y);
|
||||
@@ -982,7 +983,7 @@ WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveyard(Player* player)
|
||||
}
|
||||
// If not, place ghost on starting location
|
||||
if (!good_entry)
|
||||
good_entry = sWorldSafeLocsStore.LookupEntry(BG_IC_GraveyardIds[player->GetTeamId()+MAX_NODE_TYPES]);
|
||||
good_entry = sGraveyard->GetGraveyard(BG_IC_GraveyardIds[player->GetTeamId()+MAX_NODE_TYPES]);
|
||||
|
||||
return good_entry;
|
||||
}
|
||||
|
||||
@@ -911,7 +911,7 @@ class BattlegroundIC : public Battleground
|
||||
void EventPlayerDamagedGO(Player* /*player*/, GameObject* go, uint32 eventType);
|
||||
void DestroyGate(Player* player, GameObject* go);
|
||||
|
||||
WorldSafeLocsEntry const* GetClosestGraveyard(Player* player);
|
||||
GraveyardStruct const* GetClosestGraveyard(Player* player);
|
||||
|
||||
/* Scorekeeping */
|
||||
void UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
BattlegroundSA::BattlegroundSA()
|
||||
{
|
||||
@@ -163,8 +164,8 @@ bool BattlegroundSA::ResetObjs()
|
||||
//Graveyards!
|
||||
for (uint8 i = 0;i < BG_SA_MAX_GY; i++)
|
||||
{
|
||||
WorldSafeLocsEntry const* sg = NULL;
|
||||
sg = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]);
|
||||
GraveyardStruct const* sg = NULL;
|
||||
sg = sGraveyard->GetGraveyard(BG_SA_GYEntries[i]);
|
||||
|
||||
if (!sg)
|
||||
{
|
||||
@@ -761,9 +762,9 @@ void BattlegroundSA::DestroyGate(Player* player, GameObject* go)
|
||||
}
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const* BattlegroundSA::GetClosestGraveyard(Player* player)
|
||||
GraveyardStruct const* BattlegroundSA::GetClosestGraveyard(Player* player)
|
||||
{
|
||||
WorldSafeLocsEntry const* closest = NULL;
|
||||
GraveyardStruct const* closest = NULL;
|
||||
float mindist = 999999.0f;
|
||||
float x, y;
|
||||
|
||||
@@ -774,7 +775,7 @@ WorldSafeLocsEntry const* BattlegroundSA::GetClosestGraveyard(Player* player)
|
||||
if (GraveyardStatus[i] != player->GetTeamId())
|
||||
continue;
|
||||
|
||||
WorldSafeLocsEntry const* ret = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]);
|
||||
GraveyardStruct const* ret = sGraveyard->GetGraveyard(BG_SA_GYEntries[i]);
|
||||
|
||||
// if on beach
|
||||
if (i == BG_SA_BEACH_GY)
|
||||
@@ -792,7 +793,7 @@ WorldSafeLocsEntry const* BattlegroundSA::GetClosestGraveyard(Player* player)
|
||||
}
|
||||
}
|
||||
if (!closest && GraveyardStatus[BG_SA_BEACH_GY] == player->GetTeamId())
|
||||
return sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[BG_SA_BEACH_GY]);
|
||||
return sGraveyard->GetGraveyard(BG_SA_GYEntries[BG_SA_BEACH_GY]);
|
||||
|
||||
|
||||
return closest;
|
||||
@@ -883,7 +884,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player *Source)
|
||||
std::vector<uint64> ghost_list = m_ReviveQueue[BgCreatures[BG_SA_MAXNPC + i]];
|
||||
if (!ghost_list.empty())
|
||||
{
|
||||
WorldSafeLocsEntry const* ClosestGrave = NULL;
|
||||
GraveyardStruct const* ClosestGrave = NULL;
|
||||
for (std::vector<uint64>::const_iterator itr = ghost_list.begin(); itr != ghost_list.end(); ++itr)
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(*itr);
|
||||
@@ -902,7 +903,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player *Source)
|
||||
|
||||
DelCreature(BG_SA_MAXNPC + i);
|
||||
|
||||
WorldSafeLocsEntry const* sg = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]);
|
||||
GraveyardStruct const* sg = sGraveyard->GetGraveyard(BG_SA_GYEntries[i]);
|
||||
if (!sg)
|
||||
{
|
||||
sLog->outError("BattlegroundSA::CaptureGraveyard: non-existant GY entry: %u", BG_SA_GYEntries[i]);
|
||||
|
||||
@@ -445,7 +445,7 @@ class BattlegroundSA : public Battleground
|
||||
/// Called when a player kill a unit in bg
|
||||
void HandleKillUnit(Creature* creature, Player* killer);
|
||||
/// Return the nearest graveyard where player can respawn
|
||||
WorldSafeLocsEntry const* GetClosestGraveyard(Player* player);
|
||||
GraveyardStruct const* GetClosestGraveyard(Player* player);
|
||||
/// Called when a player click on flag (graveyard flag)
|
||||
void EventPlayerClickedOnFlag(Player* Source, GameObject* gameObject);
|
||||
/// Called when a player use a gamobject (relic)
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "Player.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
BattlegroundWS::BattlegroundWS()
|
||||
{
|
||||
@@ -401,10 +402,10 @@ bool BattlegroundWS::SetupBattleground()
|
||||
AddObject(BG_WS_OBJECT_DOOR_H_4, BG_OBJECT_DOOR_H_4_WS_ENTRY, 950.7952f, 1459.583f, 342.1523f, 0.05235988f, 0, 0, 0.02617695f, 0.9996573f, RESPAWN_IMMEDIATELY);
|
||||
|
||||
|
||||
WorldSafeLocsEntry const* sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_ALLIANCE);
|
||||
GraveyardStruct const* sg = sGraveyard->GetGraveyard(WS_GRAVEYARD_MAIN_ALLIANCE);
|
||||
AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, TEAM_ALLIANCE);
|
||||
|
||||
sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_HORDE);
|
||||
sg = sGraveyard->GetGraveyard(WS_GRAVEYARD_MAIN_HORDE);
|
||||
AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, TEAM_HORDE);
|
||||
|
||||
for (uint32 i = BG_WS_OBJECT_DOOR_A_1; i < BG_WS_OBJECT_MAX; ++i)
|
||||
@@ -495,12 +496,12 @@ void BattlegroundWS::UpdatePlayerScore(Player* player, uint32 type, uint32 value
|
||||
}
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const* BattlegroundWS::GetClosestGraveyard(Player* player)
|
||||
GraveyardStruct const* BattlegroundWS::GetClosestGraveyard(Player* player)
|
||||
{
|
||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
return sWorldSafeLocsStore.LookupEntry(player->GetTeamId() == TEAM_ALLIANCE ? WS_GRAVEYARD_MAIN_ALLIANCE : WS_GRAVEYARD_MAIN_HORDE);
|
||||
return sGraveyard->GetGraveyard(player->GetTeamId() == TEAM_ALLIANCE ? WS_GRAVEYARD_MAIN_ALLIANCE : WS_GRAVEYARD_MAIN_HORDE);
|
||||
else
|
||||
return sWorldSafeLocsStore.LookupEntry(player->GetTeamId() == TEAM_ALLIANCE ? WS_GRAVEYARD_FLAGROOM_ALLIANCE : WS_GRAVEYARD_FLAGROOM_HORDE);
|
||||
return sGraveyard->GetGraveyard(player->GetTeamId() == TEAM_ALLIANCE ? WS_GRAVEYARD_FLAGROOM_ALLIANCE : WS_GRAVEYARD_FLAGROOM_HORDE);
|
||||
}
|
||||
|
||||
void BattlegroundWS::FillInitialWorldStates(WorldPacket& data)
|
||||
|
||||
@@ -176,7 +176,7 @@ class BattlegroundWS : public Battleground
|
||||
bool SetupBattleground();
|
||||
void Init();
|
||||
void EndBattleground(TeamId winnerTeamId);
|
||||
WorldSafeLocsEntry const* GetClosestGraveyard(Player* player);
|
||||
GraveyardStruct const* GetClosestGraveyard(Player* player);
|
||||
|
||||
void UpdateFlagState(TeamId teamId, uint32 value);
|
||||
void UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true);
|
||||
|
||||
@@ -213,6 +213,9 @@ include_directories(
|
||||
${OPENSSL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
# Group sources
|
||||
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_library(game STATIC
|
||||
${game_STAT_SRCS}
|
||||
${game_STAT_PCH_SRC}
|
||||
|
||||
@@ -59,7 +59,7 @@ std::vector<ChatCommand> const& ChatHandler::getCommandTable()
|
||||
return commandTableCache;
|
||||
}
|
||||
|
||||
std::string ChatHandler::PGetParseString(int32 entry, ...) const
|
||||
std::string ChatHandler::PGetParseString(uint32 entry, ...) const
|
||||
{
|
||||
const char *format = GetTrinityString(entry);
|
||||
char str[1024];
|
||||
@@ -70,7 +70,7 @@ std::string ChatHandler::PGetParseString(int32 entry, ...) const
|
||||
return std::string(str);
|
||||
}
|
||||
|
||||
const char *ChatHandler::GetTrinityString(int32 entry) const
|
||||
char const* ChatHandler::GetTrinityString(uint32 entry) const
|
||||
{
|
||||
return m_session->GetTrinityString(entry);
|
||||
}
|
||||
@@ -209,12 +209,12 @@ void ChatHandler::SendGlobalGMSysMessage(const char *str)
|
||||
free(buf);
|
||||
}
|
||||
|
||||
void ChatHandler::SendSysMessage(int32 entry)
|
||||
void ChatHandler::SendSysMessage(uint32 entry)
|
||||
{
|
||||
SendSysMessage(GetTrinityString(entry));
|
||||
}
|
||||
|
||||
void ChatHandler::PSendSysMessage(int32 entry, ...)
|
||||
void ChatHandler::PSendSysMessage(uint32 entry, ...)
|
||||
{
|
||||
const char *format = GetTrinityString(entry);
|
||||
va_list ap;
|
||||
@@ -1217,7 +1217,7 @@ std::string ChatHandler::GetNameLink(Player* chr) const
|
||||
return playerLink(chr->GetName());
|
||||
}
|
||||
|
||||
const char *CliHandler::GetTrinityString(int32 entry) const
|
||||
char const* CliHandler::GetTrinityString(uint32 entry) const
|
||||
{
|
||||
return sObjectMgr->GetTrinityStringForDBCLocale(entry);
|
||||
}
|
||||
|
||||
+13
-13
@@ -56,13 +56,13 @@ class ChatHandler
|
||||
static char* LineFromMessage(char*& pos) { char* start = strtok(pos, "\n"); pos = NULL; return start; }
|
||||
|
||||
// function with different implementation for chat/console
|
||||
virtual const char *GetTrinityString(int32 entry) const;
|
||||
virtual void SendSysMessage(const char *str);
|
||||
virtual char const* GetTrinityString(uint32 entry) const;
|
||||
virtual void SendSysMessage(char const* str);
|
||||
|
||||
void SendSysMessage(int32 entry);
|
||||
void PSendSysMessage(const char *format, ...) ATTR_PRINTF(2, 3);
|
||||
void PSendSysMessage(int32 entry, ...);
|
||||
std::string PGetParseString(int32 entry, ...) const;
|
||||
void SendSysMessage(uint32 entry);
|
||||
void PSendSysMessage(char const* format, ...) ATTR_PRINTF(2, 3);
|
||||
void PSendSysMessage(uint32 entry, ...);
|
||||
std::string PGetParseString(uint32 entry, ...) const;
|
||||
|
||||
bool ParseCommands(const char* text);
|
||||
|
||||
@@ -139,13 +139,13 @@ class CliHandler : public ChatHandler
|
||||
explicit CliHandler(void* callbackArg, Print* zprint) : m_callbackArg(callbackArg), m_print(zprint) {}
|
||||
|
||||
// overwrite functions
|
||||
const char *GetTrinityString(int32 entry) const;
|
||||
bool isAvailable(ChatCommand const& cmd) const;
|
||||
void SendSysMessage(const char *str);
|
||||
std::string GetNameLink() const;
|
||||
bool needReportToTarget(Player* chr) const;
|
||||
LocaleConstant GetSessionDbcLocale() const;
|
||||
int GetSessionDbLocaleIndex() const;
|
||||
char const* GetTrinityString(uint32 entry) const override;
|
||||
bool isAvailable(ChatCommand const& cmd) const override;
|
||||
void SendSysMessage(const char *str) override;
|
||||
std::string GetNameLink() const override;
|
||||
bool needReportToTarget(Player* chr) const override;
|
||||
LocaleConstant GetSessionDbcLocale() const override;
|
||||
int GetSessionDbLocaleIndex() const override;
|
||||
|
||||
private:
|
||||
void* m_callbackArg;
|
||||
|
||||
@@ -1117,9 +1117,9 @@ bool ConditionMgr::addToGossipMenus(Condition* cond)
|
||||
{
|
||||
for (GossipMenusContainer::iterator itr = pMenuBounds.first; itr != pMenuBounds.second; ++itr)
|
||||
{
|
||||
if ((*itr).second.entry == cond->SourceGroup && (*itr).second.text_id == uint32(cond->SourceEntry))
|
||||
if ((*itr).second.MenuID == cond->SourceGroup && (*itr).second.TextID == uint32(cond->SourceEntry))
|
||||
{
|
||||
(*itr).second.conditions.push_back(cond);
|
||||
(*itr).second.Conditions.push_back(cond);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1136,7 +1136,7 @@ bool ConditionMgr::addToGossipMenuItems(Condition* cond)
|
||||
{
|
||||
for (GossipMenuItemsContainer::iterator itr = pMenuItemBounds.first; itr != pMenuItemBounds.second; ++itr)
|
||||
{
|
||||
if ((*itr).second.MenuId == cond->SourceGroup && (*itr).second.OptionIndex == uint32(cond->SourceEntry))
|
||||
if ((*itr).second.MenuID == cond->SourceGroup && (*itr).second.OptionID == uint32(cond->SourceEntry))
|
||||
{
|
||||
(*itr).second.Conditions.push_back(cond);
|
||||
return true;
|
||||
|
||||
@@ -183,7 +183,6 @@ DBCStorage <VehicleSeatEntry> sVehicleSeatStore(VehicleSeatEntryfmt);
|
||||
DBCStorage <WMOAreaTableEntry> sWMOAreaTableStore(WMOAreaTableEntryfmt);
|
||||
DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore(WorldMapAreaEntryfmt);
|
||||
DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore(WorldMapOverlayEntryfmt);
|
||||
DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore(WorldSafeLocsEntryfmt);
|
||||
|
||||
typedef std::list<std::string> StoreProblemList;
|
||||
|
||||
@@ -589,7 +588,6 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
sWMOAreaInfoByTripple.insert(WMOAreaInfoByTripple::value_type(WMOAreaTableTripple(entry->rootId, entry->adtId, entry->groupId), entry));
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sWorldMapAreaStore, dbcPath, "WorldMapArea.dbc");
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sWorldMapOverlayStore, dbcPath, "WorldMapOverlay.dbc");
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sWorldSafeLocsStore, dbcPath, "WorldSafeLocs.dbc");
|
||||
|
||||
// error checks
|
||||
if (bad_dbc_files.size() >= DBCFileCount)
|
||||
|
||||
@@ -159,7 +159,6 @@ extern DBCStorage <VehicleSeatEntry> sVehicleSeatStore;
|
||||
extern DBCStorage <WMOAreaTableEntry> sWMOAreaTableStore;
|
||||
//extern DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore; -- use Zone2MapCoordinates and Map2ZoneCoordinates
|
||||
extern DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore;
|
||||
extern DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore;
|
||||
|
||||
void LoadDBCStores(const std::string& dataPath);
|
||||
|
||||
|
||||
@@ -2044,17 +2044,6 @@ struct WorldMapOverlayEntry
|
||||
// 9-16 some ints
|
||||
};
|
||||
|
||||
struct WorldSafeLocsEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
uint32 map_id; // 1
|
||||
float x; // 2
|
||||
float y; // 3
|
||||
float z; // 4
|
||||
//char* name[16] // 5-20 name, unused
|
||||
// 21 name flags, unused
|
||||
};
|
||||
|
||||
/*
|
||||
struct WorldStateSounds
|
||||
{
|
||||
|
||||
@@ -116,6 +116,5 @@ char const VehicleSeatEntryfmt[] = "niiffffffffffiiiiiifffffffiiifffiiiiiiiffiii
|
||||
char const WMOAreaTableEntryfmt[] = "niiixxxxxiixxxxxxxxxxxxxxxxx";
|
||||
char const WorldMapAreaEntryfmt[] = "xinxffffixx";
|
||||
char const WorldMapOverlayEntryfmt[] = "nxiiiixxxxxxxxxxx";
|
||||
char const WorldSafeLocsEntryfmt[] = "nifffxxxxxxxxxxxxxxxxx";
|
||||
|
||||
#endif
|
||||
|
||||
@@ -75,23 +75,44 @@ void GossipMenu::AddMenuItem(uint32 menuId, uint32 menuItemId, uint32 sender, ui
|
||||
for (GossipMenuItemsContainer::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
|
||||
{
|
||||
/// Find the one with the given menu item id.
|
||||
if (itr->second.OptionIndex != menuItemId)
|
||||
if (itr->second.OptionID != menuItemId)
|
||||
continue;
|
||||
|
||||
/// Store texts for localization.
|
||||
std::string strOptionText = itr->second.OptionText;
|
||||
std::string strBoxText = itr->second.BoxText;
|
||||
std::string strOptionText, strBoxText;
|
||||
BroadcastText const* optionBroadcastText = sObjectMgr->GetBroadcastText(itr->second.OptionBroadcastTextID);
|
||||
BroadcastText const* boxBroadcastText = sObjectMgr->GetBroadcastText(itr->second.BoxBroadcastTextID);
|
||||
|
||||
/// OptionText
|
||||
if (optionBroadcastText)
|
||||
ObjectMgr::GetLocaleString(optionBroadcastText->MaleText, GetLocale(), strOptionText);
|
||||
else
|
||||
strOptionText = itr->second.OptionText;
|
||||
|
||||
/// BoxText
|
||||
if (boxBroadcastText)
|
||||
ObjectMgr::GetLocaleString(boxBroadcastText->MaleText, GetLocale(), strBoxText);
|
||||
else
|
||||
strBoxText = itr->second.BoxText;
|
||||
|
||||
/// Check need of localization.
|
||||
if (GetLocale() != DEFAULT_LOCALE)
|
||||
/// Find localizations from database.
|
||||
if (GossipMenuItemsLocale const* no = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, menuItemId)))
|
||||
{
|
||||
if (!optionBroadcastText)
|
||||
{
|
||||
/// Translate texts if there are any.
|
||||
ObjectMgr::GetLocaleString(no->OptionText, GetLocale(), strOptionText);
|
||||
ObjectMgr::GetLocaleString(no->BoxText, GetLocale(), strBoxText);
|
||||
/// Find localizations from database.
|
||||
if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, menuItemId)))
|
||||
ObjectMgr::GetLocaleString(gossipMenuLocale->OptionText, GetLocale(), strOptionText);
|
||||
}
|
||||
|
||||
if (!boxBroadcastText)
|
||||
{
|
||||
/// Find localizations from database.
|
||||
if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, menuItemId)))
|
||||
ObjectMgr::GetLocaleString(gossipMenuLocale->BoxText, GetLocale(), strBoxText);
|
||||
}
|
||||
}
|
||||
|
||||
/// Add menu item with existing method. Menu item id -1 is also used in ADD_GOSSIP_ITEM macro.
|
||||
AddMenuItem(-1, itr->second.OptionIcon, strOptionText, sender, action, strBoxText, itr->second.BoxMoney, itr->second.BoxCoded);
|
||||
}
|
||||
@@ -588,23 +609,23 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
||||
void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, bool enableNext) const
|
||||
{
|
||||
std::string questTitle = quest->GetTitle();
|
||||
std::string questOfferRewardText = quest->GetOfferRewardText();
|
||||
std::string RewardText = quest->GetOfferRewardText();
|
||||
|
||||
int32 locale = _session->GetSessionDbLocaleIndex();
|
||||
if (locale >= 0)
|
||||
{
|
||||
if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(quest->GetQuestId()))
|
||||
{
|
||||
ObjectMgr::GetLocaleString(localeData->Title, locale, questTitle);
|
||||
ObjectMgr::GetLocaleString(localeData->OfferRewardText, locale, questOfferRewardText);
|
||||
}
|
||||
|
||||
if (QuestOfferRewardLocale const* questOfferRewardLocale = sObjectMgr->GetQuestOfferRewardLocale(quest->GetQuestId()))
|
||||
ObjectMgr::GetLocaleString(questOfferRewardLocale->RewardText, locale, RewardText);
|
||||
}
|
||||
|
||||
WorldPacket data(SMSG_QUESTGIVER_OFFER_REWARD, 400); // guess size
|
||||
data << uint64(npcGUID);
|
||||
data << uint32(quest->GetQuestId());
|
||||
data << questTitle;
|
||||
data << questOfferRewardText;
|
||||
data << RewardText;
|
||||
|
||||
data << uint8(enableNext ? 1 : 0); // Auto Finish
|
||||
data << uint32(quest->GetFlags()); // 3.3.3 questFlags
|
||||
@@ -690,10 +711,10 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID,
|
||||
if (locale >= 0)
|
||||
{
|
||||
if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(quest->GetQuestId()))
|
||||
{
|
||||
ObjectMgr::GetLocaleString(localeData->Title, locale, questTitle);
|
||||
ObjectMgr::GetLocaleString(localeData->RequestItemsText, locale, requestItemsText);
|
||||
}
|
||||
|
||||
if (QuestRequestItemsLocale const* questRequestItemsLocale = sObjectMgr->GetQuestRequestItemsLocale(quest->GetQuestId()))
|
||||
ObjectMgr::GetLocaleString(questRequestItemsLocale->CompletionText, locale, requestItemsText);
|
||||
}
|
||||
|
||||
if (!quest->GetReqItemsCount() && canComplete)
|
||||
|
||||
@@ -1849,8 +1849,17 @@ namespace Trinity
|
||||
: i_object(obj), i_msgtype(msgtype), i_textId(textId), i_language(Language(language)), i_target(target) { }
|
||||
void operator()(WorldPacket& data, LocaleConstant loc_idx)
|
||||
{
|
||||
char const* text = sObjectMgr->GetTrinityString(i_textId, loc_idx);
|
||||
ChatHandler::BuildChatPacket(data, i_msgtype, i_language, i_object, i_target, text, 0, "", loc_idx);
|
||||
if (BroadcastText const* broadcastText = sObjectMgr->GetBroadcastText(i_textId))
|
||||
{
|
||||
uint8 gender = GENDER_MALE;
|
||||
if (Unit const* unit = i_object->ToUnit())
|
||||
gender = unit->getGender();
|
||||
|
||||
std::string text = broadcastText->GetText(loc_idx, gender);
|
||||
ChatHandler::BuildChatPacket(data, i_msgtype, i_language, i_object, i_target, text, 0, "", loc_idx);
|
||||
}
|
||||
else
|
||||
sLog->outError("MonsterChatBuilder: `broadcast_text` id %i missing", i_textId);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -1975,10 +1984,17 @@ void WorldObject::MonsterWhisper(int32 textId, Player const* target, bool IsBoss
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
uint8 gender = GENDER_MALE;
|
||||
if (Unit const* unit = ToUnit())
|
||||
gender = unit->getGender();
|
||||
|
||||
LocaleConstant loc_idx = target->GetSession()->GetSessionDbLocaleIndex();
|
||||
char const* text = sObjectMgr->GetTrinityString(textId, loc_idx);
|
||||
|
||||
BroadcastText const* broadcastText = sObjectMgr->GetBroadcastText(textId);
|
||||
std::string text = broadcastText->GetText(loc_idx, gender);
|
||||
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, LANG_UNIVERSAL, this, target, text, 0, "", loc_idx);
|
||||
ChatHandler::BuildChatPacket(data, IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, LANG_UNIVERSAL, this, target, text.c_str(), 0, "", loc_idx);
|
||||
|
||||
target->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
#include "SavingSystem.h"
|
||||
#include "TicketMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
@@ -5566,7 +5567,7 @@ void Player::RepopAtGraveyard()
|
||||
SpawnCorpseBones();
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const* ClosestGrave = NULL;
|
||||
GraveyardStruct const* ClosestGrave = NULL;
|
||||
|
||||
// Special handle for battleground maps
|
||||
if (Battleground* bg = GetBattleground())
|
||||
@@ -5576,7 +5577,7 @@ void Player::RepopAtGraveyard()
|
||||
if (sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId()))
|
||||
ClosestGrave = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())->GetClosestGraveyard(this);
|
||||
else
|
||||
ClosestGrave = sObjectMgr->GetClosestGraveyard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeamId());
|
||||
ClosestGrave = sGraveyard->GetClosestGraveyard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeamId());
|
||||
}
|
||||
|
||||
// stop countdown until repop
|
||||
@@ -5586,11 +5587,11 @@ void Player::RepopAtGraveyard()
|
||||
// and don't show spirit healer location
|
||||
if (ClosestGrave)
|
||||
{
|
||||
TeleportTo(ClosestGrave->map_id, ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, GetOrientation());
|
||||
TeleportTo(ClosestGrave->Map, ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, GetOrientation());
|
||||
if (isDead()) // not send if alive, because it used in TeleportTo()
|
||||
{
|
||||
WorldPacket data(SMSG_DEATH_RELEASE_LOC, 4*4); // show spirit healer position on minimap
|
||||
data << ClosestGrave->map_id;
|
||||
data << ClosestGrave->Map;
|
||||
data << ClosestGrave->x;
|
||||
data << ClosestGrave->y;
|
||||
data << ClosestGrave->z;
|
||||
@@ -14817,7 +14818,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
|
||||
|
||||
if (Creature* creature = source->ToCreature())
|
||||
{
|
||||
if (!(itr->second.OptionNpcflag & npcflags))
|
||||
if (!(itr->second.OptionNpcFlag & npcflags))
|
||||
continue;
|
||||
|
||||
switch (itr->second.OptionType)
|
||||
@@ -14880,7 +14881,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
|
||||
canTalk = false;
|
||||
break;
|
||||
default:
|
||||
sLog->outErrorDb("Creature entry %u has unknown gossip option %u for menu %u", creature->GetEntry(), itr->second.OptionType, itr->second.MenuId);
|
||||
sLog->outErrorDb("Creature entry %u has unknown gossip option %u for menu %u", creature->GetEntry(), itr->second.OptionType, itr->second.MenuID);
|
||||
canTalk = false;
|
||||
break;
|
||||
}
|
||||
@@ -14901,22 +14902,40 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
|
||||
|
||||
if (canTalk)
|
||||
{
|
||||
std::string strOptionText = itr->second.OptionText;
|
||||
std::string strBoxText = itr->second.BoxText;
|
||||
std::string strOptionText, strBoxText;
|
||||
BroadcastText const* optionBroadcastText = sObjectMgr->GetBroadcastText(itr->second.OptionBroadcastTextID);
|
||||
BroadcastText const* boxBroadcastText = sObjectMgr->GetBroadcastText(itr->second.BoxBroadcastTextID);
|
||||
LocaleConstant locale = GetSession()->GetSessionDbLocaleIndex();
|
||||
|
||||
int32 locale = GetSession()->GetSessionDbLocaleIndex();
|
||||
if (locale >= 0)
|
||||
if (optionBroadcastText)
|
||||
ObjectMgr::GetLocaleString(getGender() == GENDER_MALE ? optionBroadcastText->MaleText : optionBroadcastText->FemaleText, locale, strOptionText);
|
||||
else
|
||||
strOptionText = itr->second.OptionText;
|
||||
|
||||
if (boxBroadcastText)
|
||||
ObjectMgr::GetLocaleString(getGender() == GENDER_MALE ? boxBroadcastText->MaleText : boxBroadcastText->FemaleText, locale, strBoxText);
|
||||
else
|
||||
strBoxText = itr->second.BoxText;
|
||||
|
||||
if (locale != DEFAULT_LOCALE)
|
||||
{
|
||||
uint32 idxEntry = MAKE_PAIR32(menuId, itr->second.OptionIndex);
|
||||
if (GossipMenuItemsLocale const* no = sObjectMgr->GetGossipMenuItemsLocale(idxEntry))
|
||||
if (!optionBroadcastText)
|
||||
{
|
||||
ObjectMgr::GetLocaleString(no->OptionText, locale, strOptionText);
|
||||
ObjectMgr::GetLocaleString(no->BoxText, locale, strBoxText);
|
||||
/// Find localizations from database.
|
||||
if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, menuId)))
|
||||
ObjectMgr::GetLocaleString(gossipMenuLocale->OptionText, locale, strOptionText);
|
||||
}
|
||||
|
||||
if (!boxBroadcastText)
|
||||
{
|
||||
/// Find localizations from database.
|
||||
if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, menuId)))
|
||||
ObjectMgr::GetLocaleString(gossipMenuLocale->BoxText, locale, strBoxText);
|
||||
}
|
||||
}
|
||||
|
||||
menu->GetGossipMenu().AddMenuItem(itr->second.OptionIndex, itr->second.OptionIcon, strOptionText, 0, itr->second.OptionType, strBoxText, itr->second.BoxMoney, itr->second.BoxCoded);
|
||||
menu->GetGossipMenu().AddGossipMenuItemData(itr->second.OptionIndex, itr->second.ActionMenuId, itr->second.ActionPoiId);
|
||||
menu->GetGossipMenu().AddMenuItem(itr->second.OptionID, itr->second.OptionIcon, strOptionText, 0, itr->second.OptionType, strBoxText, itr->second.BoxMoney, itr->second.BoxCoded);
|
||||
menu->GetGossipMenu().AddGossipMenuItemData(itr->second.OptionID, itr->second.ActionMenuID, itr->second.ActionPoiID);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15110,8 +15129,8 @@ uint32 Player::GetGossipTextId(uint32 menuId, WorldObject* source)
|
||||
|
||||
for (GossipMenusContainer::const_iterator itr = menuBounds.first; itr != menuBounds.second; ++itr)
|
||||
{
|
||||
if (sConditionMgr->IsObjectMeetToConditions(this, source, itr->second.conditions))
|
||||
textId = itr->second.text_id;
|
||||
if (sConditionMgr->IsObjectMeetToConditions(this, source, itr->second.Conditions))
|
||||
textId = itr->second.TextID;
|
||||
}
|
||||
|
||||
return textId;
|
||||
@@ -15746,15 +15765,23 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
uint32 quest_id = quest->GetQuestId();
|
||||
|
||||
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
if (quest->RequiredItemId[i])
|
||||
DestroyItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i], true);
|
||||
|
||||
{
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RequiredItemId[i]))
|
||||
{
|
||||
if (quest->RequiredItemCount[i] > 0 && itemTemplate->Bonding == BIND_QUEST_ITEM && !quest->IsRepeatable() && !HasQuestForItem(quest->RequiredItemId[i], quest_id, true))
|
||||
DestroyItemCount(quest->RequiredItemId[i], 9999, true);
|
||||
else
|
||||
DestroyItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i], true);
|
||||
}
|
||||
}
|
||||
for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
|
||||
{
|
||||
if (quest->ItemDrop[i])
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->ItemDrop[i]))
|
||||
{
|
||||
uint32 count = quest->ItemDropQuantity[i];
|
||||
DestroyItemCount(quest->ItemDrop[i], count ? count : 9999, true);
|
||||
if (quest->ItemDropQuantity[i] > 0 && itemTemplate->Bonding == BIND_QUEST_ITEM && !quest->IsRepeatable() && !HasQuestForItem(quest->ItemDrop[i], quest_id))
|
||||
DestroyItemCount(quest->ItemDrop[i], 9999, true);
|
||||
else
|
||||
DestroyItemCount(quest->ItemDrop[i], quest->ItemDropQuantity[i], true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15878,7 +15905,10 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
{
|
||||
//- TODO: Poor design of mail system
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
MailDraft(mail_template_id).SendMailTo(trans, this, questGiver, MAIL_CHECK_MASK_HAS_BODY, quest->GetRewMailDelaySecs());
|
||||
if (quest->GetRewMailSenderEntry() != 0)
|
||||
MailDraft(mail_template_id).SendMailTo(trans, this, quest->GetRewMailSenderEntry(), MAIL_CHECK_MASK_HAS_BODY, quest->GetRewMailDelaySecs());
|
||||
else
|
||||
MailDraft(mail_template_id).SendMailTo(trans, this, questGiver, MAIL_CHECK_MASK_HAS_BODY, quest->GetRewMailDelaySecs());
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
}
|
||||
|
||||
@@ -15985,14 +16015,32 @@ void Player::FailQuest(uint32 questId)
|
||||
SendQuestFailed(questId);
|
||||
|
||||
// Destroy quest items on quest failure.
|
||||
for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
if (quest->RequiredItemId[i] > 0 && quest->RequiredItemCount[i] > 0)
|
||||
// Destroy items received on starting the quest.
|
||||
DestroyItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i], true, true);
|
||||
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RequiredItemId[i]))
|
||||
if (quest->RequiredItemCount[i] > 0 && itemTemplate->Bonding == BIND_QUEST_ITEM)
|
||||
DestroyItemCount(quest->RequiredItemId[i], 9999, true);
|
||||
|
||||
for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
|
||||
if (quest->ItemDrop[i] > 0 && quest->ItemDropQuantity[i] > 0)
|
||||
// Destroy items received during the quest.
|
||||
DestroyItemCount(quest->ItemDrop[i], quest->ItemDropQuantity[i], true, true);
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->ItemDrop[i]))
|
||||
if (quest->ItemDropQuantity[i] > 0 && itemTemplate->Bonding == BIND_QUEST_ITEM)
|
||||
DestroyItemCount(quest->ItemDrop[i], 9999, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Player::AbandonQuest(uint32 questId)
|
||||
{
|
||||
if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
|
||||
{
|
||||
// It will Destroy quest items on quests abandons.
|
||||
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RequiredItemId[i]))
|
||||
if (quest->RequiredItemCount[i] > 0 && itemTemplate->Bonding == BIND_QUEST_ITEM)
|
||||
DestroyItemCount(quest->RequiredItemId[i], 9999, true);
|
||||
|
||||
for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->ItemDrop[i]))
|
||||
if (quest->ItemDropQuantity[i] > 0 && itemTemplate->Bonding == BIND_QUEST_ITEM)
|
||||
DestroyItemCount(quest->ItemDrop[i], 9999, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17220,12 +17268,12 @@ void Player::ReputationChanged2(FactionEntry const* factionEntry)
|
||||
}
|
||||
}
|
||||
|
||||
bool Player::HasQuestForItem(uint32 itemid) const
|
||||
bool Player::HasQuestForItem(uint32 itemid, uint32 excludeQuestId /* 0 */, bool turnIn /* false */) const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i)
|
||||
{
|
||||
uint32 questid = GetQuestSlotQuestId(i);
|
||||
if (questid == 0)
|
||||
if (questid == 0 || questid == excludeQuestId)
|
||||
continue;
|
||||
|
||||
QuestStatusMap::const_iterator qs_itr = m_QuestStatus.find(questid);
|
||||
@@ -17234,7 +17282,7 @@ bool Player::HasQuestForItem(uint32 itemid) const
|
||||
|
||||
QuestStatusData const& q_status = qs_itr->second;
|
||||
|
||||
if (q_status.Status == QUEST_STATUS_INCOMPLETE)
|
||||
if ((q_status.Status == QUEST_STATUS_INCOMPLETE) || (turnIn && q_status.Status == QUEST_STATUS_COMPLETE))
|
||||
{
|
||||
Quest const* qinfo = sObjectMgr->GetQuestTemplate(questid);
|
||||
if (!qinfo)
|
||||
@@ -17249,7 +17297,7 @@ bool Player::HasQuestForItem(uint32 itemid) const
|
||||
// This part for ReqItem drop
|
||||
for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
if (itemid == qinfo->RequiredItemId[j] && q_status.ItemCount[j] < qinfo->RequiredItemCount[j])
|
||||
if ((itemid == qinfo->RequiredItemId[j] && q_status.ItemCount[j] < qinfo->RequiredItemCount[j]) || (turnIn && q_status.ItemCount[j] >= qinfo->RequiredItemCount[j]))
|
||||
return true;
|
||||
}
|
||||
// This part - for ReqSource
|
||||
@@ -17259,17 +17307,18 @@ bool Player::HasQuestForItem(uint32 itemid) const
|
||||
if (qinfo->ItemDrop[j] == itemid)
|
||||
{
|
||||
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(itemid);
|
||||
|
||||
uint32 ownedCount = GetItemCount(itemid, true);
|
||||
// 'unique' item
|
||||
if (pProto->MaxCount && int32(GetItemCount(itemid, true)) < pProto->MaxCount)
|
||||
if ((pProto->MaxCount && int32(ownedCount) < pProto->MaxCount) || (turnIn && int32(ownedCount) >= pProto->MaxCount))
|
||||
return true;
|
||||
|
||||
// allows custom amount drop when not 0
|
||||
if (qinfo->ItemDropQuantity[j])
|
||||
{
|
||||
if (GetItemCount(itemid, true) < qinfo->ItemDropQuantity[j])
|
||||
if ((ownedCount < qinfo->ItemDropQuantity[j]) || (turnIn && ownedCount >= qinfo->ItemDropQuantity[j]))
|
||||
return true;
|
||||
} else if (GetItemCount(itemid, true) < pProto->GetMaxStackSize())
|
||||
}
|
||||
else if (ownedCount < pProto->GetMaxStackSize())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -22564,8 +22613,8 @@ void Player::SetEntryPoint()
|
||||
|
||||
if (GetMap()->IsDungeon())
|
||||
{
|
||||
if (const WorldSafeLocsEntry* entry = sObjectMgr->GetClosestGraveyard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeamId()))
|
||||
m_entryPointData.joinPos = WorldLocation(entry->map_id, entry->x, entry->y, entry->z, 0.0f);
|
||||
if (const GraveyardStruct* entry = sGraveyard->GetClosestGraveyard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeamId()))
|
||||
m_entryPointData.joinPos = WorldLocation(entry->Map, entry->x, entry->y, entry->z, 0.0f);
|
||||
}
|
||||
else if (!GetMap()->IsBattlegroundOrArena())
|
||||
m_entryPointData.joinPos = WorldLocation(GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
|
||||
|
||||
@@ -1399,6 +1399,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
bool CanRewardQuest(Quest const* quest, uint32 reward, bool msg);
|
||||
void AddQuestAndCheckCompletion(Quest const* quest, Object* questGiver);
|
||||
void AddQuest(Quest const* quest, Object* questGiver);
|
||||
void AbandonQuest(uint32 quest_id);
|
||||
void CompleteQuest(uint32 quest_id);
|
||||
void IncompleteQuest(uint32 quest_id);
|
||||
void RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, bool announce = true);
|
||||
@@ -1486,7 +1487,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void MoneyChanged(uint32 value);
|
||||
void ReputationChanged(FactionEntry const* factionEntry);
|
||||
void ReputationChanged2(FactionEntry const* factionEntry);
|
||||
bool HasQuestForItem(uint32 itemid) const;
|
||||
bool HasQuestForItem(uint32 itemId, uint32 excludeQuestId = 0, bool turnIn = false) const;
|
||||
bool HasQuestForGO(int32 GOId) const;
|
||||
void UpdateForQuestWorldObjects();
|
||||
bool CanShareQuest(uint32 quest_id) const;
|
||||
|
||||
@@ -178,6 +178,7 @@ i_motionMaster(new MotionMaster(this)), m_regenTimer(0), m_ThreatManager(this),
|
||||
m_rootTimes = 0;
|
||||
|
||||
m_state = 0;
|
||||
m_petCatchUp = false;
|
||||
m_deathState = ALIVE;
|
||||
|
||||
for (uint8 i = 0; i < CURRENT_MAX_SPELL; ++i)
|
||||
@@ -13093,8 +13094,40 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
|
||||
Unit* pOwner = GetCharmerOrOwner();
|
||||
if (pOwner && !IsInCombat() && !IsVehicle() && !HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED) && (IsPet() || IsGuardian() || GetGUID() == pOwner->GetCritterGUID() || GetCharmerGUID() == pOwner->GetGUID()))
|
||||
{
|
||||
if (speed < pOwner->GetSpeedRate(mtype)+0.1f)
|
||||
speed = pOwner->GetSpeedRate(mtype)+0.1f; // pets derive speed from owner when not in combat
|
||||
if (pOwner->GetTypeId() != TYPEID_PLAYER)
|
||||
{
|
||||
if (speed < pOwner->GetSpeedRate(mtype)+0.1f)
|
||||
speed = pOwner->GetSpeedRate(mtype)+0.1f; // pets derive speed from owner when not in combat
|
||||
}
|
||||
else
|
||||
{
|
||||
// special treatment for player pets in order to avoid stuttering
|
||||
float ownerSpeed = pOwner->GetSpeedRate(mtype);
|
||||
float distOwner = GetDistance(pOwner);
|
||||
float minDist = 2.5f;
|
||||
|
||||
if (ToCreature()->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET)
|
||||
{
|
||||
// different minimum distance for vanity pets
|
||||
minDist = 5.0f;
|
||||
|
||||
if (mtype == MOVE_FLIGHT)
|
||||
mtype = MOVE_RUN; // vanity pets use run speed for flight
|
||||
}
|
||||
|
||||
float maxDist = ownerSpeed >= 1.0f ? minDist * ownerSpeed * 1.5f : minDist * 1.5f;
|
||||
|
||||
if (distOwner < minDist && m_petCatchUp)
|
||||
m_petCatchUp = false;
|
||||
|
||||
if (distOwner > maxDist && !m_petCatchUp)
|
||||
m_petCatchUp = true;
|
||||
|
||||
if (m_petCatchUp)
|
||||
speed = ownerSpeed * 1.05f;
|
||||
else
|
||||
speed = ownerSpeed * 0.95f;
|
||||
}
|
||||
}
|
||||
else
|
||||
speed *= ToCreature()->GetCreatureTemplate()->speed_run; // at this point, MOVE_WALK is never reached
|
||||
|
||||
@@ -2561,6 +2561,7 @@ class Unit : public WorldObject
|
||||
bool m_duringRemoveFromWorld; // lock made to not add stuff after begining removing from world
|
||||
|
||||
uint32 _oldFactionId; ///< faction before charm
|
||||
bool m_petCatchUp;
|
||||
};
|
||||
|
||||
namespace Trinity
|
||||
|
||||
@@ -209,8 +209,8 @@ void GameEventMgr::LoadFromDB()
|
||||
{
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
// 1 2 3 4 5 6 7 8 9
|
||||
QueryResult result = WorldDatabase.Query("SELECT eventEntry, UNIX_TIMESTAMP(start_time), UNIX_TIMESTAMP(end_time), occurence, length, holiday, holidayStage, description, world_event FROM game_event");
|
||||
// 1 2 3 4 5 6 7 8 9 10
|
||||
QueryResult result = WorldDatabase.Query("SELECT eventEntry, UNIX_TIMESTAMP(start_time), UNIX_TIMESTAMP(end_time), occurence, length, holiday, holidayStage, description, world_event, announce FROM game_event");
|
||||
if (!result)
|
||||
{
|
||||
mGameEvent.clear();
|
||||
@@ -243,6 +243,7 @@ void GameEventMgr::LoadFromDB()
|
||||
pGameEvent.holidayStage = fields[6].GetUInt8();
|
||||
pGameEvent.description = fields[7].GetString();
|
||||
pGameEvent.state = (GameEventState)(fields[8].GetUInt8());
|
||||
pGameEvent.announce = fields[9].GetUInt8();
|
||||
pGameEvent.nextstart = 0;
|
||||
|
||||
++count;
|
||||
@@ -1189,14 +1190,9 @@ void GameEventMgr::UnApplyEvent(uint16 event_id)
|
||||
|
||||
void GameEventMgr::ApplyNewEvent(uint16 event_id)
|
||||
{
|
||||
switch (sWorld->getIntConfig(CONFIG_EVENT_ANNOUNCE))
|
||||
{
|
||||
case 0: // disable
|
||||
break;
|
||||
case 1: // announce events
|
||||
sWorld->SendWorldText(LANG_EVENTMESSAGE, mGameEvent[event_id].description.c_str());
|
||||
break;
|
||||
}
|
||||
uint8 announce = mGameEvent[event_id].announce;
|
||||
if (announce == 1 || (announce == 2 && sWorld->getIntConfig(CONFIG_EVENT_ANNOUNCE)))
|
||||
sWorld->SendWorldText(LANG_EVENTMESSAGE, mGameEvent[event_id].description.c_str());
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDetail("GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str());
|
||||
|
||||
@@ -55,6 +55,7 @@ struct GameEventData
|
||||
GameEventConditionMap conditions; // conditions to finish
|
||||
std::set<uint16 /*gameevent id*/> prerequisite_events; // events that must be completed before starting this event
|
||||
std::string description;
|
||||
uint8 announce; // if 0 dont announce, if 1 announce, if 2 take config value
|
||||
|
||||
bool isValid() const { return length > 0 || state > GAMEEVENT_NORMAL; }
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -469,15 +469,13 @@ typedef UNORDERED_MAP<uint32/*(mapid, spawnMode) pair*/, CellObjectGuidsMap> Map
|
||||
// Trinity string ranges
|
||||
#define MIN_TRINITY_STRING_ID 1 // 'trinity_string'
|
||||
#define MAX_TRINITY_STRING_ID 2000000000
|
||||
#define MIN_DB_SCRIPT_STRING_ID MAX_TRINITY_STRING_ID // 'db_script_string'
|
||||
#define MAX_DB_SCRIPT_STRING_ID 2000010000
|
||||
#define MIN_CREATURE_AI_TEXT_STRING_ID (-1) // 'creature_ai_texts'
|
||||
#define MAX_CREATURE_AI_TEXT_STRING_ID (-1000000)
|
||||
|
||||
// Trinity Trainer Reference start range
|
||||
#define TRINITY_TRAINER_START_REF 200000
|
||||
|
||||
struct TrinityStringLocale
|
||||
struct TrinityString
|
||||
{
|
||||
StringVector Content;
|
||||
};
|
||||
@@ -491,9 +489,11 @@ typedef UNORDERED_MAP<uint32, GameObjectLocale> GameObjectLocaleContainer;
|
||||
typedef UNORDERED_MAP<uint32, ItemLocale> ItemLocaleContainer;
|
||||
typedef UNORDERED_MAP<uint32, ItemSetNameLocale> ItemSetNameLocaleContainer;
|
||||
typedef UNORDERED_MAP<uint32, QuestLocale> QuestLocaleContainer;
|
||||
typedef UNORDERED_MAP<uint32, QuestOfferRewardLocale> QuestOfferRewardLocaleContainer;
|
||||
typedef UNORDERED_MAP<uint32, QuestRequestItemsLocale> QuestRequestItemsLocaleContainer;
|
||||
typedef UNORDERED_MAP<uint32, NpcTextLocale> NpcTextLocaleContainer;
|
||||
typedef UNORDERED_MAP<uint32, PageTextLocale> PageTextLocaleContainer;
|
||||
typedef UNORDERED_MAP<int32, TrinityStringLocale> TrinityStringLocaleContainer;
|
||||
typedef UNORDERED_MAP<int32, TrinityString> TrinityStringContainer;
|
||||
typedef UNORDERED_MAP<uint32, GossipMenuItemsLocale> GossipMenuItemsLocaleContainer;
|
||||
typedef UNORDERED_MAP<uint32, PointOfInterestLocale> PointOfInterestLocaleContainer;
|
||||
|
||||
@@ -570,25 +570,27 @@ struct PointOfInterest
|
||||
|
||||
struct GossipMenuItems
|
||||
{
|
||||
uint32 MenuId;
|
||||
uint32 OptionIndex;
|
||||
uint32 MenuID;
|
||||
uint32 OptionID;
|
||||
uint8 OptionIcon;
|
||||
std::string OptionText;
|
||||
uint32 OptionBroadcastTextID;
|
||||
uint32 OptionType;
|
||||
uint32 OptionNpcflag;
|
||||
uint32 ActionMenuId;
|
||||
uint32 ActionPoiId;
|
||||
uint32 OptionNpcFlag;
|
||||
uint32 ActionMenuID;
|
||||
uint32 ActionPoiID;
|
||||
bool BoxCoded;
|
||||
uint32 BoxMoney;
|
||||
std::string BoxText;
|
||||
ConditionList Conditions;
|
||||
uint32 BoxBroadcastTextID;
|
||||
};
|
||||
|
||||
struct GossipMenus
|
||||
{
|
||||
uint32 entry;
|
||||
uint32 text_id;
|
||||
ConditionList conditions;
|
||||
uint32 MenuID;
|
||||
uint32 TextID;
|
||||
ConditionList Conditions;
|
||||
};
|
||||
|
||||
typedef std::multimap<uint32, GossipMenus> GossipMenusContainer;
|
||||
@@ -625,16 +627,6 @@ struct QuestPOI
|
||||
typedef std::vector<QuestPOI> QuestPOIVector;
|
||||
typedef UNORDERED_MAP<uint32, QuestPOIVector> QuestPOIContainer;
|
||||
|
||||
struct GraveyardData
|
||||
{
|
||||
uint32 safeLocId;
|
||||
TeamId teamId;
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
@@ -811,14 +803,7 @@ class ObjectMgr
|
||||
return _tavernAreaTriggerStore.find(Trigger_ID) != _tavernAreaTriggerStore.end();
|
||||
}
|
||||
|
||||
GossipText const* GetGossipText(uint32 Text_ID) const;
|
||||
|
||||
WorldSafeLocsEntry const* GetDefaultGraveyard(TeamId teamId);
|
||||
WorldSafeLocsEntry const* GetClosestGraveyard(float x, float y, float z, uint32 MapId, TeamId teamId);
|
||||
bool AddGraveyardLink(uint32 id, uint32 zoneId, TeamId teamId, bool persist = true);
|
||||
void RemoveGraveyardLink(uint32 id, uint32 zoneId, TeamId teamId, bool persist = false);
|
||||
void LoadGraveyardZones();
|
||||
GraveyardData const* FindGraveyardData(uint32 id, uint32 zone);
|
||||
GossipText const* GetGossipText(uint32 Text_ID) const;
|
||||
|
||||
AreaTrigger const* GetAreaTrigger(uint32 trigger) const
|
||||
{
|
||||
@@ -969,9 +954,7 @@ class ObjectMgr
|
||||
void ValidateSpellScripts();
|
||||
void InitializeSpellInfoPrecomputedData();
|
||||
|
||||
bool LoadTrinityStrings(char const* table, int32 min_value, int32 max_value);
|
||||
bool LoadTrinityStrings() { return LoadTrinityStrings("trinity_string", MIN_TRINITY_STRING_ID, MAX_TRINITY_STRING_ID); }
|
||||
void LoadDbScriptStrings();
|
||||
bool LoadTrinityStrings();
|
||||
void LoadBroadcastTexts();
|
||||
void LoadBroadcastTextLocales();
|
||||
void LoadCreatureClassLevelStats();
|
||||
@@ -997,6 +980,8 @@ class ObjectMgr
|
||||
void LoadItemSetNameLocales();
|
||||
void LoadQuestLocales();
|
||||
void LoadNpcTextLocales();
|
||||
void LoadQuestOfferRewardLocale();
|
||||
void LoadQuestRequestItemsLocale();
|
||||
void LoadPageTextLocales();
|
||||
void LoadGossipMenuItemsLocales();
|
||||
void LoadPointOfInterestLocales();
|
||||
@@ -1198,6 +1183,18 @@ class ObjectMgr
|
||||
if (itr == _pointOfInterestLocaleStore.end()) return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
QuestOfferRewardLocale const* GetQuestOfferRewardLocale(uint32 entry) const
|
||||
{
|
||||
auto itr = _questOfferRewardLocaleStore.find(entry);
|
||||
if (itr == _questOfferRewardLocaleStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
QuestRequestItemsLocale const* GetQuestRequestItemsLocale(uint32 entry) const
|
||||
{
|
||||
auto itr = _questRequestItemsLocaleStore.find(entry);
|
||||
if (itr == _questRequestItemsLocaleStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
NpcTextLocale const* GetNpcTextLocale(uint32 entry) const
|
||||
{
|
||||
NpcTextLocaleContainer::const_iterator itr = _npcTextLocaleStore.find(entry);
|
||||
@@ -1206,15 +1203,17 @@ class ObjectMgr
|
||||
}
|
||||
GameObjectData& NewGOData(uint32 guid) { return _gameObjectDataStore[guid]; }
|
||||
void DeleteGOData(uint32 guid);
|
||||
|
||||
TrinityStringLocale const* GetTrinityStringLocale(int32 entry) const
|
||||
|
||||
TrinityString const* GetTrinityString(uint32 entry) const
|
||||
{
|
||||
TrinityStringLocaleContainer::const_iterator itr = _trinityStringLocaleStore.find(entry);
|
||||
if (itr == _trinityStringLocaleStore.end()) return NULL;
|
||||
TrinityStringContainer::const_iterator itr = _trinityStringStore.find(entry);
|
||||
if (itr == _trinityStringStore.end())
|
||||
return NULL;
|
||||
|
||||
return &itr->second;
|
||||
}
|
||||
const char *GetTrinityString(int32 entry, LocaleConstant locale_idx) const;
|
||||
const char *GetTrinityStringForDBCLocale(int32 entry) const { return GetTrinityString(entry, DBCLocaleIndex); }
|
||||
char const* GetTrinityString(uint32 entry, LocaleConstant locale) const;
|
||||
char const* GetTrinityStringForDBCLocale(uint32 entry) const { return GetTrinityString(entry, DBCLocaleIndex); }
|
||||
LocaleConstant GetDBCLocaleIndex() const { return DBCLocaleIndex; }
|
||||
void SetDBCLocaleIndex(LocaleConstant locale) { DBCLocaleIndex = locale; }
|
||||
|
||||
@@ -1304,9 +1303,6 @@ class ObjectMgr
|
||||
return _gossipMenuItemsStore.equal_range(uiMenuId);
|
||||
}
|
||||
|
||||
// for wintergrasp only
|
||||
GraveyardContainer GraveyardStore;
|
||||
|
||||
static void AddLocaleString(std::string const& s, LocaleConstant locale, StringVector& data);
|
||||
static inline void GetLocaleString(const StringVector& data, int loc_idx, std::string& value)
|
||||
{
|
||||
@@ -1400,7 +1396,6 @@ class ObjectMgr
|
||||
|
||||
private:
|
||||
void LoadScripts(ScriptsType type);
|
||||
void CheckScripts(ScriptsType type, std::set<int32>& ids);
|
||||
void LoadQuestRelationsHelper(QuestRelations& map, std::string const& table, bool starter, bool go);
|
||||
void PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint32 itemId, int32 count);
|
||||
|
||||
@@ -1461,9 +1456,11 @@ class ObjectMgr
|
||||
ItemLocaleContainer _itemLocaleStore;
|
||||
ItemSetNameLocaleContainer _itemSetNameLocaleStore;
|
||||
QuestLocaleContainer _questLocaleStore;
|
||||
QuestOfferRewardLocaleContainer _questOfferRewardLocaleStore;
|
||||
QuestRequestItemsLocaleContainer _questRequestItemsLocaleStore;
|
||||
NpcTextLocaleContainer _npcTextLocaleStore;
|
||||
PageTextLocaleContainer _pageTextLocaleStore;
|
||||
TrinityStringLocaleContainer _trinityStringLocaleStore;
|
||||
TrinityStringContainer _trinityStringStore;
|
||||
GossipMenuItemsLocaleContainer _gossipMenuItemsLocaleStore;
|
||||
PointOfInterestLocaleContainer _pointOfInterestLocaleStore;
|
||||
|
||||
@@ -1486,7 +1483,4 @@ class ObjectMgr
|
||||
|
||||
#define sObjectMgr ACE_Singleton<ObjectMgr, ACE_Null_Mutex>::instance()
|
||||
|
||||
// scripting access functions
|
||||
bool LoadTrinityStrings(char const* table, int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min());
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "Chat.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
#define MOVEMENT_PACKET_TIME_DELAY 0
|
||||
|
||||
@@ -487,11 +488,10 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData)
|
||||
}
|
||||
else if (!plrMover->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IS_OUT_OF_BOUNDS))
|
||||
{
|
||||
WorldSafeLocsEntry const* grave = sObjectMgr->GetClosestGraveyard(plrMover->GetPositionX(), plrMover->GetPositionY(), plrMover->GetPositionZ(), plrMover->GetMapId(), plrMover->GetTeamId());
|
||||
|
||||
GraveyardStruct const* grave = sGraveyard->GetClosestGraveyard(plrMover->GetPositionX(), plrMover->GetPositionY(), plrMover->GetPositionZ(), plrMover->GetMapId(), plrMover->GetTeamId());
|
||||
if (grave)
|
||||
{
|
||||
plrMover->TeleportTo(grave->map_id, grave->x, grave->y, grave->z, plrMover->GetOrientation());
|
||||
plrMover->TeleportTo(grave->Map, grave->x, grave->y, grave->z, plrMover->GetOrientation());
|
||||
plrMover->Relocate(grave->x, grave->y, grave->z, plrMover->GetOrientation());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "ScriptMgr.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
enum StableResultCode
|
||||
{
|
||||
@@ -446,10 +447,10 @@ void WorldSession::SendSpiritResurrect()
|
||||
_player->DurabilityLossAll(0.25f, true);
|
||||
|
||||
// get corpse nearest graveyard
|
||||
WorldSafeLocsEntry const* corpseGrave = NULL;
|
||||
GraveyardStruct const* corpseGrave = NULL;
|
||||
Corpse* corpse = _player->GetCorpse();
|
||||
if (corpse)
|
||||
corpseGrave = sObjectMgr->GetClosestGraveyard(corpse->GetPositionX(), corpse->GetPositionY(), corpse->GetPositionZ(), corpse->GetMapId(), _player->GetTeamId());
|
||||
corpseGrave = sGraveyard->GetClosestGraveyard(corpse->GetPositionX(), corpse->GetPositionY(), corpse->GetPositionZ(), corpse->GetMapId(), _player->GetTeamId());
|
||||
|
||||
// now can spawn bones
|
||||
_player->SpawnCorpseBones();
|
||||
@@ -457,10 +458,10 @@ void WorldSession::SendSpiritResurrect()
|
||||
// teleport to nearest from corpse graveyard, if different from nearest to player ghost
|
||||
if (corpseGrave)
|
||||
{
|
||||
WorldSafeLocsEntry const* ghostGrave = sObjectMgr->GetClosestGraveyard(_player->GetPositionX(), _player->GetPositionY(), _player->GetPositionZ(), _player->GetMapId(), _player->GetTeamId());
|
||||
GraveyardStruct const* ghostGrave = sGraveyard->GetClosestGraveyard(_player->GetPositionX(), _player->GetPositionY(), _player->GetPositionZ(), _player->GetMapId(), _player->GetTeamId());
|
||||
|
||||
if (corpseGrave != ghostGrave)
|
||||
_player->TeleportTo(corpseGrave->map_id, corpseGrave->x, corpseGrave->y, corpseGrave->z, _player->GetOrientation());
|
||||
_player->TeleportTo(corpseGrave->Map, corpseGrave->x, corpseGrave->y, corpseGrave->z, _player->GetOrientation());
|
||||
// or update at original position
|
||||
//else
|
||||
// _player->UpdateObjectVisibility(); // xinef: not needed, called in ResurrectPlayer
|
||||
|
||||
@@ -277,17 +277,17 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData)
|
||||
|
||||
recvData >> textID;
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID);
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_NPC_TEXT_QUERY TextId: %u", textID);
|
||||
#endif
|
||||
|
||||
recvData >> guid;
|
||||
|
||||
GossipText const* pGossip = sObjectMgr->GetGossipText(textID);
|
||||
GossipText const* gossip = sObjectMgr->GetGossipText(textID);
|
||||
|
||||
WorldPacket data(SMSG_NPC_TEXT_UPDATE, 100); // guess size
|
||||
data << textID;
|
||||
|
||||
if (!pGossip)
|
||||
if (!gossip)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_GOSSIP_TEXT_OPTIONS; ++i)
|
||||
{
|
||||
@@ -307,10 +307,10 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData)
|
||||
{
|
||||
std::string text0[MAX_GOSSIP_TEXT_OPTIONS], text1[MAX_GOSSIP_TEXT_OPTIONS];
|
||||
LocaleConstant locale = GetSessionDbLocaleIndex();
|
||||
|
||||
|
||||
for (uint8 i = 0; i < MAX_GOSSIP_TEXT_OPTIONS; ++i)
|
||||
{
|
||||
BroadcastText const* bct = sObjectMgr->GetBroadcastText(pGossip->Options[i].BroadcastTextID);
|
||||
BroadcastText const* bct = sObjectMgr->GetBroadcastText(gossip->Options[i].BroadcastTextID);
|
||||
if (bct)
|
||||
{
|
||||
text0[i] = bct->GetText(locale, GENDER_MALE, true);
|
||||
@@ -318,8 +318,8 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData)
|
||||
}
|
||||
else
|
||||
{
|
||||
text0[i] = pGossip->Options[i].Text_0;
|
||||
text1[i] = pGossip->Options[i].Text_1;
|
||||
text0[i] = gossip->Options[i].Text_0;
|
||||
text1[i] = gossip->Options[i].Text_1;
|
||||
}
|
||||
|
||||
if (locale != DEFAULT_LOCALE && !bct)
|
||||
@@ -331,7 +331,7 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData)
|
||||
}
|
||||
}
|
||||
|
||||
data << pGossip->Options[i].Probability;
|
||||
data << gossip->Options[i].Probability;
|
||||
|
||||
if (text0[i].empty())
|
||||
data << text1[i];
|
||||
@@ -343,12 +343,12 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData)
|
||||
else
|
||||
data << text1[i];
|
||||
|
||||
data << pGossip->Options[i].Language;
|
||||
data << gossip->Options[i].Language;
|
||||
|
||||
for (uint8 j = 0; j < MAX_GOSSIP_TEXT_EMOTES; ++j)
|
||||
{
|
||||
data << pGossip->Options[i].Emotes[j]._Delay;
|
||||
data << pGossip->Options[i].Emotes[j]._Emote;
|
||||
data << gossip->Options[i].Emotes[j]._Delay;
|
||||
data << gossip->Options[i].Emotes[j]._Emote;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -418,6 +418,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData)
|
||||
}
|
||||
|
||||
_player->TakeQuestSourceItem(questId, true); // remove quest src item from player
|
||||
_player->AbandonQuest(questId); // remove all quest items player received before abandoning quest.
|
||||
_player->RemoveActiveQuest(questId);
|
||||
_player->RemoveTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, questId);
|
||||
#ifdef ELUNA
|
||||
|
||||
@@ -61,6 +61,13 @@ MailSender::MailSender(Player* sender)
|
||||
m_senderId = sender->GetGUIDLow();
|
||||
}
|
||||
|
||||
MailSender::MailSender(uint32 senderEntry)
|
||||
{
|
||||
m_messageType = MAIL_CREATURE;
|
||||
m_senderId = senderEntry;
|
||||
m_stationery = MAIL_STATIONERY_DEFAULT;
|
||||
}
|
||||
|
||||
MailReceiver::MailReceiver(Player* receiver) : m_receiver(receiver), m_receiver_lowguid(receiver->GetGUIDLow())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -77,6 +77,7 @@ class MailSender
|
||||
MailSender(CalendarEvent* sender);
|
||||
MailSender(AuctionEntry* sender);
|
||||
MailSender(Player* sender);
|
||||
MailSender(uint32 senderEntry);
|
||||
public: // Accessors
|
||||
MailMessageType GetMailMessageType() const { return m_messageType; }
|
||||
uint32 GetSenderId() const { return m_senderId; }
|
||||
|
||||
@@ -0,0 +1,371 @@
|
||||
#include "GameGraveyard.h"
|
||||
#include "MapManager.h"
|
||||
#include "DBCStores.h"
|
||||
#include "Log.h"
|
||||
|
||||
void Graveyard::LoadGraveyardFromDB()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
_graveyardStore.clear();
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT ID, Map, x, y, z, Comment FROM game_graveyard");
|
||||
if (!result)
|
||||
{
|
||||
sLog->outString(">> Loaded 0 graveyard. Table `game_graveyard` is empty!");
|
||||
sLog->outString();
|
||||
return;
|
||||
}
|
||||
|
||||
int32 Count = 0;
|
||||
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
uint32 ID = fields[0].GetUInt32();
|
||||
|
||||
GraveyardStruct Graveyard;
|
||||
|
||||
Graveyard.Map = fields[1].GetUInt32();
|
||||
Graveyard.x = fields[2].GetFloat();
|
||||
Graveyard.y = fields[3].GetFloat();
|
||||
Graveyard.z = fields[4].GetFloat();
|
||||
Graveyard.name = fields[5].GetString();
|
||||
|
||||
if (!Utf8toWStr(Graveyard.name, Graveyard.wnameLow))
|
||||
{
|
||||
sLog->outErrorDb("Wrong UTF8 name for id %u in `game_graveyard` table, ignoring.", ID);
|
||||
continue;
|
||||
}
|
||||
|
||||
wstrToLower(Graveyard.wnameLow);
|
||||
|
||||
_graveyardStore[ID] = Graveyard;
|
||||
|
||||
++Count;
|
||||
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded %i graveyard in %u ms", Count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
GraveyardStruct const* Graveyard::GetGraveyard(uint32 ID) const
|
||||
{
|
||||
GraveyardContainer::const_iterator itr = _graveyardStore.find(ID);
|
||||
if (itr != _graveyardStore.end())
|
||||
return &itr->second;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GraveyardStruct const* Graveyard::GetDefaultGraveyard(TeamId teamId)
|
||||
{
|
||||
enum DefaultGraveyard
|
||||
{
|
||||
HORDE_GRAVEYARD = 10, // Crossroads
|
||||
ALLIANCE_GRAVEYARD = 4, // Westfall
|
||||
};
|
||||
|
||||
return sGraveyard->GetGraveyard(teamId == TEAM_HORDE ? HORDE_GRAVEYARD : ALLIANCE_GRAVEYARD);
|
||||
}
|
||||
|
||||
GraveyardStruct const* Graveyard::GetClosestGraveyard(float x, float y, float z, uint32 MapId, TeamId teamId)
|
||||
{
|
||||
// search for zone associated closest graveyard
|
||||
uint32 zoneId = sMapMgr->GetZoneId(MapId, x, y, z);
|
||||
|
||||
if (!zoneId)
|
||||
{
|
||||
if (z > -500)
|
||||
{
|
||||
sLog->outError("ZoneId not found for map %u coords (%f, %f, %f)", MapId, x, y, z);
|
||||
return GetDefaultGraveyard(teamId);
|
||||
}
|
||||
}
|
||||
|
||||
// Simulate std. algorithm:
|
||||
// found some graveyard associated to (ghost_zone, ghost_map)
|
||||
//
|
||||
// if mapId == graveyard.mapId (ghost in plain zone or city or battleground) and search graveyard at same map
|
||||
// then check faction
|
||||
// if mapId != graveyard.mapId (ghost in instance) and search any graveyard associated
|
||||
// then check faction
|
||||
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 (range.first == range.second && !map->IsBattlegroundOrArena())
|
||||
{
|
||||
sLog->outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, teamId);
|
||||
return GetDefaultGraveyard(teamId);
|
||||
}
|
||||
|
||||
// at corpse map
|
||||
bool foundNear = false;
|
||||
float distNear = 10000;
|
||||
GraveyardStruct const* entryNear = NULL;
|
||||
|
||||
// at entrance map for corpse map
|
||||
bool foundEntr = false;
|
||||
float distEntr = 10000;
|
||||
GraveyardStruct const* entryEntr = NULL;
|
||||
|
||||
// some where other
|
||||
GraveyardStruct const* entryFar = NULL;
|
||||
|
||||
MapEntry const* mapEntry = sMapStore.LookupEntry(MapId);
|
||||
|
||||
for (; range.first != range.second; ++range.first)
|
||||
{
|
||||
GraveyardData const& data = range.first->second;
|
||||
GraveyardStruct const* entry = sGraveyard->GetGraveyard(data.safeLocId);
|
||||
if (!entry)
|
||||
{
|
||||
sLog->outErrorDb("Table `game_graveyard_zone` has record for not existing `game_graveyard` table %u, skipped.", data.safeLocId);
|
||||
continue;
|
||||
}
|
||||
|
||||
// skip enemy faction graveyard
|
||||
// team == 0 case can be at call from .neargrave
|
||||
if (data.teamId != TEAM_NEUTRAL && teamId != TEAM_NEUTRAL && data.teamId != teamId)
|
||||
continue;
|
||||
|
||||
// find now nearest graveyard at other map
|
||||
if (MapId != entry->Map)
|
||||
{
|
||||
// if find graveyard at different map from where entrance placed (or no entrance data), use any first
|
||||
if (!mapEntry
|
||||
|| mapEntry->entrance_map < 0
|
||||
|| uint32(mapEntry->entrance_map) != entry->Map
|
||||
|| (mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0))
|
||||
{
|
||||
// not have any corrdinates for check distance anyway
|
||||
entryFar = entry;
|
||||
continue;
|
||||
}
|
||||
|
||||
// at entrance map calculate distance (2D);
|
||||
float dist2 = (entry->x - mapEntry->entrance_x)*(entry->x - mapEntry->entrance_x)
|
||||
+ (entry->y - mapEntry->entrance_y)*(entry->y - mapEntry->entrance_y);
|
||||
if (foundEntr)
|
||||
{
|
||||
if (dist2 < distEntr)
|
||||
{
|
||||
distEntr = dist2;
|
||||
entryEntr = entry;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foundEntr = true;
|
||||
distEntr = dist2;
|
||||
entryEntr = entry;
|
||||
}
|
||||
}
|
||||
// find now nearest graveyard at same map
|
||||
else
|
||||
{
|
||||
float dist2 = (entry->x - x)*(entry->x - x) + (entry->y - y)*(entry->y - y) + (entry->z - z)*(entry->z - z);
|
||||
if (foundNear)
|
||||
{
|
||||
if (dist2 < distNear)
|
||||
{
|
||||
distNear = dist2;
|
||||
entryNear = entry;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foundNear = true;
|
||||
distNear = dist2;
|
||||
entryNear = entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (entryNear)
|
||||
return entryNear;
|
||||
|
||||
if (entryEntr)
|
||||
return entryEntr;
|
||||
|
||||
return entryFar;
|
||||
}
|
||||
|
||||
GraveyardData const* Graveyard::FindGraveyardData(uint32 id, uint32 zoneId)
|
||||
{
|
||||
GraveyardMapBounds range = GraveyardStore.equal_range(zoneId);
|
||||
for (; range.first != range.second; ++range.first)
|
||||
{
|
||||
GraveyardData const& data = range.first->second;
|
||||
if (data.safeLocId == id)
|
||||
return &data;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool Graveyard::AddGraveyardLink(uint32 id, uint32 zoneId, TeamId teamId, bool persist /*= true*/)
|
||||
{
|
||||
if (FindGraveyardData(id, zoneId))
|
||||
return false;
|
||||
|
||||
// add link to loaded data
|
||||
GraveyardData data;
|
||||
data.safeLocId = id;
|
||||
data.teamId = teamId;
|
||||
|
||||
GraveyardStore.insert(WGGraveyardContainer::value_type(zoneId, data));
|
||||
|
||||
// add link to DB
|
||||
if (persist)
|
||||
{
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_GRAVEYARD_ZONE);
|
||||
|
||||
stmt->setUInt32(0, id);
|
||||
stmt->setUInt32(1, zoneId);
|
||||
// Xinef: DB Data compatibility...
|
||||
stmt->setUInt16(2, uint16(teamId == TEAM_NEUTRAL ? 0 : (teamId == TEAM_ALLIANCE ? ALLIANCE : HORDE)));
|
||||
|
||||
WorldDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Graveyard::RemoveGraveyardLink(uint32 id, uint32 zoneId, TeamId teamId, bool persist /*= false*/)
|
||||
{
|
||||
GraveyardMapBoundsNonConst range = GraveyardStore.equal_range(zoneId);
|
||||
if (range.first == range.second)
|
||||
{
|
||||
sLog->outError("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, teamId);
|
||||
return;
|
||||
}
|
||||
|
||||
bool found = false;
|
||||
|
||||
for (; range.first != range.second; ++range.first)
|
||||
{
|
||||
GraveyardData & data = range.first->second;
|
||||
|
||||
// skip not matching safezone id
|
||||
if (data.safeLocId != id)
|
||||
continue;
|
||||
|
||||
// skip enemy faction graveyard at same map (normal area, city, or battleground)
|
||||
// team == 0 case can be at call from .neargrave
|
||||
if (data.teamId != TEAM_NEUTRAL && teamId != TEAM_NEUTRAL && data.teamId != teamId)
|
||||
continue;
|
||||
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// no match, return
|
||||
if (!found)
|
||||
return;
|
||||
|
||||
// remove from links
|
||||
GraveyardStore.erase(range.first);
|
||||
|
||||
// remove link from DB
|
||||
if (persist)
|
||||
{
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GRAVEYARD_ZONE);
|
||||
|
||||
stmt->setUInt32(0, id);
|
||||
stmt->setUInt32(1, zoneId);
|
||||
// Xinef: DB Data compatibility...
|
||||
stmt->setUInt16(2, uint16(teamId == TEAM_NEUTRAL ? 0 : (teamId == TEAM_ALLIANCE ? ALLIANCE : HORDE)));
|
||||
|
||||
WorldDatabase.Execute(stmt);
|
||||
}
|
||||
}
|
||||
|
||||
void Graveyard::LoadGraveyardZones()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
GraveyardStore.clear(); // need for reload case
|
||||
|
||||
// 0 1 2
|
||||
QueryResult result = WorldDatabase.Query("SELECT id, ghost_zone, faction FROM game_graveyard_zone");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
sLog->outString(">> Loaded 0 graveyard-zone links. DB table `game_graveyard_zone` is empty.");
|
||||
sLog->outString();
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
do
|
||||
{
|
||||
++count;
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 safeLocId = fields[0].GetUInt32();
|
||||
uint32 zoneId = fields[1].GetUInt32();
|
||||
uint32 team = fields[2].GetUInt16();
|
||||
TeamId teamId = team == 0 ? TEAM_NEUTRAL : (team == ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE);
|
||||
|
||||
GraveyardStruct const* entry = sGraveyard->GetGraveyard(safeLocId);
|
||||
if (!entry)
|
||||
{
|
||||
sLog->outErrorDb("Table `game_graveyard_zone` has a record for not existing `game_graveyard` table %u, skipped.", safeLocId);
|
||||
continue;
|
||||
}
|
||||
|
||||
AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(zoneId);
|
||||
if (!areaEntry)
|
||||
{
|
||||
sLog->outErrorDb("Table `game_graveyard_zone` has a record for not existing zone id (%u), skipped.", zoneId);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (areaEntry->zone != 0)
|
||||
{
|
||||
sLog->outErrorDb("Table `game_graveyard_zone` has a record for subzone id (%u) instead of zone, skipped.", zoneId);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (team != 0 && team != HORDE && team != ALLIANCE)
|
||||
{
|
||||
sLog->outErrorDb("Table `game_graveyard_zone` has a record for non player faction (%u), skipped.", team);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!AddGraveyardLink(safeLocId, zoneId, teamId, false))
|
||||
sLog->outErrorDb("Table `game_graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.", safeLocId, zoneId);
|
||||
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded %u graveyard-zone links in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
GraveyardStruct const* Graveyard::GetGraveyard(const std::string& name) const
|
||||
{
|
||||
// explicit name case
|
||||
std::wstring wname;
|
||||
if (!Utf8toWStr(name, wname))
|
||||
return NULL;
|
||||
|
||||
// converting string that we try to find to lower case
|
||||
wstrToLower(wname);
|
||||
|
||||
// Alternative first GameTele what contains wnameLow as substring in case no GameTele location found
|
||||
const GraveyardStruct* alt = NULL;
|
||||
for (GraveyardContainer::const_iterator itr = _graveyardStore.begin(); itr != _graveyardStore.end(); ++itr)
|
||||
{
|
||||
if (itr->second.wnameLow == wname)
|
||||
return &itr->second;
|
||||
else if (alt == NULL && itr->second.wnameLow.find(wname) != std::wstring::npos)
|
||||
alt = &itr->second;
|
||||
}
|
||||
|
||||
return alt;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
#ifndef _GAMEGRAVEYARD_H_
|
||||
#define _GAMEGRAVEYARD_H_
|
||||
|
||||
#include "Common.h"
|
||||
#include "SharedDefines.h"
|
||||
#include <ace/Singleton.h>
|
||||
|
||||
struct GraveyardStruct
|
||||
{
|
||||
uint32 ID;
|
||||
uint32 Map;
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
std::string name;
|
||||
std::wstring wnameLow;
|
||||
};
|
||||
|
||||
struct GraveyardData
|
||||
{
|
||||
uint32 safeLocId;
|
||||
TeamId teamId;
|
||||
};
|
||||
|
||||
typedef std::multimap<uint32, GraveyardData> WGGraveyardContainer;
|
||||
typedef std::pair<WGGraveyardContainer::const_iterator, WGGraveyardContainer::const_iterator> GraveyardMapBounds;
|
||||
typedef std::pair<WGGraveyardContainer::iterator, WGGraveyardContainer::iterator> GraveyardMapBoundsNonConst;
|
||||
|
||||
class Graveyard
|
||||
{
|
||||
friend class ACE_Singleton<Graveyard, ACE_Null_Mutex>;
|
||||
|
||||
public:
|
||||
|
||||
typedef UNORDERED_MAP<uint32, GraveyardStruct> GraveyardContainer;
|
||||
|
||||
GraveyardStruct const* GetGraveyard(uint32 ID) const;
|
||||
GraveyardStruct const* GetGraveyard(const std::string& name) const;
|
||||
GraveyardStruct const* GetDefaultGraveyard(TeamId teamId);
|
||||
GraveyardStruct const* GetClosestGraveyard(float x, float y, float z, uint32 MapId, TeamId teamId);
|
||||
GraveyardData const* FindGraveyardData(uint32 id, uint32 zone);
|
||||
GraveyardContainer const& GetGraveyardData() const { return _graveyardStore; }
|
||||
bool AddGraveyardLink(uint32 id, uint32 zoneId, TeamId teamId, bool persist = true);
|
||||
void RemoveGraveyardLink(uint32 id, uint32 zoneId, TeamId teamId, bool persist = false);
|
||||
void LoadGraveyardZones();
|
||||
void LoadGraveyardFromDB();
|
||||
|
||||
private:
|
||||
|
||||
GraveyardContainer _graveyardStore;
|
||||
|
||||
// for wintergrasp only
|
||||
WGGraveyardContainer GraveyardStore;
|
||||
};
|
||||
|
||||
#define sGraveyard ACE_Singleton<Graveyard, ACE_Null_Mutex>::instance()
|
||||
|
||||
#endif // _GAMEGRAVEYARD_H_
|
||||
@@ -98,8 +98,22 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T* owner, bool ini
|
||||
if ((!initial || (owner->movespline->Finalized() && this->GetMovementGeneratorType() == CHASE_MOTION_TYPE)) && i_target->IsWithinDistInMap(owner, dist) && i_target->IsWithinLOS(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ()))
|
||||
return;
|
||||
|
||||
// Xinef: Fix follow angle for hostile units
|
||||
float angle = i_angle;
|
||||
|
||||
if (i_target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Creature* creature = owner->ToCreature();
|
||||
|
||||
if (creature && creature->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET)
|
||||
{
|
||||
// fix distance and angle for vanity pets
|
||||
dist = 0.3f;
|
||||
angle = PET_FOLLOW_ANGLE + M_PI * 0.2f;
|
||||
size = i_target->GetCombatReach() - i_target->GetObjectSize();
|
||||
}
|
||||
}
|
||||
|
||||
// Xinef: Fix follow angle for hostile units
|
||||
if (angle == 0.0f && owner->GetVictim() && owner->GetVictim()->GetGUID() == i_target->GetGUID())
|
||||
angle = MapManager::NormalizeOrientation(i_target->GetAngle(owner)-i_target->GetOrientation());
|
||||
// to at i_offset distance from target and i_angle from target facing
|
||||
@@ -298,6 +312,18 @@ bool TargetedMovementGeneratorMedium<T,D>::DoUpdate(T* owner, uint32 time_diff)
|
||||
if (i_recalculateTravel)
|
||||
_setTargetLocation(owner, false);
|
||||
}
|
||||
|
||||
Unit* pOwner = owner->GetCharmerOrOwner();
|
||||
|
||||
if (pOwner && pOwner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
// Update pet speed for players in order to avoid stuttering
|
||||
if (pOwner->IsFlying())
|
||||
owner->UpdateSpeed(MOVE_FLIGHT, true);
|
||||
else
|
||||
owner->UpdateSpeed(MOVE_RUN, true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +165,8 @@ void Quest::LoadQuestTemplateAddon(Field* fields)
|
||||
RequiredMinRepValue = fields[13].GetInt32();
|
||||
RequiredMaxRepValue = fields[14].GetInt32();
|
||||
StartItemCount = fields[15].GetUInt8();
|
||||
SpecialFlags = fields[16].GetUInt8();
|
||||
RewardMailSenderEntry = fields[16].GetUInt32();
|
||||
SpecialFlags = fields[17].GetUInt8();
|
||||
|
||||
if (SpecialFlags & QUEST_SPECIAL_FLAGS_AUTO_ACCEPT)
|
||||
Flags |= QUEST_FLAGS_AUTO_ACCEPT;
|
||||
|
||||
@@ -176,6 +176,16 @@ struct QuestLocale
|
||||
std::vector< StringVector > ObjectiveText;
|
||||
};
|
||||
|
||||
struct QuestRequestItemsLocale
|
||||
{
|
||||
std::vector<std::string> CompletionText;
|
||||
};
|
||||
|
||||
struct QuestOfferRewardLocale
|
||||
{
|
||||
std::vector<std::string> RewardText;
|
||||
};
|
||||
|
||||
// This Quest class provides a convenient way to access a few pretotaled (cached) quest details,
|
||||
// all base quest information, and any utility functions such as generating the amount of
|
||||
// xp to give
|
||||
@@ -246,6 +256,7 @@ class Quest
|
||||
int32 GetRewSpellCast() const { return RewardSpell; }
|
||||
uint32 GetRewMailTemplateId() const { return RewardMailTemplateId; }
|
||||
uint32 GetRewMailDelaySecs() const { return RewardMailDelay; }
|
||||
uint32 GetRewMailSenderEntry() const { return RewardMailSenderEntry; }
|
||||
uint32 GetPOIContinent() const { return POIContinent; }
|
||||
float GetPOIx() const { return POIx; }
|
||||
float GetPOIy() const { return POIy; }
|
||||
@@ -371,6 +382,7 @@ class Quest
|
||||
uint32 RequiredMaxRepFaction = 0;
|
||||
int32 RequiredMaxRepValue = 0;
|
||||
uint32 StartItemCount = 0;
|
||||
uint32 RewardMailSenderEntry = 0;
|
||||
uint32 SpecialFlags = 0; // custom flags, not sniffed/WDB
|
||||
};
|
||||
|
||||
|
||||
@@ -371,7 +371,8 @@ void Map::ScriptsProcess()
|
||||
if (Player* player = _GetScriptPlayerSourceOrTarget(source, target, step.script))
|
||||
{
|
||||
LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex();
|
||||
std::string text(sObjectMgr->GetTrinityString(step.script->Talk.TextID, loc_idx));
|
||||
BroadcastText const* broadcastText = sObjectMgr->GetBroadcastText(step.script->Talk.TextID);
|
||||
std::string text = broadcastText->GetText(loc_idx, player->getGender());
|
||||
|
||||
switch (step.script->Talk.ChatType)
|
||||
{
|
||||
|
||||
@@ -125,7 +125,7 @@ WorldSession::WorldSession(uint32 id, WorldSocket* sock, AccountTypes sec, uint8
|
||||
{
|
||||
m_Address = sock->GetRemoteAddress();
|
||||
sock->AddReference();
|
||||
ResetTimeOutTime();
|
||||
ResetTimeOutTime(false);
|
||||
LoginDatabase.PExecute("UPDATE account SET online = online | (1<<(%u-1)) WHERE id = %u;", realmID, GetAccountId());
|
||||
}
|
||||
|
||||
@@ -251,6 +251,9 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
|
||||
if (updater.ProcessLogout())
|
||||
{
|
||||
UpdateTimeOutTime(diff);
|
||||
|
||||
/// If necessary, kick the player because the client didn't send anything for too long
|
||||
/// (or they've been idling in character select)
|
||||
if (IsConnectionIdle())
|
||||
m_Socket->CloseSocket();
|
||||
}
|
||||
@@ -652,7 +655,7 @@ void WorldSession::SendNotification(uint32 string_id, ...)
|
||||
}
|
||||
}
|
||||
|
||||
const char *WorldSession::GetTrinityString(int32 entry) const
|
||||
char const* WorldSession::GetTrinityString(uint32 entry) const
|
||||
{
|
||||
return sObjectMgr->GetTrinityString(entry, GetSessionDbLocaleIndex());
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ class WorldSession
|
||||
// Locales
|
||||
LocaleConstant GetSessionDbcLocale() const { return m_sessionDbcLocale; }
|
||||
LocaleConstant GetSessionDbLocaleIndex() const { return m_sessionDbLocaleIndex; }
|
||||
const char *GetTrinityString(int32 entry) const;
|
||||
char const* GetTrinityString(uint32 entry) const;
|
||||
|
||||
uint32 GetLatency() const { return m_latency; }
|
||||
void SetLatency(uint32 latency) { m_latency = latency; }
|
||||
@@ -355,9 +355,12 @@ class WorldSession
|
||||
else
|
||||
m_timeOutTime -= diff;
|
||||
}
|
||||
void ResetTimeOutTime()
|
||||
void ResetTimeOutTime(bool onlyActive)
|
||||
{
|
||||
m_timeOutTime = sWorld->getIntConfig(CONFIG_SOCKET_TIMEOUTTIME);
|
||||
if (GetPlayer())
|
||||
m_timeOutTime = int32(sWorld->getIntConfig(CONFIG_SOCKET_TIMEOUTTIME_ACTIVE));
|
||||
else if (!onlyActive)
|
||||
m_timeOutTime = int32(sWorld->getIntConfig(CONFIG_SOCKET_TIMEOUTTIME));
|
||||
}
|
||||
bool IsConnectionIdle() const
|
||||
{
|
||||
|
||||
@@ -681,8 +681,10 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct)
|
||||
return -1;
|
||||
}
|
||||
return HandleAuthSession (*new_pct);
|
||||
case CMSG_KEEP_ALIVE:
|
||||
return 0;
|
||||
case CMSG_KEEP_ALIVE:
|
||||
if (m_Session)
|
||||
m_Session->ResetTimeOutTime(true);
|
||||
break;
|
||||
default:
|
||||
{
|
||||
ACE_GUARD_RETURN (LockType, Guard, m_SessionLock, -1);
|
||||
@@ -691,7 +693,7 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct)
|
||||
{
|
||||
// Our Idle timer will reset on any non PING opcodes.
|
||||
// Catches people idling on the login screen and any lingering ingame connections.
|
||||
m_Session->ResetTimeOutTime();
|
||||
m_Session->ResetTimeOutTime(false);
|
||||
|
||||
// OK, give the packet to WorldSession
|
||||
aptr.release();
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "BattlefieldMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Player.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
bool IsPrimaryProfessionSkill(uint32 skill)
|
||||
{
|
||||
@@ -5716,6 +5717,7 @@ void SpellMgr::LoadDbcDataCorrections()
|
||||
case 69030: // Val'kyr Target Search
|
||||
spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd
|
||||
spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; // 200yd
|
||||
spellInfo->Attributes |= SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY;
|
||||
break;
|
||||
case 73654: // Harvest Souls
|
||||
case 74295: // Harvest Souls
|
||||
@@ -6335,10 +6337,10 @@ void SpellMgr::LoadDbcDataCorrections()
|
||||
|
||||
|
||||
// Ring of Valor starting Locations
|
||||
WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(1364);
|
||||
const_cast<WorldSafeLocsEntry*>(entry)->z += 6.0f;
|
||||
entry = sWorldSafeLocsStore.LookupEntry(1365);
|
||||
const_cast<WorldSafeLocsEntry*>(entry)->z += 6.0f;
|
||||
GraveyardStruct const* entry = sGraveyard->GetGraveyard(1364);
|
||||
const_cast<GraveyardStruct*>(entry)->z += 6.0f;
|
||||
entry = sGraveyard->GetGraveyard(1365);
|
||||
const_cast<GraveyardStruct*>(entry)->z += 6.0f;
|
||||
|
||||
LockEntry* key = const_cast<LockEntry*>(sLockStore.LookupEntry(36)); // 3366 Opening, allows to open without proper key
|
||||
key->Type[2] = LOCK_KEY_NONE;
|
||||
|
||||
@@ -155,27 +155,31 @@ void CreatureTextMgr::LoadCreatureTextLocales()
|
||||
|
||||
mLocaleTextMap.clear(); // for reload case
|
||||
|
||||
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");
|
||||
QueryResult result = WorldDatabase.Query("SELECT CreatureId, GroupId, ID, Locale, Text FROM creature_text_locale");
|
||||
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
uint32 textCount = 0;
|
||||
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
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);
|
||||
ObjectMgr::AddLocaleString(fields[3 + i - 1].GetString(), locale, loc.Text);
|
||||
}
|
||||
|
||||
++textCount;
|
||||
uint32 CreatureId = fields[0].GetUInt32();
|
||||
uint32 GroupId = fields[1].GetUInt8();
|
||||
uint32 ID = fields[2].GetUInt8();
|
||||
std::string LocaleName = fields[3].GetString();
|
||||
std::string Text = fields[4].GetString();
|
||||
|
||||
CreatureTextLocale& data = mLocaleTextMap[CreatureTextId(CreatureId, GroupId, ID)];
|
||||
LocaleConstant locale = GetLocaleByName(LocaleName);
|
||||
if (locale == LOCALE_enUS)
|
||||
continue;
|
||||
|
||||
ObjectMgr::AddLocaleString(Text, locale, data.Text);
|
||||
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded %u creature localized texts in %u ms", textCount, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString(">> Loaded %u Creature Text Locale in %u ms", uint32(mLocaleTextMap.size()), GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
@@ -468,17 +472,21 @@ std::string CreatureTextMgr::GetLocalizedChatString(uint32 entry, uint8 gender,
|
||||
|
||||
if (locale > MAX_LOCALES)
|
||||
locale = DEFAULT_LOCALE;
|
||||
|
||||
std::string baseText = "";
|
||||
|
||||
BroadcastText const* bct = sObjectMgr->GetBroadcastText(groupItr->BroadcastTextId);
|
||||
if (bct)
|
||||
baseText = bct->GetText(locale, gender);
|
||||
else
|
||||
baseText = groupItr->text;
|
||||
|
||||
if (locale != DEFAULT_LOCALE && !bct)
|
||||
{
|
||||
LocaleCreatureTextMap::const_iterator locItr = mLocaleTextMap.find(CreatureTextId(entry, uint32(textGroup), id));
|
||||
if (locItr != mLocaleTextMap.end())
|
||||
ObjectMgr::GetLocaleString(locItr->second.Text, locale, baseText);
|
||||
}
|
||||
|
||||
return baseText;
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
#include "WhoListCache.h"
|
||||
#include "AsyncAuctionListing.h"
|
||||
#include "SavingSystem.h"
|
||||
#include "GameGraveyard.h"
|
||||
#include <VMapManager2.h>
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
@@ -375,7 +376,7 @@ bool World::RemoveQueuedPlayer(WorldSession* sess)
|
||||
if (*iter == sess)
|
||||
{
|
||||
sess->SetInQueue(false);
|
||||
sess->ResetTimeOutTime();
|
||||
sess->ResetTimeOutTime(false);
|
||||
iter = m_QueuedPlayer.erase(iter);
|
||||
found = true;
|
||||
break;
|
||||
@@ -394,7 +395,7 @@ bool World::RemoveQueuedPlayer(WorldSession* sess)
|
||||
{
|
||||
WorldSession* pop_sess = m_QueuedPlayer.front();
|
||||
pop_sess->SetInQueue(false);
|
||||
pop_sess->ResetTimeOutTime();
|
||||
pop_sess->ResetTimeOutTime(false);
|
||||
pop_sess->SendAuthWaitQue(0);
|
||||
pop_sess->SendAddonsInfo();
|
||||
|
||||
@@ -690,6 +691,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
m_int_configs[CONFIG_PORT_WORLD] = sConfigMgr->GetIntDefault("WorldServerPort", 8085);
|
||||
|
||||
m_int_configs[CONFIG_SOCKET_TIMEOUTTIME] = sConfigMgr->GetIntDefault("SocketTimeOutTime", 900000);
|
||||
m_int_configs[CONFIG_SOCKET_TIMEOUTTIME_ACTIVE] = sConfigMgr->GetIntDefault("SocketTimeOutTimeActive", 60000);
|
||||
m_int_configs[CONFIG_SESSION_ADD_DELAY] = sConfigMgr->GetIntDefault("SessionAddDelay", 10000);
|
||||
|
||||
m_float_configs[CONFIG_GROUP_XP_DISTANCE] = sConfigMgr->GetFloatDefault("MaxGroupXPDistance", 74.0f);
|
||||
@@ -1412,6 +1414,9 @@ void World::SetInitialWorldSettings()
|
||||
LoadDBCStores(m_dataPath);
|
||||
DetectDBCLang();
|
||||
|
||||
sLog->outString("Loading Game Graveyard...");
|
||||
sGraveyard->LoadGraveyardFromDB();
|
||||
|
||||
sLog->outString("Loading spell dbc data corrections...");
|
||||
sSpellMgr->LoadDbcDataCorrections();
|
||||
|
||||
@@ -1458,6 +1463,8 @@ void World::SetInitialWorldSettings()
|
||||
sObjectMgr->LoadItemLocales();
|
||||
sObjectMgr->LoadItemSetNameLocales();
|
||||
sObjectMgr->LoadQuestLocales();
|
||||
sObjectMgr->LoadQuestOfferRewardLocale();
|
||||
sObjectMgr->LoadQuestRequestItemsLocale();
|
||||
sObjectMgr->LoadNpcTextLocales();
|
||||
sObjectMgr->LoadPageTextLocales();
|
||||
sObjectMgr->LoadGossipMenuItemsLocales();
|
||||
@@ -1640,7 +1647,7 @@ void World::SetInitialWorldSettings()
|
||||
sLFGMgr->LoadRewards();
|
||||
|
||||
sLog->outString("Loading Graveyard-zone links...");
|
||||
sObjectMgr->LoadGraveyardZones();
|
||||
sGraveyard->LoadGraveyardZones();
|
||||
|
||||
sLog->outString("Loading spell pet auras...");
|
||||
sSpellMgr->LoadSpellPetAuras();
|
||||
@@ -1800,10 +1807,7 @@ void World::SetInitialWorldSettings()
|
||||
sObjectMgr->LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
sObjectMgr->LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
sObjectMgr->LoadWaypointScripts();
|
||||
|
||||
sLog->outString("Loading Scripts text locales..."); // must be after Load*Scripts calls
|
||||
sObjectMgr->LoadDbScriptStrings();
|
||||
|
||||
|
||||
sLog->outString("Loading spell script names...");
|
||||
sObjectMgr->LoadSpellScriptNames();
|
||||
|
||||
@@ -2277,7 +2281,7 @@ namespace Trinity
|
||||
{
|
||||
public:
|
||||
typedef std::vector<WorldPacket*> WorldPacketList;
|
||||
explicit WorldWorldTextBuilder(int32 textId, va_list* args = NULL) : i_textId(textId), i_args(args) {}
|
||||
explicit WorldWorldTextBuilder(uint32 textId, va_list* args = NULL) : i_textId(textId), i_args(args) {}
|
||||
void operator()(WorldPacketList& data_list, LocaleConstant loc_idx)
|
||||
{
|
||||
char const* text = sObjectMgr->GetTrinityString(i_textId, loc_idx);
|
||||
@@ -2311,13 +2315,13 @@ namespace Trinity
|
||||
}
|
||||
|
||||
|
||||
int32 i_textId;
|
||||
uint32 i_textId;
|
||||
va_list* i_args;
|
||||
};
|
||||
} // namespace Trinity
|
||||
|
||||
/// Send a System Message to all players (except self if mentioned)
|
||||
void World::SendWorldText(int32 string_id, ...)
|
||||
void World::SendWorldText(uint32 string_id, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, string_id);
|
||||
@@ -2336,7 +2340,7 @@ void World::SendWorldText(int32 string_id, ...)
|
||||
}
|
||||
|
||||
/// Send a System Message to all GMs (except self if mentioned)
|
||||
void World::SendGMText(int32 string_id, ...)
|
||||
void World::SendGMText(uint32 string_id, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, string_id);
|
||||
|
||||
@@ -330,6 +330,7 @@ enum WorldIntConfigs
|
||||
CONFIG_WARDEN_NUM_MEM_CHECKS,
|
||||
CONFIG_WARDEN_NUM_OTHER_CHECKS,
|
||||
CONFIG_BIRTHDAY_TIME,
|
||||
CONFIG_SOCKET_TIMEOUTTIME_ACTIVE,
|
||||
INT_CONFIG_VALUE_COUNT
|
||||
};
|
||||
|
||||
@@ -650,9 +651,9 @@ class World
|
||||
void LoadConfigSettings(bool reload = false);
|
||||
void LoadModuleConfigSettings();
|
||||
|
||||
void SendWorldText(int32 string_id, ...);
|
||||
void SendWorldText(uint32 string_id, ...);
|
||||
void SendGlobalText(const char* text, WorldSession* self);
|
||||
void SendGMText(int32 string_id, ...);
|
||||
void SendGMText(uint32 string_id, ...);
|
||||
void SendGlobalMessage(WorldPacket* packet, WorldSession* self = 0, TeamId teamId = TEAM_NEUTRAL);
|
||||
void SendGlobalGMMessage(WorldPacket* packet, WorldSession* self = 0, TeamId teamId = TEAM_NEUTRAL);
|
||||
bool SendZoneMessage(uint32 zone, WorldPacket* packet, WorldSession* self = 0, TeamId teamId = TEAM_NEUTRAL);
|
||||
|
||||
@@ -180,6 +180,9 @@ include_directories(
|
||||
${MYSQL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
# Group sources
|
||||
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_library(scripts STATIC
|
||||
${scripts_STAT_SRCS}
|
||||
${scripts_STAT_PCH_SRC}
|
||||
|
||||
@@ -18,6 +18,7 @@ EndScriptData */
|
||||
#include "Chat.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
class go_commandscript : public CommandScript
|
||||
{
|
||||
@@ -171,7 +172,7 @@ public:
|
||||
if (!graveyardId)
|
||||
return false;
|
||||
|
||||
WorldSafeLocsEntry const* gy = sWorldSafeLocsStore.LookupEntry(graveyardId);
|
||||
GraveyardStruct const* gy = sGraveyard->GetGraveyard(graveyardId);
|
||||
if (!gy)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDNOEXIST, graveyardId);
|
||||
@@ -179,9 +180,9 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!MapManager::IsValidMapCoord(gy->map_id, gy->x, gy->y, gy->z))
|
||||
if (!MapManager::IsValidMapCoord(gy->Map, gy->x, gy->y, gy->z))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, gy->x, gy->y, gy->map_id);
|
||||
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, gy->x, gy->y, gy->Map);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -196,7 +197,7 @@ public:
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
|
||||
player->TeleportTo(gy->map_id, gy->x, gy->y, gy->z, player->GetOrientation());
|
||||
player->TeleportTo(gy->Map, gy->x, gy->y, gy->z, player->GetOrientation());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "GroupMgr.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "MapManager.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
class misc_commandscript : public CommandScript
|
||||
{
|
||||
@@ -1268,7 +1269,7 @@ public:
|
||||
else
|
||||
return false;
|
||||
|
||||
WorldSafeLocsEntry const* graveyard = sWorldSafeLocsStore.LookupEntry(graveyardId);
|
||||
GraveyardStruct const* graveyard = sGraveyard->GetGraveyard(graveyardId);
|
||||
|
||||
if (!graveyard)
|
||||
{
|
||||
@@ -1289,7 +1290,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sObjectMgr->AddGraveyardLink(graveyardId, zoneId, teamId))
|
||||
if (sGraveyard->AddGraveyardLink(graveyardId, zoneId, teamId))
|
||||
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, graveyardId, zoneId);
|
||||
else
|
||||
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, graveyardId, zoneId);
|
||||
@@ -1315,13 +1316,13 @@ public:
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
uint32 zone_id = player->GetZoneId();
|
||||
|
||||
WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveyard(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), teamId);
|
||||
GraveyardStruct const* graveyard = sGraveyard->GetClosestGraveyard(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), teamId);
|
||||
|
||||
if (graveyard)
|
||||
{
|
||||
uint32 graveyardId = graveyard->ID;
|
||||
|
||||
GraveyardData const* data = sObjectMgr->FindGraveyardData(graveyardId, zone_id);
|
||||
GraveyardData const* data = sGraveyard->FindGraveyardData(graveyardId, zone_id);
|
||||
if (!data)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR, graveyardId);
|
||||
|
||||
@@ -29,6 +29,7 @@ EndScriptData */
|
||||
#include "TicketMgr.h"
|
||||
#include "WardenCheckMgr.h"
|
||||
#include "WaypointManager.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
class reload_commandscript : public CommandScript
|
||||
{
|
||||
@@ -75,11 +76,11 @@ public:
|
||||
{ "creature_onkill_reputation", SEC_ADMINISTRATOR, true, &HandleReloadOnKillReputationCommand, "" },
|
||||
{ "creature_queststarter", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestStarterCommand, "" },
|
||||
{ "creature_template", SEC_ADMINISTRATOR, true, &HandleReloadCreatureTemplateCommand, "" },
|
||||
//{ "db_script_string", SEC_ADMINISTRATOR, true, &HandleReloadDbScriptStringCommand, "" },
|
||||
{ "disables", SEC_ADMINISTRATOR, true, &HandleReloadDisablesCommand, "" },
|
||||
{ "disenchant_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesDisenchantCommand, "" },
|
||||
{ "event_scripts", SEC_ADMINISTRATOR, true, &HandleReloadEventScriptsCommand, "" },
|
||||
{ "fishing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesFishingCommand, "" },
|
||||
{ "game_graveyard", SEC_ADMINISTRATOR, true, &HandleReloadGameGraveyardCommand, "" },
|
||||
{ "game_graveyard_zone", SEC_ADMINISTRATOR, true, &HandleReloadGameGraveyardZoneCommand, "" },
|
||||
{ "game_tele", SEC_ADMINISTRATOR, true, &HandleReloadGameTeleCommand, "" },
|
||||
{ "gameobject_questender", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestEnderCommand, "" },
|
||||
@@ -92,17 +93,19 @@ public:
|
||||
{ "item_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesItemCommand, "" },
|
||||
{ "item_set_names", SEC_ADMINISTRATOR, true, &HandleReloadItemSetNamesCommand, "" },
|
||||
{ "lfg_dungeon_rewards", SEC_ADMINISTRATOR, true, &HandleReloadLfgRewardsCommand, "" },
|
||||
{ "locales_achievement_reward", SEC_ADMINISTRATOR, true, &HandleReloadLocalesAchievementRewardCommand, "" },
|
||||
{ "locales_creature", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureCommand, "" },
|
||||
{ "locales_creature_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureTextCommand, "" },
|
||||
{ "locales_gameobject", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGameobjectCommand, "" },
|
||||
{ "locales_gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGossipMenuOptionCommand, "" },
|
||||
{ "locales_item", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemCommand, "" },
|
||||
{ "locales_item_set_name", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemSetNameCommand, "" },
|
||||
{ "locales_npc_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesNpcTextCommand, "" },
|
||||
{ "locales_page_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPageTextCommand, "" },
|
||||
{ "locales_points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPointsOfInterestCommand, "" },
|
||||
{ "locales_quest", SEC_ADMINISTRATOR, true, &HandleReloadLocalesQuestCommand, "" },
|
||||
{ "achievement_reward_locale", SEC_ADMINISTRATOR, true, &HandleReloadLocalesAchievementRewardCommand, "" },
|
||||
{ "creature_template_locale", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureCommand, "" },
|
||||
{ "creature_text_locale", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureTextCommand, "" },
|
||||
{ "gameobject_template_locale", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGameobjectCommand, "" },
|
||||
{ "gossip_menu_option_locale", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGossipMenuOptionCommand, "" },
|
||||
{ "item_template_locale", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemCommand, "" },
|
||||
{ "item_set_name_locale", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemSetNameCommand, "" },
|
||||
{ "npc_text_locale", SEC_ADMINISTRATOR, true, &HandleReloadLocalesNpcTextCommand, "" },
|
||||
{ "page_text_locale", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPageTextCommand, "" },
|
||||
{ "points_of_interest_locale", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPointsOfInterestCommand, "" },
|
||||
{ "quest_template_locale", SEC_ADMINISTRATOR, true, &HandleReloadLocalesQuestCommand, "" },
|
||||
{ "quest_offer_reward_locale", SEC_ADMINISTRATOR, true, &HandleReloadLocalesQuestOfferRewardCommand, "" },
|
||||
{ "quest_request_item_locale", SEC_ADMINISTRATOR, true, &HandleReloadLocalesQuestRequestItemsCommand, "" },
|
||||
{ "mail_level_reward", SEC_ADMINISTRATOR, true, &HandleReloadMailLevelRewardCommand, "" },
|
||||
{ "mail_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesMailCommand, "" },
|
||||
{ "milling_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesMillingCommand, "" },
|
||||
@@ -256,7 +259,6 @@ public:
|
||||
HandleReloadEventScriptsCommand(handler, "a");
|
||||
HandleReloadSpellScriptsCommand(handler, "a");
|
||||
handler->SendGlobalGMSysMessage("DB tables `*_scripts` reloaded.");
|
||||
HandleReloadDbScriptStringCommand(handler, "a");
|
||||
HandleReloadWpScriptsCommand(handler, "a");
|
||||
HandleReloadWpCommand(handler, "a");
|
||||
return true;
|
||||
@@ -308,6 +310,8 @@ public:
|
||||
HandleReloadLocalesPageTextCommand(handler, "a");
|
||||
HandleReloadLocalesPointsOfInterestCommand(handler, "a");
|
||||
HandleReloadLocalesQuestCommand(handler, "a");
|
||||
HandleReloadLocalesQuestOfferRewardCommand(handler, "a");
|
||||
HandleReloadLocalesQuestRequestItemsCommand(handler, "a");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1010,19 +1014,11 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadDbScriptStringCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
sLog->outString("Re-Loading Script strings from `db_script_string`...");
|
||||
sObjectMgr->LoadDbScriptStrings();
|
||||
handler->SendGlobalGMSysMessage("DB table `db_script_string` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadGameGraveyardZoneCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
sLog->outString("Re-Loading Graveyard-zone links...");
|
||||
|
||||
sObjectMgr->LoadGraveyardZones();
|
||||
sGraveyard->LoadGraveyardZones();
|
||||
|
||||
handler->SendGlobalGMSysMessage("DB table `game_graveyard_zone` reloaded.");
|
||||
|
||||
@@ -1052,9 +1048,11 @@ public:
|
||||
|
||||
static bool HandleReloadLocalesAchievementRewardCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
sLog->outString("Re-Loading Locales Achievement Reward Data...");
|
||||
sLog->outString("Re-Loading Achievement Reward Data Locale...");
|
||||
sAchievementMgr->LoadRewardLocales();
|
||||
handler->SendGlobalGMSysMessage("DB table `achievement_reward_locale` reloaded.");
|
||||
handler->SendGlobalGMSysMessage("DB table `locales_achievement_reward` reloaded.");
|
||||
handler->SendGlobalGMSysMessage("|cff6C8CD5#|cFFFF0000 Таблица|r `achievement_reward_locale` |cFFFF0000перезагружена.|r");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1068,73 +1066,73 @@ public:
|
||||
|
||||
static bool HandleReloadLocalesCreatureCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
sLog->outString("Re-Loading Locales Creature ...");
|
||||
sLog->outString("Re-Loading Creature Template Locale...");
|
||||
sObjectMgr->LoadCreatureLocales();
|
||||
handler->SendGlobalGMSysMessage("DB table `locales_creature` reloaded.");
|
||||
handler->SendGlobalGMSysMessage("DB table `creature_template_locale` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesCreatureTextCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
sLog->outString("Re-Loading Locales Creature Texts...");
|
||||
sLog->outString("Re-Loading Creature Texts Locale...");
|
||||
sCreatureTextMgr->LoadCreatureTextLocales();
|
||||
handler->SendGlobalGMSysMessage("DB table `locales_creature_text` reloaded.");
|
||||
handler->SendGlobalGMSysMessage("DB table `creature_text_locale` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesGameobjectCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
sLog->outString("Re-Loading Locales Gameobject ... ");
|
||||
sLog->outString("Re-Loading Gameobject Template Locale ... ");
|
||||
sObjectMgr->LoadGameObjectLocales();
|
||||
handler->SendGlobalGMSysMessage("DB table `locales_gameobject` reloaded.");
|
||||
handler->SendGlobalGMSysMessage("DB table `gameobject_template_locale` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesGossipMenuOptionCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
sLog->outString( "Re-Loading Locales Gossip Menu Option ... ");
|
||||
sLog->outString( "Re-Loading Gossip Menu Option Locale ... ");
|
||||
sObjectMgr->LoadGossipMenuItemsLocales();
|
||||
handler->SendGlobalGMSysMessage("DB table `locales_gossip_menu_option` reloaded.");
|
||||
handler->SendGlobalGMSysMessage("DB table `gossip_menu_option_locale` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesItemCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
sLog->outString("Re-Loading Locales Item ... ");
|
||||
sLog->outString("Re-Loading Item Template Locale ... ");
|
||||
sObjectMgr->LoadItemLocales();
|
||||
handler->SendGlobalGMSysMessage("DB table `locales_item` reloaded.");
|
||||
handler->SendGlobalGMSysMessage("DB table `item_template_locale` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesItemSetNameCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
sLog->outString("Re-Loading Locales Item set name... ");
|
||||
sLog->outString("Re-Loading Item set name Locale... ");
|
||||
sObjectMgr->LoadItemSetNameLocales();
|
||||
handler->SendGlobalGMSysMessage("DB table `locales_item_set_name` reloaded.");
|
||||
handler->SendGlobalGMSysMessage("DB table `item_set_name_locale` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesNpcTextCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
sLog->outString("Re-Loading Locales NPC Text ... ");
|
||||
sLog->outString("Re-Loading NPC Text Locale ... ");
|
||||
sObjectMgr->LoadNpcTextLocales();
|
||||
handler->SendGlobalGMSysMessage("DB table `locales_npc_text` reloaded.");
|
||||
handler->SendGlobalGMSysMessage("DB table `npc_text_locale` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesPageTextCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
sLog->outString("Re-Loading Locales Page Text ... ");
|
||||
sLog->outString("Re-Loading Page Text Locale ... ");
|
||||
sObjectMgr->LoadPageTextLocales();
|
||||
handler->SendGlobalGMSysMessage("DB table `locales_page_text` reloaded.");
|
||||
handler->SendGlobalGMSysMessage("DB table `page_text_locale` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesPointsOfInterestCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
sLog->outString("Re-Loading Locales Points Of Interest ... ");
|
||||
sLog->outString("Re-Loading Points Of Interest Locale ... ");
|
||||
sObjectMgr->LoadPointOfInterestLocales();
|
||||
handler->SendGlobalGMSysMessage("DB table `locales_points_of_interest` reloaded.");
|
||||
handler->SendGlobalGMSysMessage("DB table `points_of_interest_locale` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1142,7 +1140,23 @@ public:
|
||||
{
|
||||
sLog->outString("Re-Loading Locales Quest ... ");
|
||||
sObjectMgr->LoadQuestLocales();
|
||||
handler->SendGlobalGMSysMessage("DB table `locales_quest` reloaded.");
|
||||
handler->SendGlobalGMSysMessage("DB table `quest_template_locale` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesQuestOfferRewardCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
sLog->outString("Re-Loading Quest Offer Reward Locale... ");
|
||||
sObjectMgr->LoadQuestOfferRewardLocale();
|
||||
handler->SendGlobalGMSysMessage("DB table `quest_offer_reward_locale` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadLocalesQuestRequestItemsCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
sLog->outString("Re-Loading Quest Request Item Locale... ");
|
||||
sObjectMgr->LoadQuestRequestItemsLocale();
|
||||
handler->SendGlobalGMSysMessage("DB table `quest_request_item_locale` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1203,6 +1217,14 @@ public:
|
||||
handler->SendGlobalGMSysMessage("Vehicle template accessories reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadGameGraveyardCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
sLog->outString("Reloading game_graveyard table...");
|
||||
sGraveyard->LoadGraveyardFromDB();
|
||||
handler->SendGlobalGMSysMessage("DB table `game_graveyard` reloaded.");
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_reload_commandscript()
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "CombatAI.h"
|
||||
#include "Player.h"
|
||||
#include "PoolMgr.h"
|
||||
#include "GameGraveyard.h"
|
||||
#include "World.h"
|
||||
|
||||
#define GOSSIP_HELLO_DEMO1 "Build catapult."
|
||||
@@ -227,8 +228,8 @@ class npc_wg_spirit_guide : public CreatureScript
|
||||
GraveyardVect gy = wintergrasp->GetGraveyardVector();
|
||||
for (uint8 i = 0; i < gy.size(); i++)
|
||||
if (action - GOSSIP_ACTION_INFO_DEF == i && gy[i]->GetControlTeamId() == player->GetTeamId())
|
||||
if (WorldSafeLocsEntry const* safeLoc = sWorldSafeLocsStore.LookupEntry(gy[i]->GetGraveyardId()))
|
||||
player->TeleportTo(safeLoc->map_id, safeLoc->x, safeLoc->y, safeLoc->z, 0);
|
||||
if (GraveyardStruct const* safeLoc = sGraveyard->GetGraveyard(gy[i]->GetGraveyardId()))
|
||||
player->TeleportTo(safeLoc->Map, safeLoc->x, safeLoc->y, safeLoc->z, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "Language.h"
|
||||
#include "World.h"
|
||||
#include "GossipDef.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
OPvPCapturePointEP_EWT::OPvPCapturePointEP_EWT(OutdoorPvP* pvp)
|
||||
: OPvPCapturePoint(pvp), m_TowerState(EP_TS_N), m_UnitsSummonedSideId(TEAM_NEUTRAL)
|
||||
@@ -419,8 +420,8 @@ void OPvPCapturePointEP_CGT::LinkGraveyard(TeamId teamId)
|
||||
{
|
||||
if (m_GraveyardSide != teamId)
|
||||
{
|
||||
sObjectMgr->RemoveGraveyardLink(EP_GraveYardId, EP_GraveYardZone, m_GraveyardSide, false);
|
||||
sObjectMgr->AddGraveyardLink(EP_GraveYardId, EP_GraveYardZone, teamId, false);
|
||||
sGraveyard->RemoveGraveyardLink(EP_GraveYardId, EP_GraveYardZone, m_GraveyardSide, false);
|
||||
sGraveyard->AddGraveyardLink(EP_GraveYardId, EP_GraveYardZone, teamId, false);
|
||||
m_GraveyardSide = teamId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "Language.h"
|
||||
#include "World.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
OutdoorPvPNA::OutdoorPvPNA()
|
||||
{
|
||||
@@ -120,7 +121,7 @@ void OPvPCapturePointNA::DeSpawnGOs()
|
||||
void OPvPCapturePointNA::FactionTakeOver(TeamId teamId)
|
||||
{
|
||||
if (m_ControllingFaction != TEAM_NEUTRAL)
|
||||
sObjectMgr->RemoveGraveyardLink(NA_HALAA_GRAVEYARD, NA_HALAA_GRAVEYARD_ZONE, m_ControllingFaction, false);
|
||||
sGraveyard->RemoveGraveyardLink(NA_HALAA_GRAVEYARD, NA_HALAA_GRAVEYARD_ZONE, m_ControllingFaction, false);
|
||||
if (m_ControllingFaction == TEAM_ALLIANCE)
|
||||
sWorld->SendZoneText(NA_HALAA_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_LOSE_A));
|
||||
else if (m_ControllingFaction == TEAM_HORDE)
|
||||
@@ -128,7 +129,7 @@ void OPvPCapturePointNA::FactionTakeOver(TeamId teamId)
|
||||
|
||||
m_ControllingFaction = teamId;
|
||||
if (m_ControllingFaction != TEAM_NEUTRAL)
|
||||
sObjectMgr->AddGraveyardLink(NA_HALAA_GRAVEYARD, NA_HALAA_GRAVEYARD_ZONE, m_ControllingFaction, false);
|
||||
sGraveyard->AddGraveyardLink(NA_HALAA_GRAVEYARD, NA_HALAA_GRAVEYARD_ZONE, m_ControllingFaction, false);
|
||||
DeSpawnGOs();
|
||||
DeSpawnNPCs();
|
||||
SpawnGOsForTeam(teamId);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "GossipDef.h"
|
||||
#include "World.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
OPvPCapturePointZM_Beacon::OPvPCapturePointZM_Beacon(OutdoorPvP* pvp, ZM_BeaconType type)
|
||||
: OPvPCapturePoint(pvp), m_TowerType(type), m_TowerState(ZM_TOWERSTATE_N)
|
||||
@@ -214,8 +215,8 @@ int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* player, uint64 guid)
|
||||
m_GraveYardState = ZM_GRAVEYARD_A;
|
||||
DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant
|
||||
AddObject(0, ZM_Banner_A.entry, ZM_Banner_A.map, ZM_Banner_A.x, ZM_Banner_A.y, ZM_Banner_A.z, ZM_Banner_A.o, ZM_Banner_A.rot0, ZM_Banner_A.rot1, ZM_Banner_A.rot2, ZM_Banner_A.rot3);
|
||||
sObjectMgr->RemoveGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_HORDE); // rem gy
|
||||
sObjectMgr->AddGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_ALLIANCE, false); // add gy
|
||||
sGraveyard->RemoveGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_HORDE); // rem gy
|
||||
sGraveyard->AddGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_ALLIANCE, false); // add gy
|
||||
m_PvP->TeamApplyBuff(TEAM_ALLIANCE, ZM_CAPTURE_BUFF, 0, player);
|
||||
player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
|
||||
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_A));
|
||||
@@ -227,8 +228,8 @@ int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* player, uint64 guid)
|
||||
m_GraveYardState = ZM_GRAVEYARD_H;
|
||||
DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant
|
||||
AddObject(0, ZM_Banner_H.entry, ZM_Banner_H.map, ZM_Banner_H.x, ZM_Banner_H.y, ZM_Banner_H.z, ZM_Banner_H.o, ZM_Banner_H.rot0, ZM_Banner_H.rot1, ZM_Banner_H.rot2, ZM_Banner_H.rot3);
|
||||
sObjectMgr->RemoveGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_ALLIANCE); // rem gy
|
||||
sObjectMgr->AddGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_HORDE, false); // add gy
|
||||
sGraveyard->RemoveGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_ALLIANCE); // rem gy
|
||||
sGraveyard->AddGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_HORDE, false); // add gy
|
||||
m_PvP->TeamApplyBuff(TEAM_HORDE, ZM_CAPTURE_BUFF, 0, player);
|
||||
player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
|
||||
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_H));
|
||||
|
||||
@@ -153,6 +153,9 @@ add_executable(worldserver
|
||||
${worldserver_PCH_SRC}
|
||||
)
|
||||
|
||||
# Group sources
|
||||
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
if( NOT WIN32 )
|
||||
set_target_properties(worldserver PROPERTIES
|
||||
COMPILE_DEFINITIONS _TRINITY_CORE_CONFIG="${CONF_DIR}/worldserver.conf"
|
||||
|
||||
@@ -220,6 +220,15 @@ GridUnload = 1
|
||||
|
||||
SocketTimeOutTime = 900000
|
||||
|
||||
#
|
||||
# SocketTimeOutTimeActive
|
||||
# Description: Time (in milliseconds) after which an idle connection is dropped while
|
||||
# logged into the world.
|
||||
# The client sends keepalive packets every 30 seconds. Values <= 30s are not recommended.
|
||||
# Default: 60000 - (1 minute)
|
||||
|
||||
SocketTimeOutTimeActive = 60000
|
||||
|
||||
#
|
||||
# SessionAddDelay
|
||||
# Description: Time (in microseconds) that a network thread will sleep after authentication
|
||||
|
||||
Reference in New Issue
Block a user