Merge commit 'origin/master' into 320

Conflicts:
	src/game/WorldSession.cpp
This commit is contained in:
tomrus88 2009-08-30 15:52:20 +04:00
commit 9c8a0d615e
13 changed files with 162 additions and 22 deletions

View file

@ -854,9 +854,10 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
if (_player->GetMoney() < price)
return;
_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT, slot);
_player->SetBankBagSlotCount(slot);
_player->ModifyMoney(-int32(price));
_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT);
}
void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket)

View file

@ -1005,7 +1005,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
/*0x3D0*/ { "CMSG_TARGET_CAST", STATUS_NEVER, &WorldSession::Handle_NULL },
/*0x3D1*/ { "CMSG_TARGET_SCRIPT_CAST", STATUS_NEVER, &WorldSession::Handle_NULL },
/*0x3D2*/ { "CMSG_CHANNEL_DISPLAY_LIST", STATUS_LOGGEDIN, &WorldSession::HandleChannelDisplayListQuery },
/*0x3D3*/ { "CMSG_SET_ACTIVE_VOICE_CHANNEL", STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, &WorldSession::HandleSetActiveVoiceChannel },
/*0x3D3*/ { "CMSG_SET_ACTIVE_VOICE_CHANNEL", STATUS_AUTHED, &WorldSession::HandleSetActiveVoiceChannel },
/*0x3D4*/ { "CMSG_GET_CHANNEL_MEMBER_COUNT", STATUS_LOGGEDIN, &WorldSession::HandleGetChannelMemberCount },
/*0x3D5*/ { "SMSG_CHANNEL_MEMBER_COUNT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
/*0x3D6*/ { "CMSG_CHANNEL_VOICE_ON", STATUS_LOGGEDIN, &WorldSession::HandleChannelVoiceOnOpcode },

View file

@ -1261,6 +1261,30 @@ bool Aura::isAffectedOnSpell(SpellEntry const *spell) const
return false;
}
void Aura::ReapplyAffectedPassiveAuras( Unit* target )
{
std::set<uint32> affectedPassives;
for(Unit::AuraMap::const_iterator itr = target->GetAuras().begin(); itr != target->GetAuras().end(); ++itr)
{
// permanent passive
if (itr->second->IsPassive() && itr->second->IsPermanent() &&
// non deleted and not same aura (any with same spell id)
!itr->second->IsDeleted() && itr->second->GetId() != GetId() &&
// only applied by self and affected by aura
itr->second->GetCasterGUID() == target->GetGUID() && isAffectedOnSpell(itr->second->GetSpellProto()))
{
affectedPassives.insert(itr->second->GetId());
}
}
for(std::set<uint32>::const_iterator set_itr = affectedPassives.begin(); set_itr != affectedPassives.end(); ++set_itr)
{
target->RemoveAurasDueToSpell(*set_itr);
target->CastSpell(m_target, *set_itr, true);
}
}
/*********************************************************/
/*** BASIC AURA FUNCTION ***/
/*********************************************************/
@ -1317,19 +1341,17 @@ void Aura::HandleAddModifier(bool apply, bool Real)
((Player*)m_target)->AddSpellMod(m_spellmod, apply);
// reaplly talents to own passive persistent auras
std::set<uint32> affectedPassives;
// reapply talents to own passive persistent auras
ReapplyAffectedPassiveAuras(m_target);
for(Unit::AuraMap::const_iterator itr = m_target->GetAuras().begin(); itr != m_target->GetAuras().end(); ++itr)
if (itr->second->IsPassive() && itr->second->IsPermanent() &&
itr->second->GetCasterGUID() == m_target->GetGUID() && isAffectedOnSpell(itr->second->GetSpellProto()))
affectedPassives.insert(itr->second->GetId());
// re-aplly talents and passives applied to pet (it affected by player spellmods)
if(Pet* pet = m_target->GetPet())
ReapplyAffectedPassiveAuras(pet);
for(std::set<uint32>::const_iterator set_itr = affectedPassives.begin(); set_itr != affectedPassives.end(); ++set_itr)
{
m_target->RemoveAurasDueToSpell(*set_itr);
m_target->CastSpell(m_target, *set_itr, true);
}
for(int i = 0; i < MAX_TOTEM; ++i)
if(m_target->m_TotemSlot[i])
if(Creature* totem = m_target->GetMap()->GetCreature(m_target->m_TotemSlot[i]))
ReapplyAffectedPassiveAuras(totem);
}
void Aura::HandleAddTargetTrigger(bool apply, bool /*Real*/)
{
@ -5701,7 +5723,13 @@ void Aura::HandleSpellSpecificBoosts(bool apply)
}
// Aspect of the Dragonhawk dodge
else if (GetSpellProto()->SpellFamilyFlags2 & 0x00001000)
{
spellId1 = 61848;
// triggered spell have same category as main spell and cooldown
if (apply && m_target->GetTypeId()==TYPEID_PLAYER)
((Player*)m_target)->RemoveSpellCooldown(61848);
}
else
return;
break;

View file

@ -341,6 +341,7 @@ class MANGOS_DLL_SPEC Aura
void PeriodicDummyTick();
bool IsCritFromAbilityAura(Unit* caster, uint32& damage);
void ReapplyAffectedPassiveAuras(Unit* target);
Modifier m_modifier;
SpellModifier *m_spellmod;

View file

@ -1000,6 +1000,8 @@ void SpellMgr::LoadSpellBonusess()
DoSpellBonusess worker(sbe);
doForHighRanks(entry,worker);
++count;
} while( result->NextRow() );
delete result;

View file

@ -234,7 +234,11 @@ bool WorldSession::Update(uint32 /*diff*/)
break;
}
m_playerRecentlyLogout = false;
// single from authed time opcodes send in to after logout time
// and before other STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT opcodes.
if (packet->GetOpcode() != CMSG_SET_ACTIVE_VOICE_CHANNEL)
m_playerRecentlyLogout = false;
(this->*opHandle.handler)(*packet);
if (sLog.IsOutDebug() && packet->rpos() < packet->wpos())
LogUnprocessedTail(packet);
@ -582,7 +586,7 @@ void WorldSession::LoadGlobalAccountData()
void WorldSession::LoadAccountData(QueryResult* result, uint32 mask)
{
for (uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
if(mask & (1 << i))
if (mask & (1 << i))
m_accountData[i] = AccountData();
if(!result)