mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
Merge commit 'origin/master' into 320
This commit is contained in:
commit
373a837aa5
17 changed files with 156 additions and 123 deletions
|
|
@ -610,11 +610,7 @@ void WorldSession::HandleAreaSpiritHealerQueueOpcode( WorldPacket & recv_data )
|
||||||
void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
||||||
{
|
{
|
||||||
sLog.outDebug("WORLD: CMSG_BATTLEMASTER_JOIN_ARENA");
|
sLog.outDebug("WORLD: CMSG_BATTLEMASTER_JOIN_ARENA");
|
||||||
recv_data.hexlike();
|
//recv_data.hexlike();
|
||||||
|
|
||||||
// ignore if we already in BG or BG queue
|
|
||||||
if (_player->InBattleGround())
|
|
||||||
return;
|
|
||||||
|
|
||||||
uint64 guid; // arena Battlemaster guid
|
uint64 guid; // arena Battlemaster guid
|
||||||
uint8 arenaslot; // 2v2, 3v3 or 5v5
|
uint8 arenaslot; // 2v2, 3v3 or 5v5
|
||||||
|
|
@ -624,6 +620,10 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
||||||
|
|
||||||
recv_data >> guid >> arenaslot >> asGroup >> isRated;
|
recv_data >> guid >> arenaslot >> asGroup >> isRated;
|
||||||
|
|
||||||
|
// ignore if we already in BG or BG queue
|
||||||
|
if (_player->InBattleGround())
|
||||||
|
return;
|
||||||
|
|
||||||
Creature *unit = GetPlayer()->GetMap()->GetCreature(guid);
|
Creature *unit = GetPlayer()->GetMap()->GetCreature(guid);
|
||||||
if (!unit)
|
if (!unit)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,7 @@
|
||||||
|
|
||||||
void WorldSession::HandleCalendarGetCalendar(WorldPacket &recv_data)
|
void WorldSession::HandleCalendarGetCalendar(WorldPacket &recv_data)
|
||||||
{
|
{
|
||||||
sLog.outDebug("WORLD: CMSG_CALENDAR_GET_CALENDAR");
|
sLog.outDebug("WORLD: CMSG_CALENDAR_GET_CALENDAR"); // empty
|
||||||
recv_data.hexlike();
|
|
||||||
|
|
||||||
time_t cur_time = time(NULL);
|
time_t cur_time = time(NULL);
|
||||||
|
|
||||||
|
|
@ -74,27 +73,23 @@ void WorldSession::HandleCalendarGetEvent(WorldPacket &recv_data)
|
||||||
{
|
{
|
||||||
sLog.outDebug("WORLD: CMSG_CALENDAR_GET_EVENT");
|
sLog.outDebug("WORLD: CMSG_CALENDAR_GET_EVENT");
|
||||||
recv_data.hexlike();
|
recv_data.hexlike();
|
||||||
//uint64 unk1;
|
recv_data.read_skip<uint64>(); // unk
|
||||||
//recv_data >> (uint64)unk1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleCalendarGuildFilter(WorldPacket &recv_data)
|
void WorldSession::HandleCalendarGuildFilter(WorldPacket &recv_data)
|
||||||
{
|
{
|
||||||
sLog.outDebug("WORLD: CMSG_CALENDAR_GUILD_FILTER");
|
sLog.outDebug("WORLD: CMSG_CALENDAR_GUILD_FILTER");
|
||||||
recv_data.hexlike();
|
recv_data.hexlike();
|
||||||
//uint32 unk1, unk2, unk3;
|
recv_data.read_skip<uint32>(); // unk1
|
||||||
//recv_data >> (uint32)unk1;
|
recv_data.read_skip<uint32>(); // unk2
|
||||||
//recv_data >> (uint32)unk2;
|
recv_data.read_skip<uint32>(); // unk3
|
||||||
//recv_data >> (uint32)unk3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleCalendarArenaTeam(WorldPacket &recv_data)
|
void WorldSession::HandleCalendarArenaTeam(WorldPacket &recv_data)
|
||||||
{
|
{
|
||||||
sLog.outDebug("WORLD: CMSG_CALENDAR_ARENA_TEAM");
|
sLog.outDebug("WORLD: CMSG_CALENDAR_ARENA_TEAM");
|
||||||
recv_data.hexlike();
|
recv_data.hexlike();
|
||||||
//uint32 unk;
|
recv_data.read_skip<uint32>(); // unk
|
||||||
//recv_data >> (uint32)unk;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleCalendarAddEvent(WorldPacket &recv_data)
|
void WorldSession::HandleCalendarAddEvent(WorldPacket &recv_data)
|
||||||
|
|
@ -241,10 +236,9 @@ void WorldSession::HandleCalendarComplain(WorldPacket &recv_data)
|
||||||
//recv_data >> uint64
|
//recv_data >> uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleCalendarGetNumPending(WorldPacket &recv_data)
|
void WorldSession::HandleCalendarGetNumPending(WorldPacket & /*recv_data*/)
|
||||||
{
|
{
|
||||||
sLog.outDebug("WORLD: CMSG_CALENDAR_GET_NUM_PENDING");
|
sLog.outDebug("WORLD: CMSG_CALENDAR_GET_NUM_PENDING"); // empty
|
||||||
recv_data.hexlike();
|
|
||||||
|
|
||||||
WorldPacket data(SMSG_CALENDAR_SEND_NUM_PENDING, 4);
|
WorldPacket data(SMSG_CALENDAR_SEND_NUM_PENDING, 4);
|
||||||
data << uint32(0); // 0 - no pending invites, 1 - some pending invites
|
data << uint32(0); // 0 - no pending invites, 1 - some pending invites
|
||||||
|
|
|
||||||
|
|
@ -240,11 +240,7 @@ void GameObject::Update(uint32 /*p_time*/)
|
||||||
Unit* caster = GetOwner();
|
Unit* caster = GetOwner();
|
||||||
if(caster && caster->GetTypeId()==TYPEID_PLAYER)
|
if(caster && caster->GetTypeId()==TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
if(caster->m_currentSpells[CURRENT_CHANNELED_SPELL])
|
caster->FinishSpell(CURRENT_CHANNELED_SPELL);
|
||||||
{
|
|
||||||
caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->SendChannelUpdate(0);
|
|
||||||
caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->finish(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
WorldPacket data(SMSG_FISH_NOT_HOOKED,0);
|
WorldPacket data(SMSG_FISH_NOT_HOOKED,0);
|
||||||
((Player*)caster)->GetSession()->SendPacket(&data);
|
((Player*)caster)->GetSession()->SendPacket(&data);
|
||||||
|
|
@ -1065,11 +1061,7 @@ void GameObject::Use(Unit* user)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(player->m_currentSpells[CURRENT_CHANNELED_SPELL])
|
player->FinishSpell(CURRENT_CHANNELED_SPELL);
|
||||||
{
|
|
||||||
player->m_currentSpells[CURRENT_CHANNELED_SPELL]->SendChannelUpdate(0);
|
|
||||||
player->m_currentSpells[CURRENT_CHANNELED_SPELL]->finish();
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1100,7 +1092,7 @@ void GameObject::Use(Unit* user)
|
||||||
// in case summoning ritual caster is GO creator
|
// in case summoning ritual caster is GO creator
|
||||||
spellCaster = caster;
|
spellCaster = caster;
|
||||||
|
|
||||||
if(!caster->m_currentSpells[CURRENT_CHANNELED_SPELL])
|
if(!caster->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
spellId = info->summoningRitual.spellId;
|
spellId = info->summoningRitual.spellId;
|
||||||
|
|
@ -1113,8 +1105,7 @@ void GameObject::Use(Unit* user)
|
||||||
}
|
}
|
||||||
|
|
||||||
// finish spell
|
// finish spell
|
||||||
caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->SendChannelUpdate(0);
|
player->FinishSpell(CURRENT_CHANNELED_SPELL);
|
||||||
caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->finish();
|
|
||||||
|
|
||||||
// can be deleted now
|
// can be deleted now
|
||||||
SetLootState(GO_JUST_DEACTIVATED);
|
SetLootState(GO_JUST_DEACTIVATED);
|
||||||
|
|
|
||||||
|
|
@ -608,8 +608,6 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
|
||||||
std::string rankname;
|
std::string rankname;
|
||||||
uint32 rankId;
|
uint32 rankId;
|
||||||
uint32 rights, MoneyPerDay;
|
uint32 rights, MoneyPerDay;
|
||||||
uint32 BankRights;
|
|
||||||
uint32 BankSlotPerDay;
|
|
||||||
|
|
||||||
//sLog.outDebug("WORLD: Received CMSG_GUILD_RANK");
|
//sLog.outDebug("WORLD: Received CMSG_GUILD_RANK");
|
||||||
|
|
||||||
|
|
@ -633,10 +631,14 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
|
||||||
|
|
||||||
for (int i = 0; i < GUILD_BANK_MAX_TABS; ++i)
|
for (int i = 0; i < GUILD_BANK_MAX_TABS; ++i)
|
||||||
{
|
{
|
||||||
|
uint32 BankRights;
|
||||||
|
uint32 BankSlotPerDay;
|
||||||
|
|
||||||
recvPacket >> BankRights;
|
recvPacket >> BankRights;
|
||||||
recvPacket >> BankSlotPerDay;
|
recvPacket >> BankSlotPerDay;
|
||||||
guild->SetBankRightsAndSlots(rankId, uint8(i), uint16(BankRights & 0xFF), uint16(BankSlotPerDay), true);
|
guild->SetBankRightsAndSlots(rankId, uint8(i), uint16(BankRights & 0xFF), uint16(BankSlotPerDay), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
sLog.outDebug("WORLD: Changed RankName to %s , Rights to 0x%.4X", rankname.c_str(), rights);
|
sLog.outDebug("WORLD: Changed RankName to %s , Rights to 0x%.4X", rankname.c_str(), rights);
|
||||||
|
|
||||||
guild->SetBankMoneyPerDay(rankId, MoneyPerDay);
|
guild->SetBankMoneyPerDay(rankId, MoneyPerDay);
|
||||||
|
|
|
||||||
|
|
@ -410,8 +410,8 @@ void WorldSession::HandleSetSelectionOpcode( WorldPacket & recv_data )
|
||||||
|
|
||||||
void WorldSession::HandleStandStateChangeOpcode( WorldPacket & recv_data )
|
void WorldSession::HandleStandStateChangeOpcode( WorldPacket & recv_data )
|
||||||
{
|
{
|
||||||
sLog.outDebug( "WORLD: Received CMSG_STAND_STATE_CHANGE" );
|
// sLog.outDebug( "WORLD: Received CMSG_STANDSTATECHANGE" ); -- too many spam in log at lags/debug stop
|
||||||
uint8 animstate;
|
uint32 animstate;
|
||||||
recv_data >> animstate;
|
recv_data >> animstate;
|
||||||
|
|
||||||
_player->SetStandState(animstate);
|
_player->SetStandState(animstate);
|
||||||
|
|
@ -982,11 +982,12 @@ void WorldSession::HandleNextCinematicCamera( WorldPacket & /*recv_data*/ )
|
||||||
DEBUG_LOG( "WORLD: Which movie to play" );
|
DEBUG_LOG( "WORLD: Which movie to play" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleMoveTimeSkippedOpcode( WorldPacket & /*recv_data*/ )
|
void WorldSession::HandleMoveTimeSkippedOpcode( WorldPacket & recv_data )
|
||||||
{
|
{
|
||||||
/* WorldSession::Update( getMSTime() );*/
|
/* WorldSession::Update( getMSTime() );*/
|
||||||
DEBUG_LOG( "WORLD: Time Lag/Synchronization Resent/Update" );
|
DEBUG_LOG( "WORLD: Time Lag/Synchronization Resent/Update" );
|
||||||
|
|
||||||
|
recv_data.read_skip2<uint64,uint32>();
|
||||||
/*
|
/*
|
||||||
uint64 guid;
|
uint64 guid;
|
||||||
uint32 time_skipped;
|
uint32 time_skipped;
|
||||||
|
|
@ -1007,19 +1008,20 @@ void WorldSession::HandleFeatherFallAck(WorldPacket &/*recv_data*/)
|
||||||
DEBUG_LOG("WORLD: CMSG_MOVE_FEATHER_FALL_ACK");
|
DEBUG_LOG("WORLD: CMSG_MOVE_FEATHER_FALL_ACK");
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleMoveUnRootAck(WorldPacket&/* recv_data*/)
|
void WorldSession::HandleMoveUnRootAck(WorldPacket& recv_data)
|
||||||
{
|
{
|
||||||
/*
|
sLog.outDebug( "WORLD: CMSG_FORCE_MOVE_UNROOT_ACK" );
|
||||||
|
|
||||||
sLog.outDebug( "WORLD: CMSG_FORCE_MOVE_UNROOT_ACK" );
|
recv_data.read_skip<uint64>(); // guid
|
||||||
|
recv_data.read_skip<uint64>(); // unknown1
|
||||||
|
recv_data.read_skip<uint32>(); // unknown2
|
||||||
|
recv_data.read_skip<float>(); // PositionX
|
||||||
|
recv_data.read_skip<float>(); // PositionY
|
||||||
|
recv_data.read_skip<float>(); // PositionZ
|
||||||
|
recv_data.read_skip<float>(); // Orientation
|
||||||
|
|
||||||
|
/*
|
||||||
recv_data.hexlike();
|
recv_data.hexlike();
|
||||||
uint64 guid;
|
|
||||||
uint64 unknown1;
|
|
||||||
uint32 unknown2;
|
|
||||||
float PositionX;
|
|
||||||
float PositionY;
|
|
||||||
float PositionZ;
|
|
||||||
float Orientation;
|
|
||||||
|
|
||||||
recv_data >> guid;
|
recv_data >> guid;
|
||||||
recv_data >> unknown1;
|
recv_data >> unknown1;
|
||||||
|
|
@ -1040,8 +1042,16 @@ void WorldSession::HandleMoveUnRootAck(WorldPacket&/* recv_data*/)
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleMoveRootAck(WorldPacket&/* recv_data*/)
|
void WorldSession::HandleMoveRootAck(WorldPacket& recv_data)
|
||||||
{
|
{
|
||||||
|
recv_data.read_skip<uint64>(); // guid
|
||||||
|
recv_data.read_skip<uint64>(); // unknown1
|
||||||
|
recv_data.read_skip<uint32>(); // unknown2
|
||||||
|
recv_data.read_skip<float>(); // PositionX
|
||||||
|
recv_data.read_skip<float>(); // PositionY
|
||||||
|
recv_data.read_skip<float>(); // PositionZ
|
||||||
|
recv_data.read_skip<float>(); // Orientation
|
||||||
|
|
||||||
/*
|
/*
|
||||||
sLog.outDebug( "WORLD: CMSG_FORCE_MOVE_ROOT_ACK" );
|
sLog.outDebug( "WORLD: CMSG_FORCE_MOVE_ROOT_ACK" );
|
||||||
recv_data.hexlike();
|
recv_data.hexlike();
|
||||||
|
|
@ -1088,8 +1098,9 @@ void WorldSession::HandleSetActionBarToggles(WorldPacket& recv_data)
|
||||||
GetPlayer()->SetByteValue(PLAYER_FIELD_BYTES, 2, ActionBar);
|
GetPlayer()->SetByteValue(PLAYER_FIELD_BYTES, 2, ActionBar);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleWardenDataOpcode(WorldPacket& /*recv_data*/)
|
void WorldSession::HandleWardenDataOpcode(WorldPacket& recv_data)
|
||||||
{
|
{
|
||||||
|
recv_data.read_skip<uint8>();
|
||||||
/*
|
/*
|
||||||
uint8 tmp;
|
uint8 tmp;
|
||||||
recv_data >> tmp;
|
recv_data >> tmp;
|
||||||
|
|
|
||||||
|
|
@ -16912,13 +16912,15 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
|
||||||
if( m_ShapeShiftFormSpellId && m_form != FORM_BATTLESTANCE && m_form != FORM_BERSERKERSTANCE && m_form != FORM_DEFENSIVESTANCE && m_form != FORM_SHADOW )
|
if( m_ShapeShiftFormSpellId && m_form != FORM_BATTLESTANCE && m_form != FORM_BERSERKERSTANCE && m_form != FORM_DEFENSIVESTANCE && m_form != FORM_SHADOW )
|
||||||
RemoveAurasDueToSpell(m_ShapeShiftFormSpellId);
|
RemoveAurasDueToSpell(m_ShapeShiftFormSpellId);
|
||||||
|
|
||||||
if(m_currentSpells[CURRENT_GENERIC_SPELL] && m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id != spellid)
|
if (Spell* spell = GetCurrentSpell(CURRENT_GENERIC_SPELL))
|
||||||
InterruptSpell(CURRENT_GENERIC_SPELL,false);
|
if (spell->m_spellInfo->Id != spellid)
|
||||||
|
InterruptSpell(CURRENT_GENERIC_SPELL,false);
|
||||||
|
|
||||||
InterruptSpell(CURRENT_AUTOREPEAT_SPELL,false);
|
InterruptSpell(CURRENT_AUTOREPEAT_SPELL,false);
|
||||||
|
|
||||||
if(m_currentSpells[CURRENT_CHANNELED_SPELL] && m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->Id != spellid)
|
if (Spell* spell = GetCurrentSpell(CURRENT_CHANNELED_SPELL))
|
||||||
InterruptSpell(CURRENT_CHANNELED_SPELL,true);
|
if (spell->m_spellInfo->Id != spellid)
|
||||||
|
InterruptSpell(CURRENT_CHANNELED_SPELL,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 sourcenode = nodes[0];
|
uint32 sourcenode = nodes[0];
|
||||||
|
|
@ -18864,11 +18866,9 @@ void Player::RemoveItemDependentAurasAndCasts( Item * pItem )
|
||||||
|
|
||||||
// currently casted spells can be dependent from item
|
// currently casted spells can be dependent from item
|
||||||
for (uint32 i = 0; i < CURRENT_MAX_SPELL; ++i)
|
for (uint32 i = 0; i < CURRENT_MAX_SPELL; ++i)
|
||||||
{
|
if (Spell* spell = GetCurrentSpell(CurrentSpellTypes(i)))
|
||||||
if( m_currentSpells[i] && m_currentSpells[i]->getState()!=SPELL_STATE_DELAYED &&
|
if (spell->getState()!=SPELL_STATE_DELAYED && !HasItemFitToSpellReqirements(spell->m_spellInfo,pItem) )
|
||||||
!HasItemFitToSpellReqirements(m_currentSpells[i]->m_spellInfo,pItem) )
|
InterruptSpell(CurrentSpellTypes(i));
|
||||||
InterruptSpell(i);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Player::GetResurrectionSpellId()
|
uint32 Player::GetResurrectionSpellId()
|
||||||
|
|
|
||||||
|
|
@ -152,6 +152,7 @@ void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data )
|
||||||
{
|
{
|
||||||
uint32 entry;
|
uint32 entry;
|
||||||
recv_data >> entry;
|
recv_data >> entry;
|
||||||
|
recv_data.read_skip<uint64>(); // guid
|
||||||
|
|
||||||
CreatureInfo const *ci = objmgr.GetCreatureTemplate(entry);
|
CreatureInfo const *ci = objmgr.GetCreatureTemplate(entry);
|
||||||
if (ci)
|
if (ci)
|
||||||
|
|
@ -219,6 +220,7 @@ void WorldSession::HandleGameObjectQueryOpcode( WorldPacket & recv_data )
|
||||||
{
|
{
|
||||||
uint32 entryID;
|
uint32 entryID;
|
||||||
recv_data >> entryID;
|
recv_data >> entryID;
|
||||||
|
recv_data.read_skip<uint64>(); // guid
|
||||||
|
|
||||||
const GameObjectInfo *info = objmgr.GetGameObjectInfo(entryID);
|
const GameObjectInfo *info = objmgr.GetGameObjectInfo(entryID);
|
||||||
if(info)
|
if(info)
|
||||||
|
|
|
||||||
|
|
@ -2265,7 +2265,6 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_caster->SetCurrentCastedSpell( this );
|
m_caster->SetCurrentCastedSpell( this );
|
||||||
m_selfContainer = &(m_caster->m_currentSpells[GetCurrentContainer()]);
|
|
||||||
SendSpellStart();
|
SendSpellStart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -210,6 +210,7 @@ class Spell
|
||||||
{
|
{
|
||||||
friend struct MaNGOS::SpellNotifierPlayer;
|
friend struct MaNGOS::SpellNotifierPlayer;
|
||||||
friend struct MaNGOS::SpellNotifierCreatureAndPlayer;
|
friend struct MaNGOS::SpellNotifierCreatureAndPlayer;
|
||||||
|
friend void Unit::SetCurrentCastedSpell( Spell * pSpell );
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void EffectNULL(uint32 );
|
void EffectNULL(uint32 );
|
||||||
|
|
|
||||||
|
|
@ -3495,8 +3495,8 @@ void Aura::HandleFeignDeath(bool apply, bool Real)
|
||||||
m_target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
|
m_target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
|
||||||
|
|
||||||
// prevent interrupt message
|
// prevent interrupt message
|
||||||
if(m_caster_guid==m_target->GetGUID() && m_target->m_currentSpells[CURRENT_GENERIC_SPELL])
|
if (m_caster_guid==m_target->GetGUID())
|
||||||
m_target->m_currentSpells[CURRENT_GENERIC_SPELL]->finish();
|
m_target->FinishSpell(CURRENT_GENERIC_SPELL,false);
|
||||||
m_target->InterruptNonMeleeSpells(true);
|
m_target->InterruptNonMeleeSpells(true);
|
||||||
m_target->getHostilRefManager().deleteReferences();
|
m_target->getHostilRefManager().deleteReferences();
|
||||||
}
|
}
|
||||||
|
|
@ -3917,9 +3917,11 @@ void Aura::HandleAuraModSilence(bool apply, bool Real)
|
||||||
{
|
{
|
||||||
m_target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED);
|
m_target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED);
|
||||||
// Stop cast only spells vs PreventionType == SPELL_PREVENTION_TYPE_SILENCE
|
// Stop cast only spells vs PreventionType == SPELL_PREVENTION_TYPE_SILENCE
|
||||||
for (uint32 i = CURRENT_MELEE_SPELL; i < CURRENT_MAX_SPELL;i++)
|
for (uint32 i = CURRENT_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i)
|
||||||
if (m_target->m_currentSpells[i] && m_target->m_currentSpells[i]->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
|
if (Spell* spell = m_target->GetCurrentSpell(CurrentSpellTypes(i)))
|
||||||
m_target->InterruptSpell(i, false); // Stop spells on prepare or casting state
|
if(spell->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
|
||||||
|
// Stop spells on prepare or casting state
|
||||||
|
m_target->InterruptSpell(CurrentSpellTypes(i), false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -6280,13 +6282,10 @@ void Aura::PeriodicTick()
|
||||||
int32 new_damage = pCaster->DealDamage(m_target, pdamage, &cleanDamage, DOT, GetSpellSchoolMask(GetSpellProto()), GetSpellProto(), false);
|
int32 new_damage = pCaster->DealDamage(m_target, pdamage, &cleanDamage, DOT, GetSpellSchoolMask(GetSpellProto()), GetSpellProto(), false);
|
||||||
|
|
||||||
if (!m_target->isAlive() && pCaster->IsNonMeleeSpellCasted(false))
|
if (!m_target->isAlive() && pCaster->IsNonMeleeSpellCasted(false))
|
||||||
{
|
|
||||||
for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i)
|
for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i)
|
||||||
{
|
if (Spell* spell = pCaster->GetCurrentSpell(CurrentSpellTypes(i)))
|
||||||
if (pCaster->m_currentSpells[i] && pCaster->m_currentSpells[i]->m_spellInfo->Id == GetId())
|
if (spell->m_spellInfo->Id == GetId())
|
||||||
pCaster->m_currentSpells[i]->cancel();
|
spell->cancel();
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(Player *modOwner = pCaster->GetSpellModOwner())
|
if(Player *modOwner = pCaster->GetSpellModOwner())
|
||||||
|
|
@ -6360,15 +6359,8 @@ void Aura::PeriodicTick()
|
||||||
pCaster->RemoveAurasDueToSpell(GetId());
|
pCaster->RemoveAurasDueToSpell(GetId());
|
||||||
|
|
||||||
// finish current generic/channeling spells, don't affect autorepeat
|
// finish current generic/channeling spells, don't affect autorepeat
|
||||||
if(pCaster->m_currentSpells[CURRENT_GENERIC_SPELL])
|
pCaster->FinishSpell(CURRENT_GENERIC_SPELL);
|
||||||
{
|
pCaster->FinishSpell(CURRENT_CHANNELED_SPELL);
|
||||||
pCaster->m_currentSpells[CURRENT_GENERIC_SPELL]->finish();
|
|
||||||
}
|
|
||||||
if(pCaster->m_currentSpells[CURRENT_CHANNELED_SPELL])
|
|
||||||
{
|
|
||||||
pCaster->m_currentSpells[CURRENT_CHANNELED_SPELL]->SendChannelUpdate(0);
|
|
||||||
pCaster->m_currentSpells[CURRENT_CHANNELED_SPELL]->finish();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1927,15 +1927,8 @@ void Spell::EffectTriggerRitualOfSummoning(uint32 i)
|
||||||
}
|
}
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
Spell *spell = new Spell(m_caster, spellInfo, true);
|
|
||||||
|
|
||||||
SpellCastTargets targets;
|
|
||||||
targets.setUnitTarget( unitTarget);
|
|
||||||
spell->prepare(&targets);
|
|
||||||
|
|
||||||
m_caster->SetCurrentCastedSpell(spell);
|
|
||||||
spell->m_selfContainer = &(m_caster->m_currentSpells[spell->GetCurrentContainer()]);
|
|
||||||
|
|
||||||
|
m_caster->CastSpell(unitTarget,spellInfo,false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spell::EffectForceCast(uint32 i)
|
void Spell::EffectForceCast(uint32 i)
|
||||||
|
|
@ -4684,15 +4677,16 @@ void Spell::EffectInterruptCast(uint32 /*i*/)
|
||||||
|
|
||||||
// TODO: not all spells that used this effect apply cooldown at school spells
|
// TODO: not all spells that used this effect apply cooldown at school spells
|
||||||
// also exist case: apply cooldown to interrupted cast only and to all spells
|
// also exist case: apply cooldown to interrupted cast only and to all spells
|
||||||
for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++)
|
for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i)
|
||||||
{
|
{
|
||||||
if (unitTarget->m_currentSpells[i])
|
if (Spell* spell = unitTarget->GetCurrentSpell(CurrentSpellTypes(i)))
|
||||||
{
|
{
|
||||||
|
SpellEntry const* curSpellInfo = spell->m_spellInfo;
|
||||||
// check if we can interrupt spell
|
// check if we can interrupt spell
|
||||||
if ( unitTarget->m_currentSpells[i]->m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_INTERRUPT && unitTarget->m_currentSpells[i]->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE )
|
if ((curSpellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_INTERRUPT) && curSpellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE )
|
||||||
{
|
{
|
||||||
unitTarget->ProhibitSpellScholl(GetSpellSchoolMask(unitTarget->m_currentSpells[i]->m_spellInfo), GetSpellDuration(m_spellInfo));
|
unitTarget->ProhibitSpellScholl(GetSpellSchoolMask(curSpellInfo), GetSpellDuration(m_spellInfo));
|
||||||
unitTarget->InterruptSpell(i,false);
|
unitTarget->InterruptSpell(CurrentSpellTypes(i),false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -348,10 +348,9 @@ void WorldSession::HandleCancelCastOpcode(WorldPacket& recvPacket)
|
||||||
if(mover != _player && mover->GetTypeId()==TYPEID_PLAYER)
|
if(mover != _player && mover->GetTypeId()==TYPEID_PLAYER)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// increments with every CANCEL packet, don't use for now
|
|
||||||
uint8 counter;
|
|
||||||
uint32 spellId;
|
uint32 spellId;
|
||||||
recvPacket >> counter;
|
|
||||||
|
recvPacket.read_skip<uint8>(); // counter, increments with every CANCEL packet, don't use for now
|
||||||
recvPacket >> spellId;
|
recvPacket >> spellId;
|
||||||
|
|
||||||
//FIXME: hack, ignore unexpected client cancel Deadly Throw cast
|
//FIXME: hack, ignore unexpected client cancel Deadly Throw cast
|
||||||
|
|
@ -402,9 +401,9 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket)
|
||||||
// channeled spell case (it currently casted then)
|
// channeled spell case (it currently casted then)
|
||||||
if (IsChanneledSpell(spellInfo))
|
if (IsChanneledSpell(spellInfo))
|
||||||
{
|
{
|
||||||
if (_player->m_currentSpells[CURRENT_CHANNELED_SPELL] &&
|
if (Spell* curSpell = _player->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
|
||||||
_player->m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->Id==spellId)
|
if (curSpell->m_spellInfo->Id==spellId)
|
||||||
_player->InterruptSpell(CURRENT_CHANNELED_SPELL);
|
_player->InterruptSpell(CURRENT_CHANNELED_SPELL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -468,13 +467,16 @@ void WorldSession::HandleCancelAutoRepeatSpellOpcode( WorldPacket& /*recvPacket*
|
||||||
_player->m_mover->InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
|
_player->m_mover->InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \todo Complete HandleCancelChanneling function
|
void WorldSession::HandleCancelChanneling( WorldPacket & recv_data)
|
||||||
void WorldSession::HandleCancelChanneling( WorldPacket & /*recv_data */)
|
|
||||||
{
|
{
|
||||||
/*
|
recv_data.read_skip<uint32>(); // spellid, not used
|
||||||
uint32 spellid;
|
|
||||||
recv_data >> spellid;
|
// ignore for remote control state (for player case)
|
||||||
*/
|
Unit* mover = _player->m_mover;
|
||||||
|
if(mover != _player && mover->GetTypeId()==TYPEID_PLAYER)
|
||||||
|
return;
|
||||||
|
|
||||||
|
mover->InterruptSpell(CURRENT_CHANNELED_SPELL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleTotemDestroyed( WorldPacket& recvPacket)
|
void WorldSession::HandleTotemDestroyed( WorldPacket& recvPacket)
|
||||||
|
|
|
||||||
|
|
@ -816,14 +816,16 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||||
if (i == CURRENT_CHANNELED_SPELL)
|
if (i == CURRENT_CHANNELED_SPELL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(Spell* spell = pVictim->m_currentSpells[i])
|
if(Spell* spell = pVictim->GetCurrentSpell(CurrentSpellTypes(i)))
|
||||||
|
{
|
||||||
if(spell->getState() == SPELL_STATE_PREPARING)
|
if(spell->getState() == SPELL_STATE_PREPARING)
|
||||||
{
|
{
|
||||||
if(spell->m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_ABORT_ON_DMG)
|
if(spell->m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_ABORT_ON_DMG)
|
||||||
pVictim->InterruptSpell(i);
|
pVictim->InterruptSpell(CurrentSpellTypes(i));
|
||||||
else
|
else
|
||||||
spell->Delayed();
|
spell->Delayed();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -879,7 +881,7 @@ void Unit::CastStop(uint32 except_spellid)
|
||||||
{
|
{
|
||||||
for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i)
|
for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i)
|
||||||
if (m_currentSpells[i] && m_currentSpells[i]->m_spellInfo->Id!=except_spellid)
|
if (m_currentSpells[i] && m_currentSpells[i]->m_spellInfo->Id!=except_spellid)
|
||||||
InterruptSpell(i,false);
|
InterruptSpell(CurrentSpellTypes(i),false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
|
void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
|
||||||
|
|
@ -2705,13 +2707,9 @@ float Unit::MeleeMissChanceCalc(const Unit *pVictim, WeaponAttackType attType) c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isNormal || m_currentSpells[CURRENT_MELEE_SPELL])
|
if (isNormal || m_currentSpells[CURRENT_MELEE_SPELL])
|
||||||
{
|
|
||||||
misschance = 5.0f;
|
misschance = 5.0f;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
misschance = 24.0f;
|
misschance = 24.0f;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PvP : PvE melee misschances per leveldif > 2
|
// PvP : PvE melee misschances per leveldif > 2
|
||||||
|
|
@ -3107,9 +3105,11 @@ void Unit::SetCurrentCastedSpell( Spell * pSpell )
|
||||||
// set new current spell
|
// set new current spell
|
||||||
m_currentSpells[CSpellType] = pSpell;
|
m_currentSpells[CSpellType] = pSpell;
|
||||||
pSpell->SetReferencedFromCurrent(true);
|
pSpell->SetReferencedFromCurrent(true);
|
||||||
|
|
||||||
|
pSpell->m_selfContainer = &(m_currentSpells[pSpell->GetCurrentContainer()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::InterruptSpell(uint32 spellType, bool withDelayed)
|
void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed)
|
||||||
{
|
{
|
||||||
assert(spellType < CURRENT_MAX_SPELL);
|
assert(spellType < CURRENT_MAX_SPELL);
|
||||||
|
|
||||||
|
|
@ -3134,6 +3134,19 @@ void Unit::InterruptSpell(uint32 spellType, bool withDelayed)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Unit::FinishSpell(CurrentSpellTypes spellType, bool ok /*= true*/)
|
||||||
|
{
|
||||||
|
Spell* spell = m_currentSpells[spellType];
|
||||||
|
if (!spell)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (spellType == CURRENT_CHANNELED_SPELL)
|
||||||
|
spell->SendChannelUpdate(0);
|
||||||
|
|
||||||
|
spell->finish(ok);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skipAutorepeat) const
|
bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skipAutorepeat) const
|
||||||
{
|
{
|
||||||
// We don't do loop here to explicitly show that melee spell is excluded.
|
// We don't do loop here to explicitly show that melee spell is excluded.
|
||||||
|
|
|
||||||
|
|
@ -710,14 +710,16 @@ struct DeclinedName
|
||||||
|
|
||||||
enum CurrentSpellTypes
|
enum CurrentSpellTypes
|
||||||
{
|
{
|
||||||
CURRENT_MELEE_SPELL = 0,
|
CURRENT_MELEE_SPELL = 0,
|
||||||
CURRENT_FIRST_NON_MELEE_SPELL = 1, // just counter
|
CURRENT_GENERIC_SPELL = 1,
|
||||||
CURRENT_GENERIC_SPELL = 1,
|
CURRENT_AUTOREPEAT_SPELL = 2,
|
||||||
CURRENT_AUTOREPEAT_SPELL = 2,
|
CURRENT_CHANNELED_SPELL = 3
|
||||||
CURRENT_CHANNELED_SPELL = 3,
|
|
||||||
CURRENT_MAX_SPELL = 4 // just counter
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define CURRENT_FIRST_NON_MELEE_SPELL 1
|
||||||
|
#define CURRENT_MAX_SPELL 4
|
||||||
|
|
||||||
|
|
||||||
enum ActiveStates
|
enum ActiveStates
|
||||||
{
|
{
|
||||||
ACT_PASSIVE = 0x01, // 0x01 - passive
|
ACT_PASSIVE = 0x01, // 0x01 - passive
|
||||||
|
|
@ -1249,7 +1251,8 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
||||||
|
|
||||||
void SetCurrentCastedSpell(Spell * pSpell);
|
void SetCurrentCastedSpell(Spell * pSpell);
|
||||||
virtual void ProhibitSpellScholl(SpellSchoolMask /*idSchoolMask*/, uint32 /*unTimeMs*/ ) { }
|
virtual void ProhibitSpellScholl(SpellSchoolMask /*idSchoolMask*/, uint32 /*unTimeMs*/ ) { }
|
||||||
void InterruptSpell(uint32 spellType, bool withDelayed = true);
|
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed = true);
|
||||||
|
void FinishSpell(CurrentSpellTypes spellType, bool ok = true);
|
||||||
|
|
||||||
// set withDelayed to true to account delayed spells as casted
|
// set withDelayed to true to account delayed spells as casted
|
||||||
// delayed+channeled spells are always accounted as casted
|
// delayed+channeled spells are always accounted as casted
|
||||||
|
|
@ -1260,10 +1263,9 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
||||||
// delayed+channeled spells are always interrupted
|
// delayed+channeled spells are always interrupted
|
||||||
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid = 0);
|
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid = 0);
|
||||||
|
|
||||||
|
Spell* GetCurrentSpell(CurrentSpellTypes spellType) const { return m_currentSpells[spellType]; }
|
||||||
Spell* FindCurrentSpellBySpellId(uint32 spell_id) const;
|
Spell* FindCurrentSpellBySpellId(uint32 spell_id) const;
|
||||||
|
|
||||||
Spell* m_currentSpells[CURRENT_MAX_SPELL];
|
|
||||||
|
|
||||||
uint32 m_addDmgOnce;
|
uint32 m_addDmgOnce;
|
||||||
uint64 m_TotemSlot[MAX_TOTEM];
|
uint64 m_TotemSlot[MAX_TOTEM];
|
||||||
uint64 m_ObjectSlot[4];
|
uint64 m_ObjectSlot[4];
|
||||||
|
|
@ -1557,6 +1559,8 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
||||||
uint32 m_CombatTimer;
|
uint32 m_CombatTimer;
|
||||||
uint32 m_lastManaUse; // msecs
|
uint32 m_lastManaUse; // msecs
|
||||||
|
|
||||||
|
Spell* m_currentSpells[CURRENT_MAX_SPELL];
|
||||||
|
|
||||||
UnitVisibility m_Visibility;
|
UnitVisibility m_Visibility;
|
||||||
|
|
||||||
Diminishing m_Diminishing;
|
Diminishing m_Diminishing;
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ void WorldSession::HandleVoiceSessionEnableOpcode( WorldPacket & recv_data )
|
||||||
{
|
{
|
||||||
sLog.outDebug("WORLD: CMSG_VOICE_SESSION_ENABLE");
|
sLog.outDebug("WORLD: CMSG_VOICE_SESSION_ENABLE");
|
||||||
// uint8 isVoiceEnabled, uint8 isMicrophoneEnabled
|
// uint8 isVoiceEnabled, uint8 isMicrophoneEnabled
|
||||||
|
recv_data.read_skip2<uint8,uint8>();
|
||||||
recv_data.hexlike();
|
recv_data.hexlike();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -39,6 +40,7 @@ void WorldSession::HandleChannelVoiceOnOpcode( WorldPacket & recv_data )
|
||||||
void WorldSession::HandleSetActiveVoiceChannel( WorldPacket & recv_data )
|
void WorldSession::HandleSetActiveVoiceChannel( WorldPacket & recv_data )
|
||||||
{
|
{
|
||||||
sLog.outDebug("WORLD: CMSG_SET_ACTIVE_VOICE_CHANNEL");
|
sLog.outDebug("WORLD: CMSG_SET_ACTIVE_VOICE_CHANNEL");
|
||||||
// uint32, string
|
recv_data.read_skip<uint32>();
|
||||||
|
recv_data.read_skip<char*>();
|
||||||
recv_data.hexlike();
|
recv_data.hexlike();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -259,6 +259,32 @@ class ByteBuffer
|
||||||
return _wpos;
|
return _wpos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void read_skip() { read_skip(sizeof(T)); }
|
||||||
|
|
||||||
|
template<typename T1, typename T2>
|
||||||
|
void read_skip2() { read_skip(sizeof(T1)+sizeof(T2)); }
|
||||||
|
|
||||||
|
template<>
|
||||||
|
void read_skip<char*>()
|
||||||
|
{
|
||||||
|
uint8 size = read<uint8>();
|
||||||
|
read_skip(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
void read_skip<char const*>() { read_skip<char*>(); }
|
||||||
|
|
||||||
|
template<>
|
||||||
|
void read_skip<std::string>() { read_skip<char*>(); }
|
||||||
|
|
||||||
|
void read_skip(size_t skip)
|
||||||
|
{
|
||||||
|
if(_rpos + skip > size())
|
||||||
|
throw ByteBufferException(false, _rpos, skip, size());
|
||||||
|
_rpos += skip;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T> T read()
|
template <typename T> T read()
|
||||||
{
|
{
|
||||||
T r = read<T>(_rpos);
|
T r = read<T>(_rpos);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8379"
|
#define REVISION_NR "8383"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue