Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Accounts/RBAC.h src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Unit/Unit.h src/server/game/Server/Protocol/Opcodes.cpp
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1,10 @@
|
||||
SET @id = 777;
|
||||
|
||||
-- Add new permissions
|
||||
DELETE FROM `rbac_permissions` WHERE `id`=@id;
|
||||
INSERT INTO `rbac_permissions` (`id`, `name`) VALUES
|
||||
(@id, 'Command: mailbox');
|
||||
|
||||
DELETE FROM `rbac_linked_permissions` WHERE `linkedId`=@id;
|
||||
INSERT INTO `rbac_linked_permissions` (`id`, `linkedId`) VALUES
|
||||
(196, @id);
|
||||
@@ -0,0 +1,5 @@
|
||||
UPDATE `smart_scripts` SET `action_param1`=61752, `target_type`=7, `target_param1`=0, `comment`='Illidan Stormrage - On Just Died - Invoker Cast \'Illidan Kill Credit Master\'' WHERE `entryorguid`=32588 AND `source_type`=0 AND `id`=5;
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id`=61752;
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(61752, 'spell_q13400_illidan_kill_master');
|
||||
@@ -0,0 +1,5 @@
|
||||
SET @id = 777;
|
||||
|
||||
DELETE FROM `command` WHERE `name` = 'mailbox';
|
||||
INSERT INTO `command` (`name`, `permission`, `help`) VALUES
|
||||
('mailbox', @id, 'Syntax: .mailbox\r\n\r\nShow your mailbox content.');
|
||||
@@ -678,8 +678,9 @@ enum RBACPermissions
|
||||
RBAC_PERM_COMMAND_WP_UNLOAD = 772,
|
||||
RBAC_PERM_COMMAND_WP_RELOAD = 773,
|
||||
RBAC_PERM_COMMAND_WP_SHOW = 774,
|
||||
RBAC_PERM_COMMAND_MODIFY_CURRENCY = 775, // only 4.3.4
|
||||
RBAC_PERM_COMMAND_DEBUG_PHASE = 776, // Only 4.3.4
|
||||
RBAC_PERM_COMMAND_MODIFY_CURRENCY = 775, // only 4.3.4
|
||||
RBAC_PERM_COMMAND_DEBUG_PHASE = 776, // only 4.3.4
|
||||
RBAC_PERM_COMMAND_MAILBOX = 777,
|
||||
|
||||
// custom permissions 1000+
|
||||
RBAC_PERM_MAX
|
||||
|
||||
@@ -5154,7 +5154,10 @@ void Player::BuildPlayerRepop()
|
||||
// BG - remove insignia related
|
||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
|
||||
|
||||
// SendCorpseReclaimDelay();
|
||||
int32 corpseReclaimDelay = CalculateCorpseReclaimDelay();
|
||||
|
||||
if (corpseReclaimDelay >= 0)
|
||||
SendCorpseReclaimDelay(corpseReclaimDelay);
|
||||
|
||||
// to prevent cheating
|
||||
corpse->ResetGhostTime();
|
||||
@@ -5265,7 +5268,11 @@ void Player::KillPlayer()
|
||||
m_deathTimer = 6 * MINUTE * IN_MILLISECONDS;
|
||||
|
||||
UpdateCorpseReclaimDelay(); // dependent at use SetDeathPvP() call before kill
|
||||
SendCorpseReclaimDelay();
|
||||
|
||||
int32 corpseReclaimDelay = CalculateCorpseReclaimDelay();
|
||||
|
||||
if (corpseReclaimDelay >= 0)
|
||||
SendCorpseReclaimDelay(corpseReclaimDelay);
|
||||
|
||||
// don't create corpse at this moment, player might be falling
|
||||
|
||||
@@ -17554,8 +17561,9 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
UpdateHonorFields();
|
||||
|
||||
m_deathExpireTime = time_t(fields[37].GetUInt32());
|
||||
if (m_deathExpireTime > now+MAX_DEATH_COUNT*DEATH_EXPIRE_STEP)
|
||||
m_deathExpireTime = now+MAX_DEATH_COUNT*DEATH_EXPIRE_STEP-1;
|
||||
|
||||
if (m_deathExpireTime > now + MAX_DEATH_COUNT * DEATH_EXPIRE_STEP)
|
||||
m_deathExpireTime = now + MAX_DEATH_COUNT * DEATH_EXPIRE_STEP - 1;
|
||||
|
||||
// clear channel spell data (if saved at channel spell casting)
|
||||
SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, 0);
|
||||
@@ -24465,7 +24473,7 @@ uint32 Player::GetCorpseReclaimDelay(bool pvp) const
|
||||
time_t now = time(NULL);
|
||||
// 0..2 full period
|
||||
// should be ceil(x)-1 but not floor(x)
|
||||
uint64 count = (now < m_deathExpireTime - 1) ? (m_deathExpireTime - 1 - now)/DEATH_EXPIRE_STEP : 0;
|
||||
uint64 count = (now < m_deathExpireTime - 1) ? (m_deathExpireTime - 1 - now) / DEATH_EXPIRE_STEP : 0;
|
||||
return copseReclaimDelay[count];
|
||||
}
|
||||
|
||||
@@ -24478,65 +24486,66 @@ void Player::UpdateCorpseReclaimDelay()
|
||||
return;
|
||||
|
||||
time_t now = time(NULL);
|
||||
|
||||
if (now < m_deathExpireTime)
|
||||
{
|
||||
// full and partly periods 1..3
|
||||
uint64 count = (m_deathExpireTime - now)/DEATH_EXPIRE_STEP +1;
|
||||
uint64 count = (m_deathExpireTime - now) / DEATH_EXPIRE_STEP + 1;
|
||||
|
||||
if (count < MAX_DEATH_COUNT)
|
||||
m_deathExpireTime = now+(count+1)*DEATH_EXPIRE_STEP;
|
||||
m_deathExpireTime = now+(count + 1) * DEATH_EXPIRE_STEP;
|
||||
else
|
||||
m_deathExpireTime = now+MAX_DEATH_COUNT*DEATH_EXPIRE_STEP;
|
||||
m_deathExpireTime = now + MAX_DEATH_COUNT*DEATH_EXPIRE_STEP;
|
||||
}
|
||||
else
|
||||
m_deathExpireTime = now+DEATH_EXPIRE_STEP;
|
||||
m_deathExpireTime = now + DEATH_EXPIRE_STEP;
|
||||
}
|
||||
|
||||
void Player::SendCorpseReclaimDelay(bool load)
|
||||
int32 Player::CalculateCorpseReclaimDelay(bool load)
|
||||
{
|
||||
Corpse* corpse = GetCorpse();
|
||||
|
||||
if (load && !corpse)
|
||||
return;
|
||||
return -1;
|
||||
|
||||
bool pvp;
|
||||
if (corpse)
|
||||
pvp = (corpse->GetType() == CORPSE_RESURRECTABLE_PVP);
|
||||
else
|
||||
pvp = (m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH);
|
||||
bool pvp = corpse ? corpse->GetType() == CORPSE_RESURRECTABLE_PVP : m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH;
|
||||
|
||||
uint32 delay;
|
||||
|
||||
time_t delay;
|
||||
if (load)
|
||||
{
|
||||
if (corpse->GetGhostTime() > m_deathExpireTime)
|
||||
return;
|
||||
return -1;
|
||||
|
||||
uint64 count = 0;
|
||||
|
||||
uint64 count;
|
||||
if ((pvp && sWorld->getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
|
||||
(!pvp && sWorld->getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE)))
|
||||
{
|
||||
count = (m_deathExpireTime-corpse->GetGhostTime())/DEATH_EXPIRE_STEP;
|
||||
count = (m_deathExpireTime - corpse->GetGhostTime()) / DEATH_EXPIRE_STEP;
|
||||
|
||||
if (count >= MAX_DEATH_COUNT)
|
||||
count = MAX_DEATH_COUNT-1;
|
||||
count = MAX_DEATH_COUNT - 1;
|
||||
}
|
||||
else
|
||||
count=0;
|
||||
|
||||
time_t expected_time = corpse->GetGhostTime()+copseReclaimDelay[count];
|
||||
|
||||
time_t expected_time = corpse->GetGhostTime() + copseReclaimDelay[count];
|
||||
time_t now = time(NULL);
|
||||
if (now >= expected_time)
|
||||
return;
|
||||
|
||||
delay = expected_time-now;
|
||||
if (now >= expected_time)
|
||||
return -1;
|
||||
|
||||
delay = expected_time - now;
|
||||
}
|
||||
else
|
||||
delay = GetCorpseReclaimDelay(pvp);
|
||||
|
||||
if (!delay)
|
||||
return;
|
||||
return delay * IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
//! corpse reclaim delay 30 * 1000ms or longer at often deaths
|
||||
void Player::SendCorpseReclaimDelay(uint32 delay)
|
||||
{
|
||||
WorldPacket data(SMSG_CORPSE_RECLAIM_DELAY, 4);
|
||||
data << uint32(delay*IN_MILLISECONDS);
|
||||
data << uint32(delay);
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
|
||||
@@ -2145,7 +2145,8 @@ class Player : public Unit, public GridObject<Player>
|
||||
uint32 GetDeathTimer() const { return m_deathTimer; }
|
||||
uint32 GetCorpseReclaimDelay(bool pvp) const;
|
||||
void UpdateCorpseReclaimDelay();
|
||||
void SendCorpseReclaimDelay(bool load = false);
|
||||
int32 CalculateCorpseReclaimDelay(bool load = false);
|
||||
void SendCorpseReclaimDelay(uint32 delay);
|
||||
|
||||
uint32 GetBlockPercent() const { return GetUInt32Value(PLAYER_SHIELD_BLOCK); }
|
||||
bool CanParry() const { return m_canParry; }
|
||||
|
||||
@@ -696,6 +696,7 @@ enum NPCFlags
|
||||
UNIT_NPC_FLAG_GUILD_BANKER = 0x00800000, // cause client to send 997 opcode
|
||||
UNIT_NPC_FLAG_SPELLCLICK = 0x01000000, // cause client to send 1015 opcode (spell click)
|
||||
UNIT_NPC_FLAG_PLAYER_VEHICLE = 0x02000000, // players with mounts that have vehicle data should have it set
|
||||
UNIT_NPC_FLAG_MAILBOX = 0x04000000, // mailbox
|
||||
UNIT_NPC_FLAG_REFORGER = 0x08000000, // reforging
|
||||
UNIT_NPC_FLAG_TRANSMOGRIFIER = 0x10000000, // transmogrification
|
||||
UNIT_NPC_FLAG_VAULTKEEPER = 0x20000000 // void storage
|
||||
|
||||
@@ -30,6 +30,32 @@
|
||||
#include "AccountMgr.h"
|
||||
#include "GuildMgr.h"
|
||||
|
||||
bool WorldSession::CanOpenMailBox(uint64 guid)
|
||||
{
|
||||
if (guid == _player->GetGUID())
|
||||
{
|
||||
if (!HasPermission(rbac::RBAC_PERM_COMMAND_MAILBOX))
|
||||
{
|
||||
TC_LOG_WARN("cheat", "%s attempt open mailbox in cheating way.", _player->GetName().c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (IS_GAMEOBJECT_GUID(guid))
|
||||
{
|
||||
if (!_player->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_MAILBOX))
|
||||
return false;
|
||||
}
|
||||
else if (IS_CRE_OR_VEH_OR_PET_GUID(guid))
|
||||
{
|
||||
if (!_player->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_MAILBOX))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void WorldSession::HandleSendMail(WorldPacket& recvData)
|
||||
{
|
||||
ObjectGuid mailbox;
|
||||
@@ -111,7 +137,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
|
||||
|
||||
// packet read complete, now do check
|
||||
|
||||
if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX))
|
||||
if (!CanOpenMailBox(mailbox))
|
||||
return;
|
||||
|
||||
if (receiverName.empty())
|
||||
@@ -361,7 +387,7 @@ void WorldSession::HandleMailMarkAsRead(WorldPacket& recvData)
|
||||
recvData >> mailbox;
|
||||
recvData >> mailId;
|
||||
|
||||
if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX))
|
||||
if (!CanOpenMailBox(mailbox))
|
||||
return;
|
||||
|
||||
Player* player = _player;
|
||||
@@ -385,7 +411,7 @@ void WorldSession::HandleMailDelete(WorldPacket& recvData)
|
||||
recvData >> mailId;
|
||||
recvData.read_skip<uint32>(); // mailTemplateId
|
||||
|
||||
if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX))
|
||||
if (!CanOpenMailBox(mailbox))
|
||||
return;
|
||||
|
||||
Mail* m = _player->GetMail(mailId);
|
||||
@@ -413,7 +439,7 @@ void WorldSession::HandleMailReturnToSender(WorldPacket& recvData)
|
||||
recvData >> mailId;
|
||||
recvData.read_skip<uint64>(); // original sender GUID for return to, not used
|
||||
|
||||
if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX))
|
||||
if (!CanOpenMailBox(mailbox))
|
||||
return;
|
||||
|
||||
Player* player = _player;
|
||||
@@ -471,7 +497,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket& recvData)
|
||||
recvData >> mailId;
|
||||
recvData >> itemId; // item guid low
|
||||
|
||||
if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX))
|
||||
if (!CanOpenMailBox(mailbox))
|
||||
return;
|
||||
|
||||
Player* player = _player;
|
||||
@@ -568,7 +594,7 @@ void WorldSession::HandleMailTakeMoney(WorldPacket& recvData)
|
||||
recvData >> mailId;
|
||||
recvData >> money;
|
||||
|
||||
if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX))
|
||||
if (!CanOpenMailBox(mailbox))
|
||||
return;
|
||||
|
||||
Player* player = _player;
|
||||
@@ -606,7 +632,7 @@ void WorldSession::HandleGetMailList(WorldPacket& recvData)
|
||||
uint64 mailbox;
|
||||
recvData >> mailbox;
|
||||
|
||||
if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX))
|
||||
if (!CanOpenMailBox(mailbox))
|
||||
return;
|
||||
|
||||
Player* player = _player;
|
||||
@@ -730,7 +756,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket& recvData)
|
||||
recvData >> mailbox;
|
||||
recvData >> mailId;
|
||||
|
||||
if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX))
|
||||
if (!CanOpenMailBox(mailbox))
|
||||
return;
|
||||
|
||||
Player* player = _player;
|
||||
|
||||
@@ -736,34 +736,34 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket& recvData)
|
||||
uint64 guid;
|
||||
recvData >> guid;
|
||||
|
||||
if (GetPlayer()->IsAlive())
|
||||
if (_player->IsAlive())
|
||||
return;
|
||||
|
||||
// do not allow corpse reclaim in arena
|
||||
if (GetPlayer()->InArena())
|
||||
if (_player->InArena())
|
||||
return;
|
||||
|
||||
// body not released yet
|
||||
if (!GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
if (!_player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
return;
|
||||
|
||||
Corpse* corpse = GetPlayer()->GetCorpse();
|
||||
Corpse* corpse = _player->GetCorpse();
|
||||
|
||||
if (!corpse)
|
||||
return;
|
||||
|
||||
// prevent resurrect before 30-sec delay after body release not finished
|
||||
if (time_t(corpse->GetGhostTime() + GetPlayer()->GetCorpseReclaimDelay(corpse->GetType() == CORPSE_RESURRECTABLE_PVP)) > time_t(time(NULL)))
|
||||
if (time_t(corpse->GetGhostTime() + _player->GetCorpseReclaimDelay(corpse->GetType() == CORPSE_RESURRECTABLE_PVP)) > time_t(time(NULL)))
|
||||
return;
|
||||
|
||||
if (!corpse->IsWithinDistInMap(GetPlayer(), CORPSE_RECLAIM_RADIUS, true))
|
||||
if (!corpse->IsWithinDistInMap(_player, CORPSE_RECLAIM_RADIUS, true))
|
||||
return;
|
||||
|
||||
// resurrect
|
||||
GetPlayer()->ResurrectPlayer(GetPlayer()->InBattleground() ? 1.0f : 0.5f);
|
||||
_player->ResurrectPlayer(_player->InBattleground() ? 1.0f : 0.5f);
|
||||
|
||||
// spawn bones
|
||||
GetPlayer()->SpawnCorpseBones();
|
||||
_player->SpawnCorpseBones();
|
||||
}
|
||||
|
||||
void WorldSession::HandleResurrectResponseOpcode(WorldPacket& recvData)
|
||||
|
||||
@@ -104,6 +104,13 @@ void WorldSession::SendShowBank(uint64 guid)
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::SendShowMailBox(uint64 guid)
|
||||
{
|
||||
WorldPacket data(SMSG_SHOW_MAILBOX, 8);
|
||||
data << guid;
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandleTrainerListOpcode(WorldPacket& recvData)
|
||||
{
|
||||
uint64 guid;
|
||||
|
||||
@@ -495,7 +495,7 @@ void OpcodeTable::Initialize()
|
||||
DEFINE_OPCODE_HANDLER(CMSG_SET_RELATIVE_POSITION, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
||||
DEFINE_OPCODE_HANDLER(CMSG_SET_SAVED_INSTANCE_EXTEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetSavedInstanceExtend );
|
||||
DEFINE_OPCODE_HANDLER(CMSG_SET_SELECTION, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode );
|
||||
DEFINE_OPCODE_HANDLER(CMSG_SET_TAXI_BENCHMARK_MODE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode );
|
||||
DEFINE_OPCODE_HANDLER(CMSG_SET_TAXI_BENCHMARK_MODE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode );
|
||||
DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode );
|
||||
DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_CURRENCY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
||||
DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_GOLD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeGoldOpcode );
|
||||
|
||||
@@ -280,6 +280,8 @@ class WorldSession
|
||||
void SendTrainerList(uint64 guid, std::string const& strTitle);
|
||||
void SendListInventory(uint64 guid);
|
||||
void SendShowBank(uint64 guid);
|
||||
bool CanOpenMailBox(uint64 guid);
|
||||
void SendShowMailBox(uint64 guid);
|
||||
void SendTabardVendorActivate(uint64 guid);
|
||||
void SendSpiritResurrect();
|
||||
void SendBindPoint(Creature* npc);
|
||||
|
||||
@@ -6053,8 +6053,10 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
|
||||
if (target != caster && GetSpellInfo()->AttributesEx2 & SPELL_ATTR2_HEALTH_FUNNEL && GetSpellInfo()->Id != 755)
|
||||
{
|
||||
uint32 funnelDamage = GetSpellInfo()->ManaPerSecond; // damage is not affected by spell power
|
||||
if ((int32)funnelDamage > gain)
|
||||
|
||||
if ((int32)funnelDamage > gain && gain > 0)
|
||||
funnelDamage = gain;
|
||||
|
||||
uint32 funnelAbsorb = 0;
|
||||
caster->DealDamageMods(caster, funnelDamage, &funnelAbsorb);
|
||||
caster->SendSpellNonMeleeDamageLog(caster, GetId(), funnelDamage, GetSpellInfo()->GetSchoolMask(), funnelAbsorb, 0, false, 0, false);
|
||||
|
||||
@@ -195,33 +195,34 @@ public:
|
||||
//Enable\Disable Invisible mode
|
||||
static bool HandleGMVisibleCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
Player* _player = handler->GetSession()->GetPlayer();
|
||||
|
||||
if (!*args)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_YOU_ARE, handler->GetSession()->GetPlayer()->isGMVisible() ? handler->GetTrinityString(LANG_VISIBLE) : handler->GetTrinityString(LANG_INVISIBLE));
|
||||
handler->PSendSysMessage(LANG_YOU_ARE, _player->isGMVisible() ? handler->GetTrinityString(LANG_VISIBLE) : handler->GetTrinityString(LANG_INVISIBLE));
|
||||
return true;
|
||||
}
|
||||
|
||||
const uint32 VISUAL_AURA = 37800;
|
||||
std::string param = (char*)args;
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
if (param == "on")
|
||||
{
|
||||
if (player->HasAura(VISUAL_AURA, 0))
|
||||
player->RemoveAurasDueToSpell(VISUAL_AURA);
|
||||
if (_player->HasAura(VISUAL_AURA, 0))
|
||||
_player->RemoveAurasDueToSpell(VISUAL_AURA);
|
||||
|
||||
player->SetGMVisible(true);
|
||||
_player->SetGMVisible(true);
|
||||
_player->UpdateObjectVisibility();
|
||||
handler->GetSession()->SendNotification(LANG_INVISIBLE_VISIBLE);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (param == "off")
|
||||
{
|
||||
_player->AddAura(VISUAL_AURA, _player);
|
||||
_player->SetGMVisible(false);
|
||||
_player->UpdateObjectVisibility();
|
||||
handler->GetSession()->SendNotification(LANG_INVISIBLE_INVISIBLE);
|
||||
player->SetGMVisible(false);
|
||||
|
||||
player->AddAura(VISUAL_AURA, player);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -233,12 +234,11 @@ public:
|
||||
//Enable\Disable GM Mode
|
||||
static bool HandleGMCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
Player* _player = handler->GetSession()->GetPlayer();
|
||||
|
||||
if (!*args)
|
||||
{
|
||||
if (handler->GetSession()->GetPlayer()->IsGameMaster())
|
||||
handler->GetSession()->SendNotification(LANG_GM_ON);
|
||||
else
|
||||
handler->GetSession()->SendNotification(LANG_GM_OFF);
|
||||
handler->GetSession()->SendNotification(_player->IsGameMaster() ? LANG_GM_ON : LANG_GM_OFF);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -246,9 +246,9 @@ public:
|
||||
|
||||
if (param == "on")
|
||||
{
|
||||
handler->GetSession()->GetPlayer()->SetGameMaster(true);
|
||||
_player->SetGameMaster(true);
|
||||
handler->GetSession()->SendNotification(LANG_GM_ON);
|
||||
handler->GetSession()->GetPlayer()->UpdateTriggerVisibility();
|
||||
_player->UpdateTriggerVisibility();
|
||||
#ifdef _DEBUG_VMAPS
|
||||
VMAP::IVMapManager* vMapManager = VMAP::VMapFactory::createOrGetVMapManager();
|
||||
vMapManager->processCommand("stoplog");
|
||||
@@ -258,9 +258,9 @@ public:
|
||||
|
||||
if (param == "off")
|
||||
{
|
||||
handler->GetSession()->GetPlayer()->SetGameMaster(false);
|
||||
_player->SetGameMaster(false);
|
||||
handler->GetSession()->SendNotification(LANG_GM_OFF);
|
||||
handler->GetSession()->GetPlayer()->UpdateTriggerVisibility();
|
||||
_player->UpdateTriggerVisibility();
|
||||
#ifdef _DEBUG_VMAPS
|
||||
VMAP::IVMapManager* vMapManager = VMAP::VMapFactory::createOrGetVMapManager();
|
||||
vMapManager->processCommand("startlog");
|
||||
|
||||
@@ -93,6 +93,7 @@ public:
|
||||
{ "unpossess", rbac::RBAC_PERM_COMMAND_UNPOSSESS, false, &HandleUnPossessCommand, "", NULL },
|
||||
{ "unstuck", rbac::RBAC_PERM_COMMAND_UNSTUCK, true, &HandleUnstuckCommand, "", NULL },
|
||||
{ "wchange", rbac::RBAC_PERM_COMMAND_WCHANGE, false, &HandleChangeWeather, "", NULL },
|
||||
{ "mailbox", rbac::RBAC_PERM_COMMAND_MAILBOX, false, &HandleMailBoxCommand, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
return commandTable;
|
||||
@@ -2470,6 +2471,14 @@ public:
|
||||
player->StopCastingBindSight();
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleMailBoxCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
handler->GetSession()->SendShowMailBox(player->GetGUID());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_misc_commandscript()
|
||||
|
||||
@@ -198,7 +198,7 @@ public:
|
||||
|
||||
void sQuestAccept(Player* player, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_TOREK_ASSULT)
|
||||
if (quest->GetQuestId() == QUEST_FREEDOM_TO_RUUL)
|
||||
{
|
||||
me->setFaction(FACTION_QUEST);
|
||||
npc_escortAI::Start(true, false, player->GetGUID());
|
||||
|
||||
@@ -2241,6 +2241,47 @@ class spell_q12919_gymers_throw : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
enum Quest_The_Hunter_And_The_Prince
|
||||
{
|
||||
SPELL_ILLIDAN_KILL_CREDIT = 61748
|
||||
};
|
||||
|
||||
class spell_q13400_illidan_kill_master : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q13400_illidan_kill_master() : SpellScriptLoader("spell_q13400_illidan_kill_master") { }
|
||||
|
||||
class spell_q13400_illidan_kill_master_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q13400_illidan_kill_master_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ILLIDAN_KILL_CREDIT))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (caster->IsVehicle())
|
||||
if (Unit* passenger = caster->GetVehicleKit()->GetPassenger(0))
|
||||
passenger->CastSpell(passenger, SPELL_ILLIDAN_KILL_CREDIT, true);
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q13400_illidan_kill_master_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const OVERRIDE
|
||||
{
|
||||
return new spell_q13400_illidan_kill_master_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_quest_spell_scripts()
|
||||
{
|
||||
new spell_q55_sacred_cleansing();
|
||||
@@ -2295,4 +2336,5 @@ void AddSC_quest_spell_scripts()
|
||||
new spell_q12619_emblazon_runeblade_effect();
|
||||
new spell_q12919_gymers_grab();
|
||||
new spell_q12919_gymers_throw();
|
||||
new spell_q13400_illidan_kill_master();
|
||||
}
|
||||
|
||||
@@ -62,6 +62,13 @@ WheatyExceptionReport::WheatyExceptionReport() // Constructor
|
||||
// Install the unhandled exception filter function
|
||||
m_previousFilter = SetUnhandledExceptionFilter(WheatyUnhandledExceptionFilter);
|
||||
m_hProcess = GetCurrentProcess();
|
||||
if (!IsDebuggerPresent())
|
||||
{
|
||||
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
|
||||
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
|
||||
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
|
||||
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
|
||||
}
|
||||
}
|
||||
|
||||
//============
|
||||
@@ -566,6 +573,9 @@ PVOID addr, PTSTR szModule, DWORD len, DWORD& section, DWORD_PTR& offset)
|
||||
|
||||
DWORD_PTR hMod = (DWORD_PTR)mbi.AllocationBase;
|
||||
|
||||
if (!hMod)
|
||||
return FALSE;
|
||||
|
||||
if (!GetModuleFileName((HMODULE)hMod, szModule, len))
|
||||
return FALSE;
|
||||
|
||||
@@ -708,7 +718,7 @@ bool bWriteVariables, HANDLE pThreadHandle)
|
||||
}
|
||||
|
||||
// Get the source line for this stack frame entry
|
||||
IMAGEHLP_LINE64 lineInfo = { sizeof(IMAGEHLP_LINE) };
|
||||
IMAGEHLP_LINE64 lineInfo = { sizeof(IMAGEHLP_LINE64) };
|
||||
DWORD dwLineDisplacement;
|
||||
if (SymGetLineFromAddr64(m_hProcess, sf.AddrPC.Offset,
|
||||
&dwLineDisplacement, &lineInfo))
|
||||
@@ -746,11 +756,11 @@ ULONG /*SymbolSize*/,
|
||||
PVOID UserContext)
|
||||
{
|
||||
|
||||
char szBuffer[2048];
|
||||
char szBuffer[4092];
|
||||
|
||||
__try
|
||||
{
|
||||
if (FormatSymbolValue(pSymInfo, (STACKFRAME*)UserContext,
|
||||
if (FormatSymbolValue(pSymInfo, (STACKFRAME64*)UserContext,
|
||||
szBuffer, sizeof(szBuffer)))
|
||||
_tprintf(_T("\t%s\r\n"), szBuffer);
|
||||
}
|
||||
@@ -769,7 +779,7 @@ PVOID UserContext)
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
bool WheatyExceptionReport::FormatSymbolValue(
|
||||
PSYMBOL_INFO pSym,
|
||||
STACKFRAME * sf,
|
||||
STACKFRAME64 * sf,
|
||||
char * pszBuffer,
|
||||
unsigned /*cbBuffer*/)
|
||||
{
|
||||
@@ -782,7 +792,7 @@ unsigned /*cbBuffer*/)
|
||||
pszCurrBuffer += sprintf(pszCurrBuffer, "Local ");
|
||||
|
||||
// If it's a function, don't do anything.
|
||||
if (pSym->Tag == 5) // SymTagFunction from CVCONST.H from the DIA SDK
|
||||
if (pSym->Tag == SymTagFunction) // SymTagFunction from CVCONST.H from the DIA SDK
|
||||
return false;
|
||||
|
||||
DWORD_PTR pVariable = 0; // Will point to the variable's data in memory
|
||||
@@ -791,7 +801,11 @@ unsigned /*cbBuffer*/)
|
||||
{
|
||||
// if (pSym->Register == 8) // EBP is the value 8 (in DBGHELP 5.1)
|
||||
{ // This may change!!!
|
||||
#ifdef _M_IX86
|
||||
pVariable = sf->AddrFrame.Offset;
|
||||
#elif _M_X64
|
||||
pVariable = sf->AddrStack.Offset;
|
||||
#endif
|
||||
pVariable += (DWORD_PTR)pSym->Address;
|
||||
}
|
||||
// else
|
||||
@@ -889,6 +903,12 @@ char* /*Name*/)
|
||||
// Iterate through each of the children
|
||||
for (unsigned i = 0; i < dwChildrenCount; i++)
|
||||
{
|
||||
DWORD symTag;
|
||||
SymGetTypeInfo(m_hProcess, modBase, children.ChildId[i], TI_GET_SYMTAG, &symTag);
|
||||
|
||||
if (symTag == SymTagFunction || symTag == SymTagTypedef)
|
||||
continue;
|
||||
|
||||
// Add appropriate indentation level (since this routine is recursive)
|
||||
for (unsigned j = 0; j <= nestingLevel+1; j++)
|
||||
pszCurrBuffer += sprintf(pszCurrBuffer, "\t");
|
||||
@@ -1017,7 +1037,7 @@ WheatyExceptionReport::GetBasicType(DWORD typeIndex, DWORD64 modBase)
|
||||
//============================================================================
|
||||
int __cdecl WheatyExceptionReport::_tprintf(const TCHAR * format, ...)
|
||||
{
|
||||
TCHAR szBuff[1024];
|
||||
TCHAR szBuff[4092];
|
||||
int retValue;
|
||||
DWORD cbWritten;
|
||||
va_list argptr;
|
||||
|
||||
@@ -98,7 +98,7 @@ class WheatyExceptionReport
|
||||
|
||||
static BOOL CALLBACK EnumerateSymbolsCallback(PSYMBOL_INFO, ULONG, PVOID);
|
||||
|
||||
static bool FormatSymbolValue(PSYMBOL_INFO, STACKFRAME *, char * pszBuffer, unsigned cbBuffer);
|
||||
static bool FormatSymbolValue(PSYMBOL_INFO, STACKFRAME64 *, char * pszBuffer, unsigned cbBuffer);
|
||||
|
||||
static char * DumpTypeIndex(char *, DWORD64, DWORD, unsigned, DWORD_PTR, bool &, char*);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user