mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Fixed MSG_CORPSE_QUERY for dungeons/raids, fixed SMSG_ATTACKERSTATEUPDATE
This commit is contained in:
parent
8a29415450
commit
5ca92eddd7
9 changed files with 96 additions and 48 deletions
|
|
@ -219,6 +219,17 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
|
||||||
bool IsBattleGround() const { return i_mapEntry && i_mapEntry->IsBattleGround(); }
|
bool IsBattleGround() const { return i_mapEntry && i_mapEntry->IsBattleGround(); }
|
||||||
bool IsBattleArena() const { return i_mapEntry && i_mapEntry->IsBattleArena(); }
|
bool IsBattleArena() const { return i_mapEntry && i_mapEntry->IsBattleArena(); }
|
||||||
bool IsBattleGroundOrArena() const { return i_mapEntry && i_mapEntry->IsBattleGroundOrArena(); }
|
bool IsBattleGroundOrArena() const { return i_mapEntry && i_mapEntry->IsBattleGroundOrArena(); }
|
||||||
|
bool GetEntrancePos(int32 &mapid, float &x, float &y)
|
||||||
|
{
|
||||||
|
if(!i_mapEntry)
|
||||||
|
return false;
|
||||||
|
if(i_mapEntry->entrance_map < 0)
|
||||||
|
return false;
|
||||||
|
mapid = i_mapEntry->entrance_map;
|
||||||
|
x = i_mapEntry->entrance_x;
|
||||||
|
y = i_mapEntry->entrance_y;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void AddObjectToRemoveList(WorldObject *obj);
|
void AddObjectToRemoveList(WorldObject *obj);
|
||||||
void DoDelayedMovesAndRemoves();
|
void DoDelayedMovesAndRemoves();
|
||||||
|
|
|
||||||
|
|
@ -5020,7 +5020,7 @@ AreaTrigger const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
|
||||||
if(!mapEntry) return NULL;
|
if(!mapEntry) return NULL;
|
||||||
for (AreaTriggerMap::const_iterator itr = mAreaTriggers.begin(); itr != mAreaTriggers.end(); itr++)
|
for (AreaTriggerMap::const_iterator itr = mAreaTriggers.begin(); itr != mAreaTriggers.end(); itr++)
|
||||||
{
|
{
|
||||||
if(itr->second.target_mapId == mapEntry->parent_map)
|
if(itr->second.target_mapId == mapEntry->entrance_map)
|
||||||
{
|
{
|
||||||
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first);
|
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first);
|
||||||
if(atEntry && atEntry->mapid == Map)
|
if(atEntry && atEntry->mapid == Map)
|
||||||
|
|
|
||||||
|
|
@ -1123,7 +1123,7 @@ enum Opcodes
|
||||||
SMSG_CALENDAR_EVENT_UPDATED_ALERT = 0x444,
|
SMSG_CALENDAR_EVENT_UPDATED_ALERT = 0x444,
|
||||||
SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT = 0x445,
|
SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT = 0x445,
|
||||||
CMSG_CALENDAR_COMPLAIN = 0x446,
|
CMSG_CALENDAR_COMPLAIN = 0x446,
|
||||||
SMSG_CALENDAR_EVENT_RESERVED_2 = 0x447,
|
SMSG_CALENDAR_EVENT_RESERVED_2 = 0x447, // CMSG_CALENDAR_GET_CALENDAR in 9155
|
||||||
SMSG_CALENDAR_EVENT_RESERVED_3 = 0x448,
|
SMSG_CALENDAR_EVENT_RESERVED_3 = 0x448,
|
||||||
CMSG_SAVE_DANCE = 0x449,
|
CMSG_SAVE_DANCE = 0x449,
|
||||||
SMSG_NOTIFY_DANCE = 0x44A,
|
SMSG_NOTIFY_DANCE = 0x44A,
|
||||||
|
|
|
||||||
|
|
@ -3598,6 +3598,10 @@ void Player::SetMovement(PlayerMovementType pType)
|
||||||
*/
|
*/
|
||||||
void Player::BuildPlayerRepop()
|
void Player::BuildPlayerRepop()
|
||||||
{
|
{
|
||||||
|
WorldPacket data(SMSG_PRE_RESURRECT, GetPackGUID().size());
|
||||||
|
data.append(GetPackGUID());
|
||||||
|
GetSession()->SendPacket(&data);
|
||||||
|
|
||||||
if(getRace() == RACE_NIGHTELF)
|
if(getRace() == RACE_NIGHTELF)
|
||||||
CastSpell(this, 20584, true); // auras SPELL_AURA_INCREASE_SPEED(+speed in wisp form), SPELL_AURA_INCREASE_SWIM_SPEED(+swim speed in wisp form), SPELL_AURA_TRANSFORM (to wisp form)
|
CastSpell(this, 20584, true); // auras SPELL_AURA_INCREASE_SPEED(+speed in wisp form), SPELL_AURA_INCREASE_SWIM_SPEED(+swim speed in wisp form), SPELL_AURA_TRANSFORM (to wisp form)
|
||||||
CastSpell(this, 8326, true); // auras SPELL_AURA_GHOST, SPELL_AURA_INCREASE_SPEED(why?), SPELL_AURA_INCREASE_SWIM_SPEED(why?)
|
CastSpell(this, 8326, true); // auras SPELL_AURA_GHOST, SPELL_AURA_INCREASE_SPEED(why?), SPELL_AURA_INCREASE_SWIM_SPEED(why?)
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
#include "NPCHandler.h"
|
#include "NPCHandler.h"
|
||||||
#include "ObjectAccessor.h"
|
#include "ObjectAccessor.h"
|
||||||
#include "Pet.h"
|
#include "Pet.h"
|
||||||
|
#include "MapManager.h"
|
||||||
|
|
||||||
void WorldSession::SendNameQueryOpcode(Player *p)
|
void WorldSession::SendNameQueryOpcode(Player *p)
|
||||||
{
|
{
|
||||||
|
|
@ -272,19 +273,42 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/)
|
||||||
|
|
||||||
Corpse *corpse = GetPlayer()->GetCorpse();
|
Corpse *corpse = GetPlayer()->GetCorpse();
|
||||||
|
|
||||||
uint8 found = 1;
|
uint8 found = corpse ? 1 : 0;
|
||||||
if(!corpse)
|
|
||||||
found = 0;
|
int32 mapid = corpse->GetMapId();
|
||||||
|
float x = corpse->GetPositionX();
|
||||||
|
float y = corpse->GetPositionY();
|
||||||
|
float z = corpse->GetPositionZ();
|
||||||
|
int32 corpsemapid = _player->GetMapId();
|
||||||
|
|
||||||
|
if(found)
|
||||||
|
{
|
||||||
|
if(Map *map = corpse->GetMap())
|
||||||
|
{
|
||||||
|
if(map->IsDungeon())
|
||||||
|
{
|
||||||
|
if(!map->GetEntrancePos(mapid, x, y))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Map *entrance_map = MapManager::Instance().GetMap(mapid, _player);
|
||||||
|
if(!entrance_map)
|
||||||
|
return;
|
||||||
|
|
||||||
|
z = entrance_map->GetHeight(x, y, MAX_HEIGHT);
|
||||||
|
corpsemapid = corpse->GetMapId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
WorldPacket data(MSG_CORPSE_QUERY, (1+found*(5*4)));
|
WorldPacket data(MSG_CORPSE_QUERY, (1+found*(5*4)));
|
||||||
data << uint8(found);
|
data << uint8(found);
|
||||||
if(found)
|
if(found)
|
||||||
{
|
{
|
||||||
data << corpse->GetMapId();
|
data << int32(mapid);
|
||||||
data << corpse->GetPositionX();
|
data << float(x);
|
||||||
data << corpse->GetPositionY();
|
data << float(y);
|
||||||
data << corpse->GetPositionZ();
|
data << float(z);
|
||||||
data << _player->GetMapId();
|
data << int32(corpsemapid);
|
||||||
}
|
}
|
||||||
SendPacket(&data);
|
SendPacket(&data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1791,9 +1791,7 @@ void Unit::DoAttackDamage (Unit *pVictim, uint32 *damage, CleanDamage *cleanDama
|
||||||
case MELEE_HIT_BLOCK_CRIT:
|
case MELEE_HIT_BLOCK_CRIT:
|
||||||
case MELEE_HIT_CRIT:
|
case MELEE_HIT_CRIT:
|
||||||
{
|
{
|
||||||
//*hitInfo = 0xEA;
|
*hitInfo = HITINFO_CRITICALHIT | HITINFO_NORMALSWING2 | HITINFO_UNK2;
|
||||||
// 0xEA
|
|
||||||
*hitInfo = HITINFO_CRITICALHIT | HITINFO_NORMALSWING2 | 0x8;
|
|
||||||
|
|
||||||
// Crit bonus calc
|
// Crit bonus calc
|
||||||
uint32 crit_bonus;
|
uint32 crit_bonus;
|
||||||
|
|
@ -4377,11 +4375,11 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit *target, uint8 SwingType,
|
||||||
sLog.outDebug("WORLD: Sending SMSG_ATTACKERSTATEUPDATE");
|
sLog.outDebug("WORLD: Sending SMSG_ATTACKERSTATEUPDATE");
|
||||||
|
|
||||||
WorldPacket data(SMSG_ATTACKERSTATEUPDATE, (16+45)); // we guess size
|
WorldPacket data(SMSG_ATTACKERSTATEUPDATE, (16+45)); // we guess size
|
||||||
data << (uint32)HitInfo;
|
data << uint32(HitInfo); // flags
|
||||||
data.append(GetPackGUID());
|
data.append(GetPackGUID());
|
||||||
data.append(target->GetPackGUID());
|
data.append(target->GetPackGUID());
|
||||||
data << uint32(Damage-AbsorbDamage-Resist-BlockedAmount);
|
data << uint32(Damage-AbsorbDamage-Resist-BlockedAmount);// damage
|
||||||
data << uint32(0); // WotLK
|
data << uint32(0); // overkill value
|
||||||
|
|
||||||
data << (uint8)SwingType; // count?
|
data << (uint8)SwingType; // count?
|
||||||
|
|
||||||
|
|
@ -4391,17 +4389,17 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit *target, uint8 SwingType,
|
||||||
data << (uint32)(Damage-AbsorbDamage-Resist-BlockedAmount);
|
data << (uint32)(Damage-AbsorbDamage-Resist-BlockedAmount);
|
||||||
// end loop
|
// end loop
|
||||||
|
|
||||||
if(HitInfo & (HITINFO_RESIST | HITINFO_ABSORB))
|
if(HitInfo & (HITINFO_ABSORB | HITINFO_ABSORB2))
|
||||||
{
|
{
|
||||||
// for(i = 0; i < SwingType; ++i)
|
// for(i = 0; i < SwingType; ++i)
|
||||||
data << (uint32)Resist;
|
data << uint32(AbsorbDamage);
|
||||||
// end loop
|
// end loop
|
||||||
}
|
}
|
||||||
|
|
||||||
if(HitInfo & (HITINFO_CRITICALHIT | HITINFO_UNK2))
|
if(HitInfo & (HITINFO_RESIST | HITINFO_RESIST2))
|
||||||
{
|
{
|
||||||
// for(i = 0; i < SwingType; ++i)
|
// for(i = 0; i < SwingType; ++i)
|
||||||
data << uint32(0); // what is it?
|
data << uint32(Resist);
|
||||||
// end loop
|
// end loop
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4409,17 +4407,17 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit *target, uint8 SwingType,
|
||||||
data << (uint32)0;
|
data << (uint32)0;
|
||||||
data << (uint32)0;
|
data << (uint32)0;
|
||||||
|
|
||||||
|
if(HitInfo & HITINFO_BLOCK)
|
||||||
|
{
|
||||||
|
data << uint32(BlockedAmount);
|
||||||
|
}
|
||||||
|
|
||||||
if(HitInfo & HITINFO_UNK3)
|
if(HitInfo & HITINFO_UNK3)
|
||||||
{
|
{
|
||||||
data << uint32(0);
|
data << uint32(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if(unknown & HitInfo)
|
if(HitInfo & HITINFO_UNK1)
|
||||||
{
|
|
||||||
data << uint32(0);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*if(HitInfo & HITINFO_UNK1)
|
|
||||||
{
|
{
|
||||||
data << uint32(0);
|
data << uint32(0);
|
||||||
data << float(0);
|
data << float(0);
|
||||||
|
|
@ -4436,7 +4434,7 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit *target, uint8 SwingType,
|
||||||
data << float(0);
|
data << float(0);
|
||||||
}
|
}
|
||||||
data << uint32(0);
|
data << uint32(0);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
SendMessageToSet( &data, true );
|
SendMessageToSet( &data, true );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -208,16 +208,27 @@ enum HitInfo
|
||||||
HITINFO_UNK1 = 0x00000001, // req correct packet structure
|
HITINFO_UNK1 = 0x00000001, // req correct packet structure
|
||||||
HITINFO_NORMALSWING2 = 0x00000002,
|
HITINFO_NORMALSWING2 = 0x00000002,
|
||||||
HITINFO_LEFTSWING = 0x00000004,
|
HITINFO_LEFTSWING = 0x00000004,
|
||||||
|
HITINFO_UNK2 = 0x00000008,
|
||||||
HITINFO_MISS = 0x00000010,
|
HITINFO_MISS = 0x00000010,
|
||||||
HITINFO_ABSORB = 0x00000020, // plays absorb sound
|
HITINFO_ABSORB = 0x00000020, // absorbed damage
|
||||||
HITINFO_RESIST = 0x00000040, // resisted atleast some damage
|
HITINFO_ABSORB2 = 0x00000040, // absorbed damage
|
||||||
HITINFO_CRITICALHIT = 0x00000080,
|
HITINFO_RESIST = 0x00000080, // resisted atleast some damage
|
||||||
HITINFO_UNK2 = 0x00000100, // wotlk?
|
HITINFO_RESIST2 = 0x00000100, // resisted atleast some damage
|
||||||
HITINFO_UNK3 = 0x00002000, // wotlk?
|
HITINFO_CRITICALHIT = 0x00000200, // critical hit
|
||||||
HITINFO_GLANCING = 0x00004000,
|
// 0x00000400
|
||||||
HITINFO_CRUSHING = 0x00008000,
|
// 0x00000800
|
||||||
HITINFO_NOACTION = 0x00010000,
|
// 0x00001000
|
||||||
HITINFO_SWINGNOHITSOUND = 0x00080000
|
HITINFO_BLOCK = 0x00002000, // blocked damage
|
||||||
|
// 0x00004000
|
||||||
|
// 0x00008000
|
||||||
|
HITINFO_GLANCING = 0x00010000,
|
||||||
|
HITINFO_CRUSHING = 0x00020000,
|
||||||
|
HITINFO_NOACTION = 0x00040000, // guessed
|
||||||
|
// 0x00080000
|
||||||
|
// 0x00100000
|
||||||
|
HITINFO_SWINGNOHITSOUND = 0x00200000, // guessed
|
||||||
|
// 0x00400000
|
||||||
|
HITINFO_UNK3 = 0x00800000
|
||||||
};
|
};
|
||||||
|
|
||||||
//i would like to remove this: (it is defined in item.h
|
//i would like to remove this: (it is defined in item.h
|
||||||
|
|
|
||||||
|
|
@ -860,18 +860,18 @@ struct MailTemplateEntry
|
||||||
|
|
||||||
struct MapEntry
|
struct MapEntry
|
||||||
{
|
{
|
||||||
uint32 MapID; // 0
|
uint32 MapID; // 0
|
||||||
//char* internalname; // 1 unused
|
//char* internalname; // 1 unused
|
||||||
uint32 map_type; // 2
|
uint32 map_type; // 2
|
||||||
// 3 0 or 1 for battlegrounds (not arenas)
|
// 3 0 or 1 for battlegrounds (not arenas)
|
||||||
char* name[16]; // 4-19
|
char* name[16]; // 4-19
|
||||||
// 20 name flags, unused
|
// 20 name flags, unused
|
||||||
uint32 linked_zone; // 21 common zone for instance and continent map
|
uint32 linked_zone; // 21 common zone for instance and continent map
|
||||||
//char* hordeIntro[16]; // 23-37 text for PvP Zones
|
//char* hordeIntro[16]; // 23-37 text for PvP Zones
|
||||||
// 38 intro text flags
|
// 38 intro text flags
|
||||||
//char* allianceIntro[16]; // 39-54 text for PvP Zones
|
//char* allianceIntro[16]; // 39-54 text for PvP Zones
|
||||||
// 55 intro text flags
|
// 55 intro text flags
|
||||||
uint32 multimap_id; // 56
|
uint32 multimap_id; // 56
|
||||||
// 57
|
// 57
|
||||||
//chat* unknownText1[16]; // 58-73 unknown empty text fields, possible normal Intro text.
|
//chat* unknownText1[16]; // 58-73 unknown empty text fields, possible normal Intro text.
|
||||||
// 74 text flags
|
// 74 text flags
|
||||||
|
|
@ -879,14 +879,14 @@ struct MapEntry
|
||||||
// 91 text flags
|
// 91 text flags
|
||||||
//chat* unknownText2[16]; // 92-107 unknown empty text fields
|
//chat* unknownText2[16]; // 92-107 unknown empty text fields
|
||||||
// 108 text flags
|
// 108 text flags
|
||||||
int32 parent_map; // 109 map_id of parent map
|
int32 entrance_map; // 109 map_id of entrance map
|
||||||
//float start_x // 110 enter x coordinate (if exist single entry)
|
float entrance_x; // 110 entrance x coordinate (if exist single entry)
|
||||||
//float start_y // 111 enter y coordinate (if exist single entry)
|
float entrance_y; // 111 entrance y coordinate (if exist single entry)
|
||||||
uint32 resetTimeRaid; // 112
|
uint32 resetTimeRaid; // 112
|
||||||
uint32 resetTimeHeroic; // 113
|
uint32 resetTimeHeroic; // 113
|
||||||
// 114 all 0
|
// 114 all 0
|
||||||
// 115 -1, 0 and 720
|
// 115 -1, 0 and 720
|
||||||
uint32 addon; // 116 (0-original maps,1-tbc addon)
|
uint32 addon; // 116 (0-original maps,1-tbc addon)
|
||||||
// 117 some kind of time?
|
// 117 some kind of time?
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ const char ItemRandomSuffixfmt[]="nxxxxxxxxxxxxxxxxxxiiiiiiiiii";
|
||||||
const char ItemSetEntryfmt[]="dssssssssssssssssxxxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiiiii";
|
const char ItemSetEntryfmt[]="dssssssssssssssssxxxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiiiii";
|
||||||
const char LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx";
|
const char LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx";
|
||||||
const char MailTemplateEntryfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
const char MailTemplateEntryfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||||
const char MapEntryfmt[]="nxixssssssssssssssssxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixxiixxix";
|
const char MapEntryfmt[]="nxixssssssssssssssssxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiffiixxix";
|
||||||
const char QuestSortEntryfmt[]="nxxxxxxxxxxxxxxxxx";
|
const char QuestSortEntryfmt[]="nxxxxxxxxxxxxxxxxx";
|
||||||
const char RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii";
|
const char RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii";
|
||||||
const char ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiii";
|
const char ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiii";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue