This commit is contained in:
tomrus88 2009-07-02 09:02:00 +04:00
parent 835a8da42a
commit 41b400dac9
11 changed files with 103 additions and 94 deletions

View file

@ -638,18 +638,18 @@ struct ChrRacesEntry
// 3 unused // 3 unused
uint32 model_m; // 4 uint32 model_m; // 4
uint32 model_f; // 5 uint32 model_f; // 5
// 6-7 unused // 6 unused
uint32 TeamID; // 8 (7-Alliance 1-Horde) uint32 TeamID; // 7 (7-Alliance 1-Horde)
// 9-12 unused // 8-11 unused
uint32 CinematicSequence; // 13 id from CinematicSequences.dbc uint32 CinematicSequence; // 12 id from CinematicSequences.dbc
char* name[16]; // 14-29 used for DBC language detection/selection char* name[16]; // 13-28 used for DBC language detection/selection
// 30 string flags, unused // 29 string flags, unused
//char* nameFemale[16]; // 31-46, if different from base (male) case //char* nameFemale[16]; // 30-45, if different from base (male) case
// 47 string flags, unused // 46 string flags, unused
//char* nameNeutralGender[16]; // 48-63, if different from base (male) case //char* nameNeutralGender[16]; // 47-62, if different from base (male) case
// 64 string flags, unused // 63 string flags, unused
// 65-67 unused // 64-66 unused
uint32 addon; // 68 (0 - original race, 1 - tbc addon, ...) uint32 addon; // 67 (0 - original race, 1 - tbc addon, ...)
}; };
/* not used /* not used
@ -1118,6 +1118,16 @@ struct MapEntry
} }
}; };
struct MapDifficultyEntry
{
uint32 Id; // 0
uint32 MapId; // 1
uint32 Difficulty; // 2
char* transferFailedText[16]; // 3-18
uint32 textFlags; // 19
uint32 resetTime; // 20
};
struct MovieEntry struct MovieEntry
{ {
uint32 Id; // 0 index uint32 Id; // 0 index

View file

@ -33,7 +33,7 @@ const char CharTitlesEntryfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi";
const char ChatChannelsEntryfmt[]="iixssssssssssssssssxxxxxxxxxxxxxxxxxx"; const char ChatChannelsEntryfmt[]="iixssssssssssssssssxxxxxxxxxxxxxxxxxx";
// ChatChannelsEntryfmt, index not used (more compact store) // ChatChannelsEntryfmt, index not used (more compact store)
const char ChrClassesEntryfmt[]="nxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii"; const char ChrClassesEntryfmt[]="nxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii";
const char ChrRacesEntryfmt[]="nxixiixxixxxxissssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi"; const char ChrRacesEntryfmt[]="nxixiixixxxxissssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi";
const char CinematicSequencesEntryfmt[]="nxxxxxxxxx"; const char CinematicSequencesEntryfmt[]="nxxxxxxxxx";
const char CreatureDisplayInfofmt[]="nxxxfxxxxxxxxxxx"; const char CreatureDisplayInfofmt[]="nxxxfxxxxxxxxxxx";
const char CreatureFamilyfmt[]="nfifiiiiixssssssssssssssssxx"; const char CreatureFamilyfmt[]="nfifiiiiixssssssssssssssssxx";

View file

@ -240,13 +240,13 @@ void Object::BuildOutOfRangeUpdateBlock(UpdateData * data) const
data->AddOutOfRangeGUID(GetGUID()); data->AddOutOfRangeGUID(GetGUID());
} }
void Object::DestroyForPlayer(Player *target) const void Object::DestroyForPlayer( Player *target, bool anim ) const
{ {
ASSERT(target); ASSERT(target);
WorldPacket data(SMSG_DESTROY_OBJECT, 8); WorldPacket data(SMSG_DESTROY_OBJECT, 8);
data << uint64(GetGUID()); data << uint64(GetGUID());
data << uint8(0); // WotLK (bool) data << uint8(anim ? 1 : 0); // WotLK (bool), may be despawn animation
target->GetSession()->SendPacket( &data ); target->GetSession()->SendPacket( &data );
} }
@ -314,7 +314,14 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags, uint32 flags2
*data << (uint32)((Player*)this)->GetTransTime(); *data << (uint32)((Player*)this)->GetTransTime();
*data << (int8)((Player*)this)->GetTransSeat(); *data << (int8)((Player*)this)->GetTransSeat();
} }
//MaNGOS currently not have support for other than player on transport else
{
//MaNGOS currently not have support for other than player on transport
*data << uint8(0);
*data << float(0) << float(0) << float(0) << float(0);
*data << uint32(0);
*data << uint8(-1);
}
} }
// 0x02200000 // 0x02200000
@ -773,7 +780,7 @@ void Object::_SetCreateBits(UpdateMask *updateMask, Player* /*target*/) const
void Object::SetInt32Value( uint16 index, int32 value ) void Object::SetInt32Value( uint16 index, int32 value )
{ {
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(m_int32Values[ index ] != value) if(m_int32Values[ index ] != value)
{ {
@ -792,7 +799,7 @@ void Object::SetInt32Value( uint16 index, int32 value )
void Object::SetUInt32Value( uint16 index, uint32 value ) void Object::SetUInt32Value( uint16 index, uint32 value )
{ {
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(m_uint32Values[ index ] != value) if(m_uint32Values[ index ] != value)
{ {
@ -811,7 +818,7 @@ void Object::SetUInt32Value( uint16 index, uint32 value )
void Object::SetUInt64Value( uint16 index, const uint64 &value ) void Object::SetUInt64Value( uint16 index, const uint64 &value )
{ {
ASSERT( index + 1 < m_valuesCount || PrintIndexError( index , true ) ); ASSERT( index + 1 < m_valuesCount || PrintIndexError( index, true ) );
if(*((uint64*)&(m_uint32Values[ index ])) != value) if(*((uint64*)&(m_uint32Values[ index ])) != value)
{ {
m_uint32Values[ index ] = *((uint32*)&value); m_uint32Values[ index ] = *((uint32*)&value);
@ -830,7 +837,7 @@ void Object::SetUInt64Value( uint16 index, const uint64 &value )
void Object::SetFloatValue( uint16 index, float value ) void Object::SetFloatValue( uint16 index, float value )
{ {
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(m_floatValues[ index ] != value) if(m_floatValues[ index ] != value)
{ {
@ -849,7 +856,7 @@ void Object::SetFloatValue( uint16 index, float value )
void Object::SetByteValue( uint16 index, uint8 offset, uint8 value ) void Object::SetByteValue( uint16 index, uint8 offset, uint8 value )
{ {
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(offset > 4) if(offset > 4)
{ {
@ -875,7 +882,7 @@ void Object::SetByteValue( uint16 index, uint8 offset, uint8 value )
void Object::SetUInt16Value( uint16 index, uint8 offset, uint16 value ) void Object::SetUInt16Value( uint16 index, uint8 offset, uint16 value )
{ {
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(offset > 2) if(offset > 2)
{ {
@ -949,7 +956,7 @@ void Object::ApplyModPositiveFloatValue(uint16 index, float val, bool apply)
void Object::SetFlag( uint16 index, uint32 newFlag ) void Object::SetFlag( uint16 index, uint32 newFlag )
{ {
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
uint32 oldval = m_uint32Values[ index ]; uint32 oldval = m_uint32Values[ index ];
uint32 newval = oldval | newFlag; uint32 newval = oldval | newFlag;
@ -970,7 +977,7 @@ void Object::SetFlag( uint16 index, uint32 newFlag )
void Object::RemoveFlag( uint16 index, uint32 oldFlag ) void Object::RemoveFlag( uint16 index, uint32 oldFlag )
{ {
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
uint32 oldval = m_uint32Values[ index ]; uint32 oldval = m_uint32Values[ index ];
uint32 newval = oldval & ~oldFlag; uint32 newval = oldval & ~oldFlag;
@ -991,7 +998,7 @@ void Object::RemoveFlag( uint16 index, uint32 oldFlag )
void Object::SetByteFlag( uint16 index, uint8 offset, uint8 newFlag ) void Object::SetByteFlag( uint16 index, uint8 offset, uint8 newFlag )
{ {
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(offset > 4) if(offset > 4)
{ {
@ -1016,7 +1023,7 @@ void Object::SetByteFlag( uint16 index, uint8 offset, uint8 newFlag )
void Object::RemoveByteFlag( uint16 index, uint8 offset, uint8 oldFlag ) void Object::RemoveByteFlag( uint16 index, uint8 offset, uint8 oldFlag )
{ {
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(offset > 4) if(offset > 4)
{ {
@ -1326,7 +1333,7 @@ bool WorldObject::HasInArc(const float arcangle, const WorldObject* obj) const
void WorldObject::GetRandomPoint( float x, float y, float z, float distance, float &rand_x, float &rand_y, float &rand_z) const void WorldObject::GetRandomPoint( float x, float y, float z, float distance, float &rand_x, float &rand_y, float &rand_z) const
{ {
if(distance==0) if(distance == 0)
{ {
rand_x = x; rand_x = x;
rand_y = y; rand_y = y;
@ -1534,7 +1541,7 @@ void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /*
void WorldObject::SendObjectDeSpawnAnim(uint64 guid) void WorldObject::SendObjectDeSpawnAnim(uint64 guid)
{ {
WorldPacket data(SMSG_GAMEOBJECT_DESPAWN_ANIM, 8); WorldPacket data(SMSG_GAMEOBJECT_DESPAWN_ANIM, 8);
data << guid; data << uint64(guid);
SendMessageToSet(&data, true); SendMessageToSet(&data, true);
} }

View file

@ -151,7 +151,7 @@ class MANGOS_DLL_SPEC Object
void BuildMovementUpdateBlock( UpdateData * data, uint32 flags = 0 ) const; void BuildMovementUpdateBlock( UpdateData * data, uint32 flags = 0 ) const;
void BuildUpdate(UpdateDataMapType &); void BuildUpdate(UpdateDataMapType &);
virtual void DestroyForPlayer( Player *target ) const; virtual void DestroyForPlayer( Player *target, bool anim = false ) const;
const int32& GetInt32Value( uint16 index ) const const int32& GetInt32Value( uint16 index ) const
{ {

View file

@ -1023,7 +1023,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
/*0x3E2*/ { "SMSG_COMSAT_CONNECT_FAIL", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x3E2*/ { "SMSG_COMSAT_CONNECT_FAIL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
/*0x3E3*/ { "SMSG_VOICE_CHAT_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x3E3*/ { "SMSG_VOICE_CHAT_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
/*0x3E4*/ { "CMSG_REPORT_PVP_AFK", STATUS_LOGGEDIN, &WorldSession::HandleReportPvPAFK }, /*0x3E4*/ { "CMSG_REPORT_PVP_AFK", STATUS_LOGGEDIN, &WorldSession::HandleReportPvPAFK },
/*0x3E5*/ { "CMSG_REPORT_PVP_AFK_RESULT", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x3E5*/ { "SMSG_REPORT_PVP_AFK_RESULT", STATUS_NEVER, &WorldSession::Handle_NULL },
/*0x3E6*/ { "CMSG_GUILD_BANKER_ACTIVATE", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankerActivate }, /*0x3E6*/ { "CMSG_GUILD_BANKER_ACTIVATE", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankerActivate },
/*0x3E7*/ { "CMSG_GUILD_BANK_QUERY_TAB", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankQueryTab }, /*0x3E7*/ { "CMSG_GUILD_BANK_QUERY_TAB", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankQueryTab },
/*0x3E8*/ { "SMSG_GUILD_BANK_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x3E8*/ { "SMSG_GUILD_BANK_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },

View file

@ -692,7 +692,7 @@ enum Opcodes
CMSG_GROUP_ASSISTANT_LEADER = 0x28F, CMSG_GROUP_ASSISTANT_LEADER = 0x28F,
CMSG_BUYBACK_ITEM = 0x290, CMSG_BUYBACK_ITEM = 0x290,
SMSG_SERVER_MESSAGE = 0x291, SMSG_SERVER_MESSAGE = 0x291,
CMSG_MEETINGSTONE_JOIN = 0x292, CMSG_MEETINGSTONE_JOIN = 0x292, // lua: SetSavedInstanceExtend
SMSG_MEETINGSTONE_LEAVE = 0x293, SMSG_MEETINGSTONE_LEAVE = 0x293,
CMSG_MEETINGSTONE_CHEAT = 0x294, CMSG_MEETINGSTONE_CHEAT = 0x294,
SMSG_MEETINGSTONE_SETQUEUE = 0x295, SMSG_MEETINGSTONE_SETQUEUE = 0x295,
@ -1031,7 +1031,7 @@ enum Opcodes
SMSG_COMSAT_CONNECT_FAIL = 0x3E2, SMSG_COMSAT_CONNECT_FAIL = 0x3E2,
SMSG_VOICE_CHAT_STATUS = 0x3E3, SMSG_VOICE_CHAT_STATUS = 0x3E3,
CMSG_REPORT_PVP_AFK = 0x3E4, CMSG_REPORT_PVP_AFK = 0x3E4,
CMSG_REPORT_PVP_AFK_RESULT = 0x3E5, SMSG_REPORT_PVP_AFK_RESULT = 0x3E5, // SMSG?
CMSG_GUILD_BANKER_ACTIVATE = 0x3E6, CMSG_GUILD_BANKER_ACTIVATE = 0x3E6,
CMSG_GUILD_BANK_QUERY_TAB = 0x3E7, CMSG_GUILD_BANK_QUERY_TAB = 0x3E7,
SMSG_GUILD_BANK_LIST = 0x3E8, SMSG_GUILD_BANK_LIST = 0x3E8,

View file

@ -3743,9 +3743,9 @@ void Player::BuildCreateUpdateBlockForPlayer( UpdateData *data, Player *target )
Unit::BuildCreateUpdateBlockForPlayer( data, target ); Unit::BuildCreateUpdateBlockForPlayer( data, target );
} }
void Player::DestroyForPlayer( Player *target ) const void Player::DestroyForPlayer( Player *target, bool anim ) const
{ {
Unit::DestroyForPlayer( target ); Unit::DestroyForPlayer( target, anim );
for(int i = 0; i < INVENTORY_SLOT_BAG_END; ++i) for(int i = 0; i < INVENTORY_SLOT_BAG_END; ++i)
{ {
@ -5522,7 +5522,7 @@ ActionButton* Player::addActionButton(uint8 button, uint32 action, uint8 type)
{ {
if(button >= MAX_ACTION_BUTTONS) if(button >= MAX_ACTION_BUTTONS)
{ {
sLog.outError( "Action %u not added into button %u for player %s: button must be < 132", action, button, GetName() ); sLog.outError( "Action %u not added into button %u for player %s: button must be < 144", action, button, GetName() );
return NULL; return NULL;
} }
@ -5564,6 +5564,7 @@ ActionButton* Player::addActionButton(uint8 button, uint32 action, uint8 type)
// set data and update to CHANGED if not NEW // set data and update to CHANGED if not NEW
ab.SetActionAndType(action,ActionButtonType(type)); ab.SetActionAndType(action,ActionButtonType(type));
}
sLog.outDetail( "Player '%u' Added Action '%u' (type %u) to Button '%u'", GetGUIDLow(), action, uint32(type), button ); sLog.outDetail( "Player '%u' Added Action '%u' (type %u) to Button '%u'", GetGUIDLow(), action, uint32(type), button );
return &ab; return &ab;
@ -10328,7 +10329,6 @@ Item* Player::EquipNewItem( uint16 pos, uint32 item, bool update )
Item* Player::EquipItem( uint16 pos, Item *pItem, bool update ) Item* Player::EquipItem( uint16 pos, Item *pItem, bool update )
{ {
AddEnchantmentDurations(pItem); AddEnchantmentDurations(pItem);
AddItemDurations(pItem); AddItemDurations(pItem);
@ -15331,8 +15331,10 @@ void Player::SendRaidInfo()
data << uint32(save->GetMapId()); // map id data << uint32(save->GetMapId()); // map id
data << uint32(save->GetDifficulty()); // difficulty data << uint32(save->GetDifficulty()); // difficulty
data << uint64(save->GetInstanceId()); // instance id data << uint64(save->GetInstanceId()); // instance id
data << uint8(0);
data << uint8(0);
data << uint32(save->GetResetTime() - now); // reset time data << uint32(save->GetResetTime() - now); // reset time
data << uint32(0); // is extended //data << uint32(0); // is extended
++counter; ++counter;
} }
} }
@ -16147,10 +16149,10 @@ void Player::SendAttackSwingBadFacingAttack()
GetSession()->SendPacket( &data ); GetSession()->SendPacket( &data );
} }
void Player::SendAutoRepeatCancel() void Player::SendAutoRepeatCancel(Unit *target)
{ {
WorldPacket data(SMSG_CANCEL_AUTO_REPEAT, GetPackGUID().size()); WorldPacket data(SMSG_CANCEL_AUTO_REPEAT, target->GetPackGUID().size());
data.append(GetPackGUID()); // may be it's target guid data.append(target->GetPackGUID()); // may be it's target guid
GetSession()->SendPacket( &data ); GetSession()->SendPacket( &data );
} }
@ -17883,7 +17885,7 @@ void Player::UpdateVisibilityOf(WorldObject* target)
{ {
if(HaveAtClient(target)) if(HaveAtClient(target))
{ {
if(!target->isVisibleForInState(this,true)) if(!target->isVisibleForInState(this, true))
{ {
target->DestroyForPlayer(this); target->DestroyForPlayer(this);
m_clientGUIDs.erase(target->GetGUID()); m_clientGUIDs.erase(target->GetGUID());
@ -18050,14 +18052,10 @@ void Player::SetGroup(Group *group, int8 subgroup)
void Player::SendInitialPacketsBeforeAddToMap() void Player::SendInitialPacketsBeforeAddToMap()
{ {
WorldPacket data(SMSG_SET_REST_START_OBSOLETE, 4);
data << uint32(0); // unknown, may be rest state time or experience
GetSession()->SendPacket(&data);
GetSocial()->SendSocialList(); GetSocial()->SendSocialList();
// Homebind // Homebind
data.Initialize(SMSG_BINDPOINTUPDATE, 5*4); WorldPacket data(SMSG_BINDPOINTUPDATE, 5*4);
data << m_homebindX << m_homebindY << m_homebindZ; data << m_homebindX << m_homebindY << m_homebindZ;
data << (uint32) m_homebindMapId; data << (uint32) m_homebindMapId;
data << (uint32) m_homebindZoneId; data << (uint32) m_homebindZoneId;
@ -19495,11 +19493,20 @@ bool Player::HasTitle(uint32 bitIndex)
return HasFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag); return HasFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag);
} }
void Player::SetTitle(CharTitlesEntry const* title) void Player::SetTitle(CharTitlesEntry const* title, bool lost)
{ {
uint32 fieldIndexOffset = title->bit_index / 32; uint32 fieldIndexOffset = title->bit_index / 32;
uint32 flag = 1 << (title->bit_index % 32); uint32 flag = 1 << (title->bit_index % 32);
SetFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag);
if(lost)
RemoveFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag);
else
SetFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag);
WorldPacket data(SMSG_TITLE_EARNED, 4 + 4);
data << uint32(title->bit_index);
data << uint32(lost ? 0 : 1); // 1 - earned, 0 - lost
GetSession()->SendPacket(&data);
} }
void Player::ConvertRune(uint8 index, uint8 newType) void Player::ConvertRune(uint8 index, uint8 newType)

View file

@ -135,11 +135,12 @@ enum ActionButtonUpdateState
enum ActionButtonType enum ActionButtonType
{ {
ACTION_BUTTON_SPELL = 0, ACTION_BUTTON_SPELL = 0x00,
ACTION_BUTTON_EQSET = 32, ACTION_BUTTON_C = 0x01, // click?
ACTION_BUTTON_MACRO = 64, ACTION_BUTTON_EQSET = 0x20,
ACTION_BUTTON_CMACRO= 65, ACTION_BUTTON_MACRO = 0x40,
ACTION_BUTTON_ITEM = 128 ACTION_BUTTON_CMACRO = ACTION_BUTTON_C | ACTION_BUTTON_MACRO,
ACTION_BUTTON_ITEM = 0x80
}; };
#define ACTION_BUTTON_ACTION(X) (uint32(X) & 0x00FFFFFF) #define ACTION_BUTTON_ACTION(X) (uint32(X) & 0x00FFFFFF)
@ -168,7 +169,7 @@ struct ActionButton
} }
}; };
#define MAX_ACTION_BUTTONS 132 //checked in 2.3.0 #define MAX_ACTION_BUTTONS 144 //checked in 2.3.0
typedef std::map<uint8,ActionButton> ActionButtonList; typedef std::map<uint8,ActionButton> ActionButtonList;
@ -1685,7 +1686,7 @@ class MANGOS_DLL_SPEC Player : public Unit
void SetSession(WorldSession *s) { m_session = s; } void SetSession(WorldSession *s) { m_session = s; }
void BuildCreateUpdateBlockForPlayer( UpdateData *data, Player *target ) const; void BuildCreateUpdateBlockForPlayer( UpdateData *data, Player *target ) const;
void DestroyForPlayer( Player *target ) const; void DestroyForPlayer( Player *target, bool anim = false ) const;
void SendDelayResponse(const uint32); void SendDelayResponse(const uint32);
void SendLogXPGain(uint32 GivenXP,Unit* victim,uint32 RestXP); void SendLogXPGain(uint32 GivenXP,Unit* victim,uint32 RestXP);
@ -1695,7 +1696,7 @@ class MANGOS_DLL_SPEC Player : public Unit
void SendAttackSwingDeadTarget(); void SendAttackSwingDeadTarget();
void SendAttackSwingNotInRange(); void SendAttackSwingNotInRange();
void SendAttackSwingBadFacingAttack(); void SendAttackSwingBadFacingAttack();
void SendAutoRepeatCancel(); void SendAutoRepeatCancel(Unit *target);
void SendExplorationExperience(uint32 Area, uint32 Experience); void SendExplorationExperience(uint32 Area, uint32 Experience);
void SendDungeonDifficulty(bool IsInGroup); void SendDungeonDifficulty(bool IsInGroup);
@ -2172,7 +2173,7 @@ class MANGOS_DLL_SPEC Player : public Unit
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1=0, uint32 miscvalue2=0, Unit *unit=NULL, uint32 time=0); void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1=0, uint32 miscvalue2=0, Unit *unit=NULL, uint32 time=0);
bool HasTitle(uint32 bitIndex); bool HasTitle(uint32 bitIndex);
bool HasTitle(CharTitlesEntry const* title) { return HasTitle(title->bit_index); } bool HasTitle(CharTitlesEntry const* title) { return HasTitle(title->bit_index); }
void SetTitle(CharTitlesEntry const* title); void SetTitle(CharTitlesEntry const* title, bool lost = false);
bool isActiveObject() const { return true; } bool isActiveObject() const { return true; }
bool canSeeSpellClickOn(Creature const* creature) const; bool canSeeSpellClickOn(Creature const* creature) const;

View file

@ -823,10 +823,6 @@ void Spell::EffectDummy(uint32 i)
DEBUG_LOG("AddObject at SpellEfects.cpp EffectDummy"); DEBUG_LOG("AddObject at SpellEfects.cpp EffectDummy");
map->Add(pGameObj); map->Add(pGameObj);
WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
data << uint64(pGameObj->GetGUID());
m_caster->SendMessageToSet(&data, true);
return; return;
} }
case 23074: // Arcanite Dragonling case 23074: // Arcanite Dragonling
@ -5699,9 +5695,6 @@ void Spell::EffectSummonObject(uint32 i)
m_caster->AddGameObject(pGameObj); m_caster->AddGameObject(pGameObj);
map->Add(pGameObj); map->Add(pGameObj);
WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
data << uint64(pGameObj->GetGUID());
m_caster->SendMessageToSet(&data, true);
m_caster->m_ObjectSlot[slot] = pGameObj->GetGUID(); m_caster->m_ObjectSlot[slot] = pGameObj->GetGUID();
} }
@ -6313,16 +6306,14 @@ void Spell::EffectTransmitted(uint32 effIndex)
case GAMEOBJECT_TYPE_FISHINGHOLE: case GAMEOBJECT_TYPE_FISHINGHOLE:
case GAMEOBJECT_TYPE_CHEST: case GAMEOBJECT_TYPE_CHEST:
default: default:
{
break; break;
}
} }
pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0); pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
pGameObj->SetOwnerGUID(m_caster->GetGUID() ); pGameObj->SetOwnerGUID(m_caster->GetGUID());
pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel() ); pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel());
pGameObj->SetSpellId(m_spellInfo->Id); pGameObj->SetSpellId(m_spellInfo->Id);
DEBUG_LOG("AddObject at SpellEfects.cpp EffectTransmitted"); DEBUG_LOG("AddObject at SpellEfects.cpp EffectTransmitted");
@ -6331,10 +6322,6 @@ void Spell::EffectTransmitted(uint32 effIndex)
cMap->Add(pGameObj); cMap->Add(pGameObj);
WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
data << uint64(pGameObj->GetGUID());
m_caster->SendMessageToSet(&data,true);
if(uint32 linkedEntry = pGameObj->GetLinkedGameObjectEntry()) if(uint32 linkedEntry = pGameObj->GetLinkedGameObjectEntry())
{ {
GameObject* linkedGO = new GameObject; GameObject* linkedGO = new GameObject;
@ -6342,9 +6329,9 @@ void Spell::EffectTransmitted(uint32 effIndex)
m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY)) m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
{ {
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0); linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
linkedGO->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel() ); linkedGO->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel());
linkedGO->SetSpellId(m_spellInfo->Id); linkedGO->SetSpellId(m_spellInfo->Id);
linkedGO->SetOwnerGUID(m_caster->GetGUID() ); linkedGO->SetOwnerGUID(m_caster->GetGUID());
linkedGO->GetMap()->Add(linkedGO); linkedGO->GetMap()->Add(linkedGO);
} }

View file

@ -53,49 +53,45 @@ void Totem::Update( uint32 time )
void Totem::Summon(Unit* owner) void Totem::Summon(Unit* owner)
{ {
sLog.outDebug("AddObject at Totem.cpp line 49");
SetInstanceId(owner->GetInstanceId()); SetInstanceId(owner->GetInstanceId());
owner->GetMap()->Add((Creature*)this); owner->GetMap()->Add((Creature*)this);
// select totem model in dependent from owner team // select totem model in dependent from owner team
CreatureInfo const *cinfo = GetCreatureInfo(); CreatureInfo const *cinfo = GetCreatureInfo();
if(owner->GetTypeId()==TYPEID_PLAYER && cinfo) if(owner->GetTypeId() == TYPEID_PLAYER && cinfo)
{ {
uint32 display_id = objmgr.ChooseDisplayId(((Player*)owner)->GetTeam(),cinfo); uint32 display_id = objmgr.ChooseDisplayId(((Player*)owner)->GetTeam(), cinfo);
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id); CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
if (minfo) if (minfo)
display_id = minfo->modelid; display_id = minfo->modelid;
SetDisplayId(display_id); SetDisplayId(display_id);
} }
WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
data << GetGUID();
SendMessageToSet(&data,true);
AIM_Initialize(); AIM_Initialize();
switch(m_type) switch(m_type)
{ {
case TOTEM_PASSIVE: CastSpell(this, GetSpell(), true); break; case TOTEM_PASSIVE:
case TOTEM_STATUE: CastSpell(GetOwner(), GetSpell(), true); break; CastSpell(this, GetSpell(), true);
break;
case TOTEM_STATUE:
CastSpell(GetOwner(), GetSpell(), true);
break;
default: break; default: break;
} }
} }
void Totem::UnSummon() void Totem::UnSummon()
{ {
SendObjectDeSpawnAnim(GetGUID());
CombatStop(); CombatStop();
RemoveAurasDueToSpell(GetSpell()); RemoveAurasDueToSpell(GetSpell());
Unit *owner = GetOwner(); Unit *owner = GetOwner();
if (owner) if (owner)
{ {
// clear owenr's totem slot // clear owner's totem slot
for(int i = 0; i < MAX_TOTEM; ++i) for(int i = 0; i < MAX_TOTEM; ++i)
{ {
if(owner->m_TotemSlot[i]==GetGUID()) if(owner->m_TotemSlot[i] == GetGUID())
{ {
owner->m_TotemSlot[i] = 0; owner->m_TotemSlot[i] = 0;
break; break;
@ -105,11 +101,12 @@ void Totem::UnSummon()
owner->RemoveAurasDueToSpell(GetSpell()); owner->RemoveAurasDueToSpell(GetSpell());
//remove aura all party members too //remove aura all party members too
Group *pGroup = NULL;
if (owner->GetTypeId() == TYPEID_PLAYER) if (owner->GetTypeId() == TYPEID_PLAYER)
{ {
((Player*)owner)->SendAutoRepeatCancel(this);
// Not only the player can summon the totem (scripted AI) // Not only the player can summon the totem (scripted AI)
pGroup = ((Player*)owner)->GetGroup(); Group *pGroup = ((Player*)owner)->GetGroup();
if (pGroup) if (pGroup)
{ {
for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
@ -154,13 +151,13 @@ void Totem::SetTypeBySummonSpell(SpellEntry const * spellProto)
if (GetSpellCastTime(totemSpell)) if (GetSpellCastTime(totemSpell))
m_type = TOTEM_ACTIVE; m_type = TOTEM_ACTIVE;
} }
if(spellProto->SpellIconID==2056) if(spellProto->SpellIconID == 2056)
m_type = TOTEM_STATUE; //Jewelery statue m_type = TOTEM_STATUE; //Jewelery statue
} }
bool Totem::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const bool Totem::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const
{ {
// TODO: possibly all negative auras immuned? // TODO: possibly all negative auras immune?
switch(spellInfo->EffectApplyAuraName[index]) switch(spellInfo->EffectApplyAuraName[index])
{ {
case SPELL_AURA_PERIODIC_DAMAGE: case SPELL_AURA_PERIODIC_DAMAGE:

View file

@ -3138,8 +3138,8 @@ void Unit::InterruptSpell(uint32 spellType, bool withDelayed)
// send autorepeat cancel message for autorepeat spells // send autorepeat cancel message for autorepeat spells
if (spellType == CURRENT_AUTOREPEAT_SPELL) if (spellType == CURRENT_AUTOREPEAT_SPELL)
{ {
if(GetTypeId()==TYPEID_PLAYER) if(GetTypeId() == TYPEID_PLAYER)
((Player*)this)->SendAutoRepeatCancel(); ((Player*)this)->SendAutoRepeatCancel(this);
} }
if (m_currentSpells[spellType]->getState() != SPELL_STATE_FINISHED) if (m_currentSpells[spellType]->getState() != SPELL_STATE_FINISHED)