Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

Conflicts:
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Handlers/MailHandler.cpp
This commit is contained in:
Vincent_Michael committed 2013-02-25 17:11:36 +01:00
commit 529c4b7592
61 files changed
+1104 -311

No files matched your search

+26 -22
View File
@@ -59,30 +59,32 @@ public:
// Enables or disables hiding of the staff badge
static bool HandleGMChatCommand(ChatHandler* handler, char const* args)
{
if (!*args)
if (WorldSession* session = handler->GetSession())
{
WorldSession* session = handler->GetSession();
if (!AccountMgr::IsPlayerAccount(session->GetSecurity()) && session->GetPlayer()->isGMChat())
if (!*args)
{
if (session->HasPermission(RBAC_PERM_CHAT_USE_STAFF_BADGE) && session->GetPlayer()->isGMChat())
session->SendNotification(LANG_GM_CHAT_ON);
else
session->SendNotification(LANG_GM_CHAT_OFF);
return true;
}
std::string param = (char*)args;
if (param == "on")
{
session->GetPlayer()->SetGMChat(true);
session->SendNotification(LANG_GM_CHAT_ON);
else
return true;
}
if (param == "off")
{
session->GetPlayer()->SetGMChat(false);
session->SendNotification(LANG_GM_CHAT_OFF);
return true;
}
std::string param = (char*)args;
if (param == "on")
{
handler->GetSession()->GetPlayer()->SetGMChat(true);
handler->GetSession()->SendNotification(LANG_GM_CHAT_ON);
return true;
}
if (param == "off")
{
handler->GetSession()->GetPlayer()->SetGMChat(false);
handler->GetSession()->SendNotification(LANG_GM_CHAT_OFF);
return true;
return true;
}
}
handler->SendSysMessage(LANG_USE_BOL);
@@ -123,7 +125,9 @@ public:
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
{
AccountTypes itrSec = itr->second->GetSession()->GetSecurity();
if ((itr->second->isGameMaster() || (!AccountMgr::IsPlayerAccount(itrSec) && itrSec <= AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) &&
if ((itr->second->isGameMaster() ||
(itr->second->GetSession()->HasPermission(RBAC_PERM_COMMANDS_APPEAR_IN_GM_LIST) &&
itrSec <= AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) &&
(!handler->GetSession() || itr->second->IsVisibleGloballyFor(handler->GetSession()->GetPlayer())))
{
if (first)
+4 -4
View File
@@ -677,7 +677,7 @@ public:
if (target)
{
target->ResurrectPlayer(!AccountMgr::IsPlayerAccount(target->GetSession()->GetSecurity()) ? 1.0f : 0.5f);
target->ResurrectPlayer(target->GetSession()->HasPermission(RBAC_PERM_RESURRECT_WITH_FULL_HPS) ? 1.0f : 0.5f);
target->SpawnCorpseBones();
target->SaveToDB();
}
@@ -880,7 +880,7 @@ public:
Player* player = handler->GetSession()->GetPlayer();
// save GM account without delay and output message
if (!AccountMgr::IsPlayerAccount(handler->GetSession()->GetSecurity()))
if (handler->GetSession()->HasPermission(RBAC_PERM_COMMANDS_SAVE_WITHOUT_DELAY))
{
if (Player* target = handler->getSelectedPlayer())
target->SaveToDB();
@@ -937,8 +937,8 @@ public:
static bool HandleUnstuckCommand(ChatHandler* handler, char const* args)
{
//No args required for players
if (handler->GetSession() && AccountMgr::IsPlayerAccount(handler->GetSession()->GetSecurity()))
// No args required for players
if (handler->GetSession() && !handler->GetSession()->HasPermission(RBAC_PERM_COMMANDS_USE_UNSTUCK_WITH_ARGS))
{
// 7355: "Stuck"
if (Player* player = handler->GetSession()->GetPlayer())
+2 -2
View File
@@ -22,7 +22,7 @@ Comment: All role based access control related commands (including account relat
Category: commandscripts
EndScriptData */
#include "RBAC.h"
#include "AccountMgr.h"
#include "Config.h"
#include "Chat.h"
#include "Language.h"
@@ -188,7 +188,7 @@ public:
if (!rdata)
{
data->rbac = new RBACData(accountId, accountName, ConfigMgr::GetIntDefault("RealmID", 0));
data->rbac = new RBACData(accountId, accountName, realmID);
data->rbac->LoadFromDB();
data->needDelete = true;
}
+5 -7
View File
@@ -95,18 +95,16 @@ public:
return true;
}
// Get target information
uint64 targetGuid = sObjectMgr->GetPlayerGUIDByName(target.c_str());
uint64 targetAccountId = sObjectMgr->GetPlayerAccountIdByGUID(targetGuid);
uint32 targetGmLevel = AccountMgr::GetSecurity(targetAccountId, realmID);
uint32 accountId = AccountMgr::GetId(target);
// Target must exist and have administrative rights
if (!targetGuid || AccountMgr::IsPlayerAccount(targetGmLevel))
if (!AccountMgr::HasPermission(accountId, RBAC_PERM_COMMANDS_BE_ASSIGNED_TICKET, realmID))
{
handler->SendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_A);
return true;
}
uint64 targetGuid = sObjectMgr->GetPlayerGUIDByName(target);
// If already assigned, leave
if (ticket->IsAssignedTo(targetGuid))
{
@@ -125,7 +123,7 @@ public:
// Assign ticket
SQLTransaction trans = SQLTransaction(NULL);
ticket->SetAssignedTo(targetGuid, AccountMgr::IsAdminAccount(targetGmLevel));
ticket->SetAssignedTo(targetGuid, AccountMgr::IsAdminAccount(AccountMgr::GetSecurity(accountId, realmID)));
ticket->SaveToDB(trans);
sTicketMgr->UpdateLastChange();
@@ -954,7 +954,7 @@ class instance_icecrown_citadel : public InstanceMapScript
bool CheckRequiredBosses(uint32 bossId, Player const* player = NULL) const
{
if (player && AccountMgr::IsGMAccount(player->GetSession()->GetSecurity()))
if (player && player->GetSession()->HasPermission(RBAC_PERM_SKIP_CHECK_INSTANCE_REQUIRED_BOSSES))
return true;
switch (bossId)
@@ -425,6 +425,69 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript
std::map<uint32, time_t> _triggerTimes;
};
/*######
## at_frostgrips_hollow
######*/
enum FrostgripsHollow
{
QUEST_THE_LONESOME_WATCHER = 12877,
NPC_STORMFORGED_MONITOR = 29862,
NPC_STORMFORGED_ERADICTOR = 29861,
TYPE_WAYPOINT = 0,
DATA_START = 0
};
Position const stormforgedMonitorPosition = {6963.95f, 45.65f, 818.71f, 4.948f};
Position const stormforgedEradictorPosition = {6983.18f, 7.15f, 806.33f, 2.228f};
class AreaTrigger_at_frostgrips_hollow : public AreaTriggerScript
{
public:
AreaTrigger_at_frostgrips_hollow() : AreaTriggerScript("at_frostgrips_hollow")
{
stormforgedMonitorGUID = 0;
stormforgedEradictorGUID = 0;
}
bool OnTrigger(Player* player, AreaTriggerEntry const* /* trigger */)
{
if (player->GetQuestStatus(QUEST_THE_LONESOME_WATCHER) != QUEST_STATUS_INCOMPLETE)
return false;
Creature* stormforgedMonitor = Creature::GetCreature(*player, stormforgedMonitorGUID);
if (stormforgedMonitor)
return false;
Creature* stormforgedEradictor = Creature::GetCreature(*player, stormforgedEradictorGUID);
if (stormforgedEradictor)
return false;
if ((stormforgedMonitor = player->SummonCreature(NPC_STORMFORGED_MONITOR, stormforgedMonitorPosition, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000)))
{
stormforgedMonitorGUID = stormforgedMonitor->GetGUID();
stormforgedMonitor->SetWalk(false);
/// The npc would search an alternative way to get to the last waypoint without this unit state.
stormforgedMonitor->AddUnitState(UNIT_STATE_IGNORE_PATHFINDING);
stormforgedMonitor->GetMotionMaster()->MovePath(NPC_STORMFORGED_MONITOR * 100, false);
}
if ((stormforgedEradictor = player->SummonCreature(NPC_STORMFORGED_ERADICTOR, stormforgedEradictorPosition, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000)))
{
stormforgedEradictorGUID = stormforgedEradictor->GetGUID();
stormforgedEradictor->GetMotionMaster()->MovePath(NPC_STORMFORGED_ERADICTOR * 100, false);
}
return true;
}
private:
uint64 stormforgedMonitorGUID;
uint64 stormforgedEradictorGUID;
};
void AddSC_areatrigger_scripts()
{
new AreaTrigger_at_coilfang_waterfall();
@@ -436,4 +499,5 @@ void AddSC_areatrigger_scripts()
new AreaTrigger_at_nats_landing();
new AreaTrigger_at_brewfest();
new AreaTrigger_at_area_52_entrance();
new AreaTrigger_at_frostgrips_hollow();
}