mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 18:15:31 +01:00
Implement .arena commands - add new commands to the core to handle with arena teams.
*.arena create [player] "arena name" [type] *.arena create "arena name" [type] *.arena disband [TeamID] *.arena rename "oldName" "newName" *.arena captain [TeamID] [Player] *.arena info [TeamID] *.arena lookup [name]
This commit is contained in:
25
sql/updates/world/2013_05_xx_xx_world_misc.sql
Normal file
25
sql/updates/world/2013_05_xx_xx_world_misc.sql
Normal file
@@ -0,0 +1,25 @@
|
||||
DELETE FROM `command` WHERE `name` LIKE 'arena%';
|
||||
INSERT INTO `command` (`name`, `security`, `help`) VALUES
|
||||
('arena create', 3, 'Syntax: .arena create $name \"arena name\" #type\n\nA command to create a new Arena-team in game. #type = [2/3/5]'),
|
||||
('arena disband', 3, 'Syntax: .arena disband #TeamID\n\nA command to disband Arena-team in game.'),
|
||||
('arena rename', 3, 'Syntax: .arena rename \"oldname\" \"newname\"\n\nA command to rename Arena-team name.'),
|
||||
('arena captain', 3, 'Syntax: .arena captain #TeamID $name\n\nA command to set new captain to the team $name must be in the team'),
|
||||
('arena info', 2, 'Syntax: .arena info #TeamID\n\nA command that show info about arena team'),
|
||||
('arena lookup', 2, 'Syntax: .arena lookup $name\n\nA command that give a list of arenateam with the given $name');
|
||||
|
||||
DELETE FROM `trinity_string` WHERE `entry` BETWEEN 857 AND 870;
|
||||
INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES
|
||||
(857, 'Arena team [%u] not found'),
|
||||
(858, 'There is already an arena team named \"%s\"'),
|
||||
(859, '%s is already in an arena team of that size'),
|
||||
(860, 'Arena Team In Combat'),
|
||||
(861, 'Arena with name: \"%s\" or silmilar not found'),
|
||||
(862, '[%s] not member of the team \"%s\"'),
|
||||
(863, '[%s] already capitan in the team \"%s\"'),
|
||||
(864, 'New ArenaTeam created [Name: \"%s\"][Id: %u][Type: %u][Captain GUID: %u]'),
|
||||
(865, 'Arena team Name: \"%s\"[Id: %u] disbanded'),
|
||||
(866, 'Arena team [Id: %u] change from \"%s\" to \"%s\"'),
|
||||
(867, 'Arena team Name: \"%s\"[Id: %u] change capitan from[%s] to [%s]'),
|
||||
(868, 'Arena team: \"%s\"[%u] - Rating: %u - Type: %ux%u'),
|
||||
(869, 'Name:\"%s\"[guid:%u] - PR: %u - %s'),
|
||||
(870, '|\"%s\"[ID:%u](%ux%u)|');
|
||||
@@ -269,6 +269,19 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult result)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ArenaTeam::SetName(std::string const& name)
|
||||
{
|
||||
if (TeamName == name || name.empty() || name.length() > 24 || sObjectMgr->IsReservedName(name) || !ObjectMgr::IsValidCharterName(name))
|
||||
return false;
|
||||
|
||||
TeamName = name;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_NAME);
|
||||
stmt->setString(0, TeamName);
|
||||
stmt->setUInt32(1, GetId());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
return true;
|
||||
}
|
||||
|
||||
void ArenaTeam::SetCaptain(uint64 guid)
|
||||
{
|
||||
// Disable remove/promote buttons
|
||||
@@ -360,6 +373,29 @@ void ArenaTeam::Disband(WorldSession* session)
|
||||
sArenaTeamMgr->RemoveArenaTeam(TeamId);
|
||||
}
|
||||
|
||||
void ArenaTeam::Disband()
|
||||
{
|
||||
// Remove all members from arena team
|
||||
while (!Members.empty())
|
||||
DelMember(Members.front().Guid, false);
|
||||
|
||||
// Update database
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ARENA_TEAM);
|
||||
stmt->setUInt32(0, TeamId);
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ARENA_TEAM_MEMBERS);
|
||||
stmt->setUInt32(0, TeamId);
|
||||
trans->Append(stmt);
|
||||
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
|
||||
// Remove arena team from ObjectMgr
|
||||
sArenaTeamMgr->RemoveArenaTeam(TeamId);
|
||||
}
|
||||
|
||||
void ArenaTeam::Roster(WorldSession* session)
|
||||
{
|
||||
Player* player = NULL;
|
||||
|
||||
@@ -121,6 +121,7 @@ class ArenaTeam
|
||||
|
||||
bool Create(uint64 captainGuid, uint8 type, std::string const& teamName, uint32 backgroundColor, uint8 emblemStyle, uint32 emblemColor, uint8 borderStyle, uint32 borderColor);
|
||||
void Disband(WorldSession* session);
|
||||
void Disband();
|
||||
|
||||
typedef std::list<ArenaTeamMember> MemberList;
|
||||
|
||||
@@ -136,6 +137,7 @@ class ArenaTeam
|
||||
uint32 GetAverageMMR(Group* group) const;
|
||||
|
||||
void SetCaptain(uint64 guid);
|
||||
bool SetName(std::string const& name);
|
||||
bool AddMember(uint64 PlayerGuid);
|
||||
|
||||
// Shouldn't be uint64 ed, because than can reference guid from members on Disband
|
||||
|
||||
@@ -828,7 +828,21 @@ enum TrinityStrings
|
||||
LANG_CHARACTER_GENDER_MALE = 855,
|
||||
LANG_CHARACTER_GENDER_FEMALE = 856,
|
||||
|
||||
// Room for in-game strings 857-999 not used
|
||||
LANG_ARENA_ERROR_NOT_FOUND = 857,
|
||||
LANG_ARENA_ERROR_NAME_EXISTS = 858,
|
||||
LANG_ARENA_ERROR_SIZE = 859,
|
||||
LANG_ARENA_ERROR_COMBAT = 860,
|
||||
LANG_AREAN_ERROR_NAME_NOT_FOUND = 861,
|
||||
LANG_ARENA_ERROR_NOT_MEMBER = 862,
|
||||
LANG_ARENA_ERROR_CAPTAIN = 863,
|
||||
LANG_ARENA_CREATE = 864,
|
||||
LANG_ARENA_DISBAND = 865,
|
||||
LANG_ARENA_RENAME = 866,
|
||||
LANG_ARENA_CAPTAIN = 867,
|
||||
LANG_ARENA_INFO_HEADER = 868,
|
||||
LANG_ARENA_INFO_MEMBERS = 869,
|
||||
LANG_ARENA_LOOKUP = 870,
|
||||
// Room for in-game strings 870-999 not used
|
||||
|
||||
// Level 4 (CLI only commands)
|
||||
LANG_COMMAND_EXIT = 1000,
|
||||
|
||||
@@ -46,6 +46,7 @@ void AddSC_SmartSCripts();
|
||||
//Commands
|
||||
void AddSC_account_commandscript();
|
||||
void AddSC_achievement_commandscript();
|
||||
void AddSC_arena_commandscript();
|
||||
void AddSC_ban_commandscript();
|
||||
void AddSC_bf_commandscript();
|
||||
void AddSC_cast_commandscript();
|
||||
@@ -680,6 +681,7 @@ void AddCommandScripts()
|
||||
{
|
||||
AddSC_account_commandscript();
|
||||
AddSC_achievement_commandscript();
|
||||
AddSC_arena_commandscript();
|
||||
AddSC_ban_commandscript();
|
||||
AddSC_bf_commandscript();
|
||||
AddSC_cast_commandscript();
|
||||
|
||||
@@ -12,6 +12,7 @@ set(scripts_STAT_SRCS
|
||||
${scripts_STAT_SRCS}
|
||||
Commands/cs_account.cpp
|
||||
Commands/cs_achievement.cpp
|
||||
Commands/cs_arena.cpp
|
||||
Commands/cs_ban.cpp
|
||||
Commands/cs_bf.cpp
|
||||
Commands/cs_cast.cpp
|
||||
|
||||
345
src/server/scripts/Commands/cs_arena.cpp
Normal file
345
src/server/scripts/Commands/cs_arena.cpp
Normal file
@@ -0,0 +1,345 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
Name: arena_commandscript
|
||||
%Complete: 100
|
||||
Comment: All arena team related commands
|
||||
Category: commandscripts
|
||||
EndScriptData */
|
||||
|
||||
#include "Chat.h"
|
||||
#include "Language.h"
|
||||
#include "ArenaTeamMgr.h"
|
||||
|
||||
class arena_commandscript : public CommandScript
|
||||
{
|
||||
public:
|
||||
arena_commandscript() : CommandScript("arena_commandscript") { }
|
||||
|
||||
ChatCommand* GetCommands() const
|
||||
{
|
||||
static ChatCommand arenaCommandTable[] =
|
||||
{
|
||||
{ "create", SEC_ADMINISTRATOR, true, &HandleArenaCreateCommand, "", NULL },
|
||||
{ "disband", SEC_ADMINISTRATOR, true, &HandleArenaDisbandCommand, "", NULL },
|
||||
{ "rename", SEC_ADMINISTRATOR, true, &HandleArenaRenameCommand, "", NULL },
|
||||
{ "captain", SEC_ADMINISTRATOR, false, &HandleArenaCaptainCommand, "", NULL },
|
||||
{ "info", SEC_GAMEMASTER, true, &HandleArenaInfoCommand, "", NULL },
|
||||
{ "lookup", SEC_GAMEMASTER, false, &HandleArenaLookupCommand, "", NULL },
|
||||
{ NULL, SEC_GAMEMASTER, false, NULL, "", NULL }
|
||||
};
|
||||
static ChatCommand commandTable[] =
|
||||
{
|
||||
{ "arena", SEC_GAMEMASTER, false, NULL, "", arenaCommandTable },
|
||||
{ NULL, SEC_PLAYER, false, NULL, "", NULL }
|
||||
};
|
||||
return commandTable;
|
||||
}
|
||||
|
||||
static bool HandleArenaCreateCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
Player* target;
|
||||
if (!handler->extractPlayerTarget(*args != '"' ? (char*)args : NULL, &target))
|
||||
return false;
|
||||
|
||||
char* tailStr = *args != '"' ? strtok(NULL, "") : (char*)args;
|
||||
if (!tailStr)
|
||||
return false;
|
||||
|
||||
char* name = handler->extractQuotedArg(tailStr);
|
||||
if (!name)
|
||||
return false;
|
||||
char* typeStr = strtok(NULL, "");
|
||||
if (!typeStr)
|
||||
return false;
|
||||
int8 type = atoi(typeStr);
|
||||
if (sArenaTeamMgr->GetArenaTeamByName(name))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_ARENA_ERROR_NAME_EXISTS, name);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
if (type == 2 || type == 3 || type == 5 )
|
||||
{
|
||||
if (Player::GetArenaTeamIdFromDB(target->GetGUID(), type) != 0)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_ARENA_ERROR_SIZE, target->GetName().c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
ArenaTeam* Arena = new ArenaTeam();
|
||||
|
||||
if (!Arena->Create(target->GetGUID(), type, name, 4293102085, 101, 4293253939, 4, 4284049911))
|
||||
{
|
||||
delete Arena;
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
sArenaTeamMgr->AddArenaTeam(Arena);
|
||||
handler->PSendSysMessage(LANG_ARENA_CREATE, Arena->GetName().c_str(), Arena->GetId(), Arena->GetType(), Arena->GetCaptain());
|
||||
}
|
||||
else
|
||||
{
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleArenaDisbandCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint32 teamid = atoi((char*)args);
|
||||
if (!teamid)
|
||||
return false;
|
||||
|
||||
ArenaTeam* Arena = sArenaTeamMgr->GetArenaTeamById(teamid);
|
||||
|
||||
if (!Arena)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_ARENA_ERROR_NOT_FOUND, teamid);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Arena->IsFighting())
|
||||
{
|
||||
handler->SendSysMessage(LANG_ARENA_ERROR_COMBAT);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
std::string name = Arena->GetName();
|
||||
Arena->Disband();
|
||||
if (handler->GetSession())
|
||||
TC_LOG_DEBUG(LOG_FILTER_ARENAS, "GameMaster: %s [GUID: %u] disbanded arena team type: %u [Id: %u].",
|
||||
handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow(), Arena->GetType(), teamid);
|
||||
else
|
||||
TC_LOG_DEBUG(LOG_FILTER_ARENAS, "Console: disbanded arena team type: %u [Id: %u].", Arena->GetType(), teamid);
|
||||
delete(Arena);
|
||||
handler->PSendSysMessage(LANG_ARENA_DISBAND, name.c_str(), teamid);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleArenaRenameCommand(ChatHandler* handler, char const* _args)
|
||||
{
|
||||
if (!*_args)
|
||||
return false;
|
||||
|
||||
char *args = (char *)_args;
|
||||
|
||||
char const* oldArenaStr = handler->extractQuotedArg(args);
|
||||
if (!oldArenaStr)
|
||||
{
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
char const* newArenaStr = handler->extractQuotedArg(strtok(NULL, ""));
|
||||
if (!newArenaStr)
|
||||
{
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
ArenaTeam* Arena = sArenaTeamMgr->GetArenaTeamByName(oldArenaStr);
|
||||
if (!Arena)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_AREAN_ERROR_NAME_NOT_FOUND, oldArenaStr);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sArenaTeamMgr->GetArenaTeamByName(newArenaStr))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_ARENA_ERROR_NAME_EXISTS, oldArenaStr);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Arena->IsFighting())
|
||||
{
|
||||
handler->SendSysMessage(LANG_ARENA_ERROR_COMBAT);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Arena->SetName(newArenaStr))
|
||||
{
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
handler->PSendSysMessage(LANG_ARENA_RENAME, Arena->GetId(), oldArenaStr, newArenaStr);
|
||||
if (handler->GetSession())
|
||||
TC_LOG_DEBUG(LOG_FILTER_ARENAS, "GameMaster: %s [GUID: %u] rename arena team \"%s\"[Id: %u] to \"%s\"",
|
||||
handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow(), oldArenaStr, Arena->GetId(), newArenaStr);
|
||||
else
|
||||
TC_LOG_DEBUG(LOG_FILTER_ARENAS, "Console: rename arena team \"%s\"[Id: %u] to \"%s\"", oldArenaStr, Arena->GetId(), newArenaStr);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleArenaCaptainCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
char* idStr;
|
||||
char* nameStr;
|
||||
handler->extractOptFirstArg((char*)args, &idStr, &nameStr);
|
||||
if (!idStr)
|
||||
return false;
|
||||
|
||||
uint32 teamid = atoi(idStr);
|
||||
if (!teamid)
|
||||
return false;
|
||||
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
if (!handler->extractPlayerTarget(nameStr, &target, &target_guid))
|
||||
return false;
|
||||
|
||||
ArenaTeam *Arena = sArenaTeamMgr->GetArenaTeamById(teamid);
|
||||
|
||||
if (!Arena)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_ARENA_ERROR_NOT_FOUND, teamid);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!target)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_PLAYER_NOT_EXIST_OR_OFFLINE, nameStr);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Arena->IsFighting())
|
||||
{
|
||||
handler->SendSysMessage(LANG_ARENA_ERROR_COMBAT);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!Arena->IsMember(target_guid))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_ARENA_ERROR_NOT_MEMBER, nameStr, Arena->GetName().c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(Arena->GetCaptain() == target_guid)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_ARENA_ERROR_CAPTAIN, nameStr, Arena->GetName().c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
Player* oldCaptain = sObjectMgr->GetPlayerByLowGUID(Arena->GetCaptain());
|
||||
Arena->SetCaptain(target_guid);
|
||||
handler->PSendSysMessage(LANG_ARENA_CAPTAIN, Arena->GetName().c_str(), Arena->GetId(), oldCaptain->GetName().c_str(), target->GetName().c_str());
|
||||
if (handler->GetSession())
|
||||
TC_LOG_DEBUG(LOG_FILTER_ARENAS, "GameMaster: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team \"%s\"[Id: %u]",
|
||||
handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow(), target->GetName().c_str(), target->GetGUIDLow(), Arena->GetName().c_str(), Arena->GetId());
|
||||
else
|
||||
TC_LOG_DEBUG(LOG_FILTER_ARENAS, "Console: promoted player: %s [GUID: %u] to leader of arena team \"%s\"[Id: %u]",
|
||||
target->GetName().c_str(), target->GetGUIDLow(), Arena->GetName().c_str(), Arena->GetId());
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleArenaInfoCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint32 teamid = atoi((char*)args);
|
||||
if (!teamid)
|
||||
return false;
|
||||
|
||||
ArenaTeam *Arena = sArenaTeamMgr->GetArenaTeamById(teamid);
|
||||
|
||||
if (!Arena)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_ARENA_ERROR_NOT_FOUND, teamid);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
handler->PSendSysMessage(LANG_ARENA_INFO_HEADER, Arena->GetName().c_str(), Arena->GetId(), Arena->GetRating(), Arena->GetType(), Arena->GetType());
|
||||
for (ArenaTeam::MemberList::iterator itr = Arena->m_membersBegin(); itr != Arena->m_membersEnd(); ++itr)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_ARENA_INFO_MEMBERS, itr->Name.c_str(), GUID_LOPART(itr->Guid), itr->PersonalRating, (Arena->GetCaptain() == itr->Guid ? "- Captain" : ""));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleArenaLookupCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
std::string namepart = args;
|
||||
std::wstring wnamepart;
|
||||
|
||||
if (!Utf8toWStr(namepart, wnamepart))
|
||||
return false;
|
||||
|
||||
wstrToLower(wnamepart);
|
||||
|
||||
bool found = false;
|
||||
ArenaTeamMgr::ArenaTeamContainer::const_iterator i = sArenaTeamMgr->GetArenaTeamMapBegin();
|
||||
for (; i != sArenaTeamMgr->GetArenaTeamMapEnd(); ++i)
|
||||
{
|
||||
ArenaTeam *Arena = i->second;
|
||||
|
||||
if (Utf8FitTo(Arena->GetName(), wnamepart))
|
||||
{
|
||||
uint32 teamid = Arena->GetId();
|
||||
|
||||
if (handler->GetSession())
|
||||
handler->PSendSysMessage(LANG_ARENA_LOOKUP, Arena->GetName().c_str(), Arena->GetId(), Arena->GetType(), Arena->GetType());
|
||||
|
||||
if (!found)
|
||||
found = true;
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
handler->PSendSysMessage(LANG_AREAN_ERROR_NAME_NOT_FOUND, namepart.c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_arena_commandscript()
|
||||
{
|
||||
new arena_commandscript();
|
||||
}
|
||||
@@ -302,6 +302,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(CHAR_UPD_ARENA_TEAM_MEMBER, "UPDATE arena_team_member SET personalRating = ?, weekGames = ?, weekWins = ?, seasonGames = ?, seasonWins = ? WHERE arenaTeamId = ? AND guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_REP_CHARACTER_ARENA_STATS, "REPLACE INTO character_arena_stats (guid, slot, matchMakerRating) VALUES (?, ?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_PLAYER_ARENA_TEAMS, "SELECT arena_team_member.arenaTeamId FROM arena_team_member JOIN arena_team ON arena_team_member.arenaTeamId = arena_team.arenaTeamId WHERE guid = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(CHAR_UPD_ARENA_TEAM_NAME, "UPDATE arena_team SET name = ? WHERE arenaTeamId = ?", CONNECTION_ASYNC);
|
||||
|
||||
// Character battleground data
|
||||
PrepareStatement(CHAR_INS_PLAYER_BGDATA, "INSERT INTO character_battleground_data (guid, instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
|
||||
|
||||
@@ -253,6 +253,7 @@ enum CharacterDatabaseStatements
|
||||
CHAR_UPD_ARENA_TEAM_MEMBER,
|
||||
CHAR_REP_CHARACTER_ARENA_STATS,
|
||||
CHAR_SEL_PLAYER_ARENA_TEAMS,
|
||||
CHAR_UPD_ARENA_TEAM_NAME,
|
||||
|
||||
CHAR_SEL_PETITION,
|
||||
CHAR_SEL_PETITION_SIGNATURE,
|
||||
|
||||
Reference in New Issue
Block a user