Over 100 camangos Cata commits applied (to c12950)

Over 100 camangos Cata commits applied. up to and inclusing c12950.
This commit is contained in:
Charles A Edwards 2016-08-20 17:10:24 +01:00 committed by Antz
parent b4ec0440aa
commit eef77eadb9
117 changed files with 4314 additions and 3547 deletions

View file

@ -73,7 +73,6 @@
#include "SQLStorages.h"
#include "Vehicle.h"
#include "Calendar.h"
#include "PhaseMgr.h"
#ifdef ENABLE_ELUNA
#include "LuaEngine.h"
#endif /*ENABLE_ELUNA*/
@ -568,8 +567,6 @@ Player::Player(WorldSession* session): Unit(), m_mover(this), m_camera(this), m_
m_cachedGS = 0;
m_slot = 255;
phaseMgr = new PhaseMgr(this);
}
Player::~Player()
@ -610,8 +607,6 @@ Player::~Player()
delete m_declinedname;
delete m_runes;
delete phaseMgr;
}
void Player::CleanupsBeforeDelete()
@ -853,6 +848,9 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c
}
// all item positions resolved
if (info->phaseMap != 0)
CharacterDatabase.PExecute("REPLACE INTO `character_phase_data` (`guid`, `map`) VALUES (%u, %u)", guidlow, info->phaseMap);
return true;
}
@ -958,7 +956,11 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
data << uint32(resist);
SendMessageToSet(&data, true);
uint32 final_damage = DealDamage(this, damage, NULL, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
DamageEffectType damageType = SELF_DAMAGE;
if (type == DAMAGE_FALL && getClass() == CLASS_ROGUE)
damageType = SELF_DAMAGE_ROGUE_FALL;
uint32 final_damage = DealDamage(this, damage, NULL, damageType, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
if (!IsAlive())
{
@ -1390,8 +1392,8 @@ void Player::Update(uint32 update_diff, uint32 p_time)
HandleSobering();
}
// Not auto-free ghost from body in instances
if (m_deathTimer > 0 && !GetMap()->Instanceable())
// Not auto-free ghost from body in instances; also check for resurrection prevention
if (m_deathTimer > 0 && !GetMap()->Instanceable() && !HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
{
if (p_time >= m_deathTimer)
{
@ -2448,7 +2450,15 @@ void Player::SetGameMaster(bool on)
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM);
// restore phase
SetPhaseMask(phaseMgr->GetCurrentPhasemask(), false);
AuraList const& phases = GetAurasByType(SPELL_AURA_PHASE);
AuraList const& phases2 = GetAurasByType(SPELL_AURA_PHASE_2);
if (!phases.empty())
SetPhaseMask(phases.front()->GetMiscValue(), false);
else if (!phases2.empty())
SetPhaseMask(phases2.front()->GetMiscValue(), false);
else
SetPhaseMask(PHASEMASK_NORMAL, false);
CallForAllControlledUnits(SetGameMasterOffHelper(getFaction()), CONTROLLED_PET | CONTROLLED_TOTEMS | CONTROLLED_GUARDIANS | CONTROLLED_CHARM);
@ -2460,9 +2470,6 @@ void Player::SetGameMaster(bool on)
UpdateArea(m_areaUpdateId);
getHostileRefManager().setOnlineOfflineState(true);
phaseMgr->AddUpdateFlag(PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED);
phaseMgr->Update();
}
m_camera.UpdateVisibilityForOwner();
@ -2691,11 +2698,6 @@ void Player::GiveLevel(uint32 level)
MailDraft(mailReward->mailTemplateId).SendMailTo(this, MailSender(MAIL_CREATURE, mailReward->senderEntry));
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL);
PhaseUpdateData phaseUdateData;
phaseUdateData.AddConditionType(CONDITION_LEVEL);
phaseMgr->NotifyConditionChanged(phaseUdateData);
}
void Player::UpdateFreeTalentPoints(bool resetIfNeed)
@ -3080,7 +3082,6 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
PlayerSpellState state = learning ? PLAYERSPELL_NEW : PLAYERSPELL_UNCHANGED;
bool dependent_set = false;
bool disabled_case = false;
bool superceded_old = false;
@ -3088,6 +3089,8 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
if (itr != m_spells.end())
{
uint32 next_active_spell_id = 0;
bool dependent_set = false;
// fix activate state for non-stackable low rank (and find next spell for !active case)
if (sSpellMgr.IsRankedSpellNonStackableInSpellBook(spellInfo))
{
@ -4688,7 +4691,7 @@ void Player::KillPlayer()
// SetFlag( UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_IN_PVP );
SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
ApplyModByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStore.LookupEntry(GetMapId())->Instanceable());
ApplyModByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStore.LookupEntry(GetMapId())->Instanceable() && !HasAuraType(SPELL_AURA_PREVENT_RESURRECTION));
// 6 minutes until repop at graveyard
m_deathTimer = 6 * MINUTE * IN_MILLISECONDS;
@ -6884,11 +6887,7 @@ void Player::UpdateArea(uint32 newArea)
SetFFAPvP(false);
}
phaseMgr->AddUpdateFlag(PHASE_UPDATE_FLAG_AREA_UPDATE);
UpdateAreaDependentAuras();
phaseMgr->RemoveUpdateFlag(PHASE_UPDATE_FLAG_AREA_UPDATE);
}
bool Player::CanUseCapturePoint()
@ -8498,7 +8497,7 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
// 0 - Battle for Wintergrasp in progress, 1 - otherwise
FillInitialWorldState(data, count, 0xED9, 1);
// Time when next Battle for Wintergrasp starts
FillInitialWorldState(data, count, 0x1102, uint32(time(nullptr) + 9000));
FillInitialWorldState(data, count, 0x1102, uint32(time(NULL) + 9000));
switch (zoneid)
{
@ -8844,10 +8843,10 @@ InventoryResult Player::CanUnequipItems(uint32 item, uint32 count) const
return EQUIP_ERR_OK;
}
}
Bag* pBag;
for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
{
pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i);
Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i);
if (pBag)
{
for (uint32 j = 0; j < pBag->GetBagSize(); ++j)
@ -13211,7 +13210,7 @@ void Player::SendPreparedQuest(ObjectGuid guid)
{
qe._Delay = 0; // TEXTEMOTE_MESSAGE; // zyg: player emote
qe._Emote = 0; // TEXTEMOTE_HELLO; // zyg: NPC emote
title = "";
title.clear();
}
else
{
@ -14423,11 +14422,6 @@ void Player::SetQuestStatus(uint32 quest_id, QuestStatus status)
q_status.uState = QUEST_CHANGED;
}
PhaseUpdateData phaseUdateData;
phaseUdateData.AddQuestUpdate(quest_id);
phaseMgr->NotifyConditionChanged(phaseUdateData);
UpdateForQuestWorldObjects();
}
@ -18965,18 +18959,14 @@ void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs)
WorldPacket data(SMSG_SPELL_COOLDOWN, 8 + 1 + m_spells.size() * 8);
data << GetObjectGuid();
data << uint8(0x0); // flags (0x1, 0x2)
time_t curTime = time(NULL);
time_t curTime = time(nullptr);
for (PlayerSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
{
if (itr->second.state == PLAYERSPELL_REMOVED)
continue;
uint32 unSpellId = itr->first;
SpellEntry const* spellInfo = sSpellStore.LookupEntry(unSpellId);
if (!spellInfo)
{
MANGOS_ASSERT(spellInfo);
continue;
}
MANGOS_ASSERT(spellInfo);
// Not send cooldown for this spells
if (spellInfo->HasAttribute(SPELL_ATTR_DISABLED_WHILE_ACTIVE))
@ -22103,6 +22093,25 @@ void Player::_LoadSkills(QueryResult* result)
}
}
uint32 Player::GetPhaseMaskForSpawn() const
{
uint32 phase = PHASEMASK_NORMAL;
if (!isGameMaster())
phase = GetPhaseMask();
else
{
AuraList const& phases = GetAurasByType(SPELL_AURA_PHASE);
if (!phases.empty())
phase = phases.front()->GetMiscValue();
}
// some aura phases include 1 normal map in addition to phase itself
if (uint32 n_phase = phase & ~PHASEMASK_NORMAL)
return n_phase;
return PHASEMASK_NORMAL;
}
InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limit_count) const
{
ItemPrototype const* pProto = pItem->GetProto();