Merge commit 'origin/master' into 320

This commit is contained in:
tomrus88 2009-08-18 09:30:02 +04:00
commit 373a837aa5
17 changed files with 156 additions and 123 deletions

View file

@ -610,11 +610,7 @@ void WorldSession::HandleAreaSpiritHealerQueueOpcode( WorldPacket & recv_data )
void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
{
sLog.outDebug("WORLD: CMSG_BATTLEMASTER_JOIN_ARENA");
recv_data.hexlike();
// ignore if we already in BG or BG queue
if (_player->InBattleGround())
return;
//recv_data.hexlike();
uint64 guid; // arena Battlemaster guid
uint8 arenaslot; // 2v2, 3v3 or 5v5
@ -624,6 +620,10 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
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);
if (!unit)
return;

View file

@ -26,8 +26,7 @@
void WorldSession::HandleCalendarGetCalendar(WorldPacket &recv_data)
{
sLog.outDebug("WORLD: CMSG_CALENDAR_GET_CALENDAR");
recv_data.hexlike();
sLog.outDebug("WORLD: CMSG_CALENDAR_GET_CALENDAR"); // empty
time_t cur_time = time(NULL);
@ -74,27 +73,23 @@ void WorldSession::HandleCalendarGetEvent(WorldPacket &recv_data)
{
sLog.outDebug("WORLD: CMSG_CALENDAR_GET_EVENT");
recv_data.hexlike();
//uint64 unk1;
//recv_data >> (uint64)unk1;
recv_data.read_skip<uint64>(); // unk
}
void WorldSession::HandleCalendarGuildFilter(WorldPacket &recv_data)
{
sLog.outDebug("WORLD: CMSG_CALENDAR_GUILD_FILTER");
recv_data.hexlike();
//uint32 unk1, unk2, unk3;
//recv_data >> (uint32)unk1;
//recv_data >> (uint32)unk2;
//recv_data >> (uint32)unk3;
recv_data.read_skip<uint32>(); // unk1
recv_data.read_skip<uint32>(); // unk2
recv_data.read_skip<uint32>(); // unk3
}
void WorldSession::HandleCalendarArenaTeam(WorldPacket &recv_data)
{
sLog.outDebug("WORLD: CMSG_CALENDAR_ARENA_TEAM");
recv_data.hexlike();
//uint32 unk;
//recv_data >> (uint32)unk;
recv_data.read_skip<uint32>(); // unk
}
void WorldSession::HandleCalendarAddEvent(WorldPacket &recv_data)
@ -241,10 +236,9 @@ void WorldSession::HandleCalendarComplain(WorldPacket &recv_data)
//recv_data >> uint64
}
void WorldSession::HandleCalendarGetNumPending(WorldPacket &recv_data)
void WorldSession::HandleCalendarGetNumPending(WorldPacket & /*recv_data*/)
{
sLog.outDebug("WORLD: CMSG_CALENDAR_GET_NUM_PENDING");
recv_data.hexlike();
sLog.outDebug("WORLD: CMSG_CALENDAR_GET_NUM_PENDING"); // empty
WorldPacket data(SMSG_CALENDAR_SEND_NUM_PENDING, 4);
data << uint32(0); // 0 - no pending invites, 1 - some pending invites

View file

@ -240,11 +240,7 @@ void GameObject::Update(uint32 /*p_time*/)
Unit* caster = GetOwner();
if(caster && caster->GetTypeId()==TYPEID_PLAYER)
{
if(caster->m_currentSpells[CURRENT_CHANNELED_SPELL])
{
caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->SendChannelUpdate(0);
caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->finish(false);
}
caster->FinishSpell(CURRENT_CHANNELED_SPELL);
WorldPacket data(SMSG_FISH_NOT_HOOKED,0);
((Player*)caster)->GetSession()->SendPacket(&data);
@ -1065,11 +1061,7 @@ void GameObject::Use(Unit* user)
}
}
if(player->m_currentSpells[CURRENT_CHANNELED_SPELL])
{
player->m_currentSpells[CURRENT_CHANNELED_SPELL]->SendChannelUpdate(0);
player->m_currentSpells[CURRENT_CHANNELED_SPELL]->finish();
}
player->FinishSpell(CURRENT_CHANNELED_SPELL);
return;
}
@ -1100,7 +1092,7 @@ void GameObject::Use(Unit* user)
// in case summoning ritual caster is GO creator
spellCaster = caster;
if(!caster->m_currentSpells[CURRENT_CHANNELED_SPELL])
if(!caster->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
return;
spellId = info->summoningRitual.spellId;
@ -1113,8 +1105,7 @@ void GameObject::Use(Unit* user)
}
// finish spell
caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->SendChannelUpdate(0);
caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->finish();
player->FinishSpell(CURRENT_CHANNELED_SPELL);
// can be deleted now
SetLootState(GO_JUST_DEACTIVATED);

View file

@ -608,8 +608,6 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
std::string rankname;
uint32 rankId;
uint32 rights, MoneyPerDay;
uint32 BankRights;
uint32 BankSlotPerDay;
//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)
{
uint32 BankRights;
uint32 BankSlotPerDay;
recvPacket >> BankRights;
recvPacket >> BankSlotPerDay;
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);
guild->SetBankMoneyPerDay(rankId, MoneyPerDay);

View file

@ -410,8 +410,8 @@ void WorldSession::HandleSetSelectionOpcode( WorldPacket & recv_data )
void WorldSession::HandleStandStateChangeOpcode( WorldPacket & recv_data )
{
sLog.outDebug( "WORLD: Received CMSG_STAND_STATE_CHANGE" );
uint8 animstate;
// sLog.outDebug( "WORLD: Received CMSG_STANDSTATECHANGE" ); -- too many spam in log at lags/debug stop
uint32 animstate;
recv_data >> animstate;
_player->SetStandState(animstate);
@ -982,11 +982,12 @@ void WorldSession::HandleNextCinematicCamera( WorldPacket & /*recv_data*/ )
DEBUG_LOG( "WORLD: Which movie to play" );
}
void WorldSession::HandleMoveTimeSkippedOpcode( WorldPacket & /*recv_data*/ )
void WorldSession::HandleMoveTimeSkippedOpcode( WorldPacket & recv_data )
{
/* WorldSession::Update( getMSTime() );*/
DEBUG_LOG( "WORLD: Time Lag/Synchronization Resent/Update" );
recv_data.read_skip2<uint64,uint32>();
/*
uint64 guid;
uint32 time_skipped;
@ -1007,19 +1008,20 @@ void WorldSession::HandleFeatherFallAck(WorldPacket &/*recv_data*/)
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" );
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();
uint64 guid;
uint64 unknown1;
uint32 unknown2;
float PositionX;
float PositionY;
float PositionZ;
float Orientation;
recv_data >> guid;
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" );
recv_data.hexlike();
@ -1088,8 +1098,9 @@ void WorldSession::HandleSetActionBarToggles(WorldPacket& recv_data)
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;
recv_data >> tmp;

View file

@ -16912,12 +16912,14 @@ 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 )
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))
if (spell->m_spellInfo->Id != spellid)
InterruptSpell(CURRENT_GENERIC_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))
if (spell->m_spellInfo->Id != spellid)
InterruptSpell(CURRENT_CHANNELED_SPELL,true);
}
@ -18864,11 +18866,9 @@ void Player::RemoveItemDependentAurasAndCasts( Item * pItem )
// currently casted spells can be dependent from item
for (uint32 i = 0; i < CURRENT_MAX_SPELL; ++i)
{
if( m_currentSpells[i] && m_currentSpells[i]->getState()!=SPELL_STATE_DELAYED &&
!HasItemFitToSpellReqirements(m_currentSpells[i]->m_spellInfo,pItem) )
InterruptSpell(i);
}
if (Spell* spell = GetCurrentSpell(CurrentSpellTypes(i)))
if (spell->getState()!=SPELL_STATE_DELAYED && !HasItemFitToSpellReqirements(spell->m_spellInfo,pItem) )
InterruptSpell(CurrentSpellTypes(i));
}
uint32 Player::GetResurrectionSpellId()

View file

@ -152,6 +152,7 @@ void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data )
{
uint32 entry;
recv_data >> entry;
recv_data.read_skip<uint64>(); // guid
CreatureInfo const *ci = objmgr.GetCreatureTemplate(entry);
if (ci)
@ -219,6 +220,7 @@ void WorldSession::HandleGameObjectQueryOpcode( WorldPacket & recv_data )
{
uint32 entryID;
recv_data >> entryID;
recv_data.read_skip<uint64>(); // guid
const GameObjectInfo *info = objmgr.GetGameObjectInfo(entryID);
if(info)

View file

@ -2265,7 +2265,6 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
else
{
m_caster->SetCurrentCastedSpell( this );
m_selfContainer = &(m_caster->m_currentSpells[GetCurrentContainer()]);
SendSpellStart();
}
}

View file

@ -210,6 +210,7 @@ class Spell
{
friend struct MaNGOS::SpellNotifierPlayer;
friend struct MaNGOS::SpellNotifierCreatureAndPlayer;
friend void Unit::SetCurrentCastedSpell( Spell * pSpell );
public:
void EffectNULL(uint32 );

View file

@ -3495,8 +3495,8 @@ void Aura::HandleFeignDeath(bool apply, bool Real)
m_target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
// prevent interrupt message
if(m_caster_guid==m_target->GetGUID() && m_target->m_currentSpells[CURRENT_GENERIC_SPELL])
m_target->m_currentSpells[CURRENT_GENERIC_SPELL]->finish();
if (m_caster_guid==m_target->GetGUID())
m_target->FinishSpell(CURRENT_GENERIC_SPELL,false);
m_target->InterruptNonMeleeSpells(true);
m_target->getHostilRefManager().deleteReferences();
}
@ -3917,9 +3917,11 @@ void Aura::HandleAuraModSilence(bool apply, bool Real)
{
m_target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED);
// Stop cast only spells vs PreventionType == SPELL_PREVENTION_TYPE_SILENCE
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)
m_target->InterruptSpell(i, false); // Stop spells on prepare or casting state
for (uint32 i = CURRENT_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i)
if (Spell* spell = m_target->GetCurrentSpell(CurrentSpellTypes(i)))
if(spell->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
// Stop spells on prepare or casting state
m_target->InterruptSpell(CurrentSpellTypes(i), false);
}
else
{
@ -6280,13 +6282,10 @@ void Aura::PeriodicTick()
int32 new_damage = pCaster->DealDamage(m_target, pdamage, &cleanDamage, DOT, GetSpellSchoolMask(GetSpellProto()), GetSpellProto(), false);
if (!m_target->isAlive() && pCaster->IsNonMeleeSpellCasted(false))
{
for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i)
{
if (pCaster->m_currentSpells[i] && pCaster->m_currentSpells[i]->m_spellInfo->Id == GetId())
pCaster->m_currentSpells[i]->cancel();
}
}
if (Spell* spell = pCaster->GetCurrentSpell(CurrentSpellTypes(i)))
if (spell->m_spellInfo->Id == GetId())
spell->cancel();
if(Player *modOwner = pCaster->GetSpellModOwner())
@ -6360,15 +6359,8 @@ void Aura::PeriodicTick()
pCaster->RemoveAurasDueToSpell(GetId());
// finish current generic/channeling spells, don't affect autorepeat
if(pCaster->m_currentSpells[CURRENT_GENERIC_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();
}
pCaster->FinishSpell(CURRENT_GENERIC_SPELL);
pCaster->FinishSpell(CURRENT_CHANNELED_SPELL);
}
else
{

View file

@ -1927,15 +1927,8 @@ void Spell::EffectTriggerRitualOfSummoning(uint32 i)
}
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)
@ -4684,15 +4677,16 @@ void Spell::EffectInterruptCast(uint32 /*i*/)
// 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
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
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->InterruptSpell(i,false);
unitTarget->ProhibitSpellScholl(GetSpellSchoolMask(curSpellInfo), GetSpellDuration(m_spellInfo));
unitTarget->InterruptSpell(CurrentSpellTypes(i),false);
}
}
}

View file

@ -348,10 +348,9 @@ void WorldSession::HandleCancelCastOpcode(WorldPacket& recvPacket)
if(mover != _player && mover->GetTypeId()==TYPEID_PLAYER)
return;
// increments with every CANCEL packet, don't use for now
uint8 counter;
uint32 spellId;
recvPacket >> counter;
recvPacket.read_skip<uint8>(); // counter, increments with every CANCEL packet, don't use for now
recvPacket >> spellId;
//FIXME: hack, ignore unexpected client cancel Deadly Throw cast
@ -402,8 +401,8 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket)
// channeled spell case (it currently casted then)
if (IsChanneledSpell(spellInfo))
{
if (_player->m_currentSpells[CURRENT_CHANNELED_SPELL] &&
_player->m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->Id==spellId)
if (Spell* curSpell = _player->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
if (curSpell->m_spellInfo->Id==spellId)
_player->InterruptSpell(CURRENT_CHANNELED_SPELL);
return;
}
@ -468,13 +467,16 @@ void WorldSession::HandleCancelAutoRepeatSpellOpcode( WorldPacket& /*recvPacket*
_player->m_mover->InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
}
/// \todo Complete HandleCancelChanneling function
void WorldSession::HandleCancelChanneling( WorldPacket & /*recv_data */)
void WorldSession::HandleCancelChanneling( WorldPacket & recv_data)
{
/*
uint32 spellid;
recv_data >> spellid;
*/
recv_data.read_skip<uint32>(); // spellid, not used
// 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)

View file

@ -816,16 +816,18 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
if (i == CURRENT_CHANNELED_SPELL)
continue;
if(Spell* spell = pVictim->m_currentSpells[i])
if(Spell* spell = pVictim->GetCurrentSpell(CurrentSpellTypes(i)))
{
if(spell->getState() == SPELL_STATE_PREPARING)
{
if(spell->m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_ABORT_ON_DMG)
pVictim->InterruptSpell(i);
pVictim->InterruptSpell(CurrentSpellTypes(i));
else
spell->Delayed();
}
}
}
}
if(Spell* spell = pVictim->m_currentSpells[CURRENT_CHANNELED_SPELL])
{
@ -879,7 +881,7 @@ void Unit::CastStop(uint32 except_spellid)
{
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)
InterruptSpell(i,false);
InterruptSpell(CurrentSpellTypes(i),false);
}
void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
@ -2705,14 +2707,10 @@ float Unit::MeleeMissChanceCalc(const Unit *pVictim, WeaponAttackType attType) c
}
}
if (isNormal || m_currentSpells[CURRENT_MELEE_SPELL])
{
misschance = 5.0f;
}
else
{
misschance = 24.0f;
}
}
// PvP : PvE melee misschances per leveldif > 2
int32 chance = pVictim->GetTypeId() == TYPEID_PLAYER ? 5 : 7;
@ -3107,9 +3105,11 @@ void Unit::SetCurrentCastedSpell( Spell * pSpell )
// set new current spell
m_currentSpells[CSpellType] = pSpell;
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);
@ -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
{
// We don't do loop here to explicitly show that melee spell is excluded.

View file

@ -711,13 +711,15 @@ struct DeclinedName
enum CurrentSpellTypes
{
CURRENT_MELEE_SPELL = 0,
CURRENT_FIRST_NON_MELEE_SPELL = 1, // just counter
CURRENT_GENERIC_SPELL = 1,
CURRENT_AUTOREPEAT_SPELL = 2,
CURRENT_CHANNELED_SPELL = 3,
CURRENT_MAX_SPELL = 4 // just counter
CURRENT_CHANNELED_SPELL = 3
};
#define CURRENT_FIRST_NON_MELEE_SPELL 1
#define CURRENT_MAX_SPELL 4
enum ActiveStates
{
ACT_PASSIVE = 0x01, // 0x01 - passive
@ -1249,7 +1251,8 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
void SetCurrentCastedSpell(Spell * pSpell);
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
// 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
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid = 0);
Spell* GetCurrentSpell(CurrentSpellTypes spellType) const { return m_currentSpells[spellType]; }
Spell* FindCurrentSpellBySpellId(uint32 spell_id) const;
Spell* m_currentSpells[CURRENT_MAX_SPELL];
uint32 m_addDmgOnce;
uint64 m_TotemSlot[MAX_TOTEM];
uint64 m_ObjectSlot[4];
@ -1557,6 +1559,8 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
uint32 m_CombatTimer;
uint32 m_lastManaUse; // msecs
Spell* m_currentSpells[CURRENT_MAX_SPELL];
UnitVisibility m_Visibility;
Diminishing m_Diminishing;

View file

@ -26,6 +26,7 @@ void WorldSession::HandleVoiceSessionEnableOpcode( WorldPacket & recv_data )
{
sLog.outDebug("WORLD: CMSG_VOICE_SESSION_ENABLE");
// uint8 isVoiceEnabled, uint8 isMicrophoneEnabled
recv_data.read_skip2<uint8,uint8>();
recv_data.hexlike();
}
@ -39,6 +40,7 @@ void WorldSession::HandleChannelVoiceOnOpcode( WorldPacket & recv_data )
void WorldSession::HandleSetActiveVoiceChannel( WorldPacket & recv_data )
{
sLog.outDebug("WORLD: CMSG_SET_ACTIVE_VOICE_CHANNEL");
// uint32, string
recv_data.read_skip<uint32>();
recv_data.read_skip<char*>();
recv_data.hexlike();
}

View file

@ -259,6 +259,32 @@ class ByteBuffer
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()
{
T r = read<T>(_rpos);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8379"
#define REVISION_NR "8383"
#endif // __REVISION_NR_H__