mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
Merge branch 'master' into 303
I hope it merged correctly... Conflicts: contrib/extractor/ad.exe src/game/MovementHandler.cpp src/game/Player.h
This commit is contained in:
commit
db64bf6b80
9 changed files with 47 additions and 91 deletions
|
|
@ -209,7 +209,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
|
||||||
|
|
||||||
if(ban && !IsBanned(bad->GetGUID()))
|
if(ban && !IsBanned(bad->GetGUID()))
|
||||||
{
|
{
|
||||||
banned.push_back(bad->GetGUID());
|
banned.insert(bad->GetGUID());
|
||||||
MakePlayerBanned(&data, bad->GetGUID(), good);
|
MakePlayerBanned(&data, bad->GetGUID(), good);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -258,7 +258,7 @@ void Channel::UnBan(uint64 good, const char *badname)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
banned.remove(bad->GetGUID());
|
banned.erase(bad->GetGUID());
|
||||||
|
|
||||||
WorldPacket data;
|
WorldPacket data;
|
||||||
MakePlayerUnbanned(&data, bad->GetGUID(), good);
|
MakePlayerUnbanned(&data, bad->GetGUID(), good);
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ class Channel
|
||||||
|
|
||||||
typedef std::map<uint64, PlayerInfo> PlayerList;
|
typedef std::map<uint64, PlayerInfo> PlayerList;
|
||||||
PlayerList players;
|
PlayerList players;
|
||||||
typedef std::list<uint64> BannedList;
|
typedef std::set<uint64> BannedList;
|
||||||
BannedList banned;
|
BannedList banned;
|
||||||
bool m_announce;
|
bool m_announce;
|
||||||
bool m_moderate;
|
bool m_moderate;
|
||||||
|
|
@ -202,15 +202,9 @@ class Channel
|
||||||
void SendToAllButOne(WorldPacket *data, uint64 who);
|
void SendToAllButOne(WorldPacket *data, uint64 who);
|
||||||
void SendToOne(WorldPacket *data, uint64 who);
|
void SendToOne(WorldPacket *data, uint64 who);
|
||||||
|
|
||||||
bool IsOn(uint64 who) const { return players.count(who) > 0; }
|
bool IsOn(uint64 who) const { return players.count(who) != 0; }
|
||||||
|
|
||||||
bool IsBanned(const uint64 guid) const
|
bool IsBanned(const uint64 guid) const {return banned.count(guid) != 0; }
|
||||||
{
|
|
||||||
for(BannedList::const_iterator i = banned.begin(); i != banned.end(); ++i)
|
|
||||||
if(*i == guid)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsFirst() const { return !(players.size() > 1); }
|
bool IsFirst() const { return !(players.size() > 1); }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -925,23 +925,8 @@ void WorldSession::HandleChangePlayerNameOpcode(WorldPacket& recv_data)
|
||||||
recv_data >> guid;
|
recv_data >> guid;
|
||||||
recv_data >> newname;
|
recv_data >> newname;
|
||||||
|
|
||||||
QueryResult *result = CharacterDatabase.PQuery("SELECT at_login FROM characters WHERE guid ='%u'", GUID_LOPART(guid));
|
QueryResult *result = CharacterDatabase.PQuery("SELECT at_login, name FROM characters WHERE guid ='%u'", GUID_LOPART(guid));
|
||||||
if (result)
|
if (!result)
|
||||||
{
|
|
||||||
uint32 at_loginFlags;
|
|
||||||
Field *fields = result->Fetch();
|
|
||||||
at_loginFlags = fields[0].GetUInt32();
|
|
||||||
delete result;
|
|
||||||
|
|
||||||
if (!(at_loginFlags & AT_LOGIN_RENAME))
|
|
||||||
{
|
|
||||||
WorldPacket data(SMSG_CHAR_RENAME, 1);
|
|
||||||
data << (uint8)CHAR_CREATE_ERROR;
|
|
||||||
SendPacket( &data );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_CHAR_RENAME, 1);
|
WorldPacket data(SMSG_CHAR_RENAME, 1);
|
||||||
data << (uint8)CHAR_CREATE_ERROR;
|
data << (uint8)CHAR_CREATE_ERROR;
|
||||||
|
|
@ -949,10 +934,16 @@ void WorldSession::HandleChangePlayerNameOpcode(WorldPacket& recv_data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!objmgr.GetPlayerNameByGUID(guid, oldname)) // character not exist, because we have no name for this guid
|
uint32 at_loginFlags;
|
||||||
|
Field *fields = result->Fetch();
|
||||||
|
at_loginFlags = fields[0].GetUInt32();
|
||||||
|
oldname = fields[1].GetCppString();
|
||||||
|
delete result;
|
||||||
|
|
||||||
|
if (!(at_loginFlags & AT_LOGIN_RENAME))
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_CHAR_RENAME, 1);
|
WorldPacket data(SMSG_CHAR_RENAME, 1);
|
||||||
data << (uint8)CHAR_LOGIN_NO_CHARACTER;
|
data << (uint8)CHAR_CREATE_ERROR;
|
||||||
SendPacket( &data );
|
SendPacket( &data );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -929,44 +929,7 @@ void Creature::OnPoiSelect(Player* player, GossipOption const *gossip)
|
||||||
{
|
{
|
||||||
if(gossip->GossipId==GOSSIP_GUARD_SPELLTRAINER || gossip->GossipId==GOSSIP_GUARD_SKILLTRAINER)
|
if(gossip->GossipId==GOSSIP_GUARD_SPELLTRAINER || gossip->GossipId==GOSSIP_GUARD_SKILLTRAINER)
|
||||||
{
|
{
|
||||||
//float x,y;
|
|
||||||
//bool findnpc=false;
|
|
||||||
Poi_Icon icon = ICON_POI_0;
|
Poi_Icon icon = ICON_POI_0;
|
||||||
//QueryResult *result;
|
|
||||||
//Field *fields;
|
|
||||||
uint32 mapid=GetMapId();
|
|
||||||
Map const* map=MapManager::Instance().GetBaseMap( mapid );
|
|
||||||
uint16 areaflag=map->GetAreaFlag(GetPositionX(),GetPositionY());
|
|
||||||
uint32 zoneid=Map::GetZoneId(areaflag,mapid);
|
|
||||||
std::string areaname= gossip->OptionText;
|
|
||||||
/*
|
|
||||||
uint16 pflag;
|
|
||||||
|
|
||||||
// use the action relate to creaturetemplate.trainer_type ?
|
|
||||||
result= WorldDatabase.PQuery("SELECT creature.position_x,creature.position_y FROM creature,creature_template WHERE creature.map = '%u' AND creature.id = creature_template.entry AND creature_template.trainer_type = '%u'", mapid, gossip->Action );
|
|
||||||
if(!result)
|
|
||||||
return;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
fields = result->Fetch();
|
|
||||||
x=fields[0].GetFloat();
|
|
||||||
y=fields[1].GetFloat();
|
|
||||||
pflag=map->GetAreaFlag(GetPositionX(),GetPositionY());
|
|
||||||
if(pflag==areaflag)
|
|
||||||
{
|
|
||||||
findnpc=true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}while(result->NextRow());
|
|
||||||
|
|
||||||
delete result;
|
|
||||||
|
|
||||||
if(!findnpc)
|
|
||||||
{
|
|
||||||
player->PlayerTalkClass->SendTalking( "$NSorry", "Here no this person.");
|
|
||||||
return;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
//need add more case.
|
//need add more case.
|
||||||
switch(gossip->Action)
|
switch(gossip->Action)
|
||||||
{
|
{
|
||||||
|
|
@ -983,8 +946,9 @@ void Creature::OnPoiSelect(Player* player, GossipOption const *gossip)
|
||||||
icon=ICON_POI_TOWER;
|
icon=ICON_POI_TOWER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
uint32 textid=GetGossipTextId( gossip->Action, zoneid );
|
uint32 textid = GetGossipTextId( gossip->Action, GetZoneId() );
|
||||||
player->PlayerTalkClass->SendTalking( textid );
|
player->PlayerTalkClass->SendTalking(textid);
|
||||||
|
// std::string areaname= gossip->OptionText;
|
||||||
// how this could worked player->PlayerTalkClass->SendPointOfInterest( x, y, icon, 2, 15, areaname.c_str() );
|
// how this could worked player->PlayerTalkClass->SendPointOfInterest( x, y, icon, 2, 15, areaname.c_str() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -234,25 +234,24 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
|
||||||
if (opcode == MSG_MOVE_FALL_LAND && !GetPlayer()->isInFlight())
|
if (opcode == MSG_MOVE_FALL_LAND && !GetPlayer()->isInFlight())
|
||||||
{
|
{
|
||||||
// calculate total z distance of the fall
|
// calculate total z distance of the fall
|
||||||
// it is currently only used for the achievement system. It might be used in a more correct falldamage formula later
|
float z_diff = GetPlayer()->m_lastFallZ - movementInfo.z;
|
||||||
float z_diff = GetPlayer()->m_fallMovementInfo.z - movementInfo.z;
|
sLog.outDebug("zDiff = %f", z_diff);
|
||||||
sLog.outDebug("zDiff = %f, falltime = %u", z_diff, movementInfo.fallTime);
|
|
||||||
Player *target = GetPlayer();
|
Player *target = GetPlayer();
|
||||||
|
|
||||||
//Players with Feather Fall or low fall time, or physical immunity (charges used) are ignored
|
//Players with low fall distance, Feather Fall or physical immunity (charges used) are ignored
|
||||||
if (movementInfo.fallTime > 1300 && !target->isDead() && !target->isGameMaster() &&
|
// 14.57 can be calculated by resolving damageperc formular below to 0
|
||||||
|
if (z_diff >= 14.57f && !target->isDead() && !target->isGameMaster() &&
|
||||||
!target->HasAuraType(SPELL_AURA_HOVER) && !target->HasAuraType(SPELL_AURA_FEATHER_FALL) &&
|
!target->HasAuraType(SPELL_AURA_HOVER) && !target->HasAuraType(SPELL_AURA_FEATHER_FALL) &&
|
||||||
!target->HasAuraType(SPELL_AURA_FLY) && !target->IsImmunedToDamage(SPELL_SCHOOL_MASK_NORMAL,true) )
|
!target->HasAuraType(SPELL_AURA_FLY) && !target->IsImmunedToDamage(SPELL_SCHOOL_MASK_NORMAL,true) )
|
||||||
{
|
{
|
||||||
//Safe fall, fall time reduction
|
//Safe fall, fall height reduction
|
||||||
int32 safe_fall = target->GetTotalAuraModifier(SPELL_AURA_SAFE_FALL);
|
int32 safe_fall = target->GetTotalAuraModifier(SPELL_AURA_SAFE_FALL);
|
||||||
uint32 fall_time = (movementInfo.fallTime > (safe_fall*10)) ? movementInfo.fallTime - (safe_fall*10) : 0;
|
|
||||||
|
|
||||||
if(fall_time > 1300) //Prevent damage if fall time < 1300
|
float damageperc = 0.018f*(z_diff-safe_fall)-0.2426f;
|
||||||
|
|
||||||
|
if(damageperc >0 )
|
||||||
{
|
{
|
||||||
//Fall Damage calculation
|
uint32 damage = (uint32)(damageperc * target->GetMaxHealth()*sWorld.getRate(RATE_DAMAGE_FALL));
|
||||||
float fallperc = float(fall_time)/1300;
|
|
||||||
uint32 damage = (uint32)(((fallperc*fallperc -1) / 9 * target->GetMaxHealth())*sWorld.getRate(RATE_DAMAGE_FALL));
|
|
||||||
|
|
||||||
float height = movementInfo.z;
|
float height = movementInfo.z;
|
||||||
target->UpdateGroundPositionZ(movementInfo.x,movementInfo.y,height);
|
target->UpdateGroundPositionZ(movementInfo.x,movementInfo.y,height);
|
||||||
|
|
@ -286,8 +285,6 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
|
||||||
GetPlayer()->SetInWater( !GetPlayer()->IsInWater() || GetPlayer()->GetBaseMap()->IsUnderWater(movementInfo.x, movementInfo.y, movementInfo.z) );
|
GetPlayer()->SetInWater( !GetPlayer()->IsInWater() || GetPlayer()->GetBaseMap()->IsUnderWater(movementInfo.x, movementInfo.y, movementInfo.z) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if(opcode != MSG_MOVE_FALL_LAND && !(movementInfo.flags & MOVEMENTFLAG_FALLING))
|
|
||||||
_player->m_fallMovementInfo = movementInfo; // save data before any fall
|
|
||||||
/*----------------------*/
|
/*----------------------*/
|
||||||
|
|
||||||
/* process position-change */
|
/* process position-change */
|
||||||
|
|
@ -320,8 +317,11 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (GetPlayer()->m_fallMovementInfo.fallTime >= movementInfo.fallTime || GetPlayer()->m_fallMovementInfo.z <=movementInfo.z)
|
if (GetPlayer()->m_lastFallTime >= movementInfo.fallTime || GetPlayer()->m_lastFallZ <=movementInfo.z)
|
||||||
// GetPlayer()->m_fallMovementInfo = movementInfo;
|
{
|
||||||
|
GetPlayer()->m_lastFallTime = movementInfo.fallTime;
|
||||||
|
GetPlayer()->m_lastFallZ= movementInfo.z;
|
||||||
|
}
|
||||||
|
|
||||||
if(GetPlayer()->isMovingOrTurning())
|
if(GetPlayer()->isMovingOrTurning())
|
||||||
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
|
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
|
||||||
|
|
|
||||||
|
|
@ -1977,7 +1977,8 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
/*** VARIOUS SYSTEMS ***/
|
/*** VARIOUS SYSTEMS ***/
|
||||||
/*********************************************************/
|
/*********************************************************/
|
||||||
MovementInfo m_movementInfo;
|
MovementInfo m_movementInfo;
|
||||||
MovementInfo m_fallMovementInfo;
|
uint32 m_lastFallTime;
|
||||||
|
float m_lastFallZ;
|
||||||
Unit *m_mover;
|
Unit *m_mover;
|
||||||
bool isMoving() const { return HasUnitMovementFlag(movementFlagsMask); }
|
bool isMoving() const { return HasUnitMovementFlag(movementFlagsMask); }
|
||||||
bool isMovingOrTurning() const { return HasUnitMovementFlag(movementOrTurningFlagsMask); }
|
bool isMovingOrTurning() const { return HasUnitMovementFlag(movementOrTurningFlagsMask); }
|
||||||
|
|
|
||||||
|
|
@ -73,10 +73,8 @@ class MANGOS_DLL_SPEC WaypointMovementGenerator<Creature>
|
||||||
: public MovementGeneratorMedium< Creature, WaypointMovementGenerator<Creature> >,
|
: public MovementGeneratorMedium< Creature, WaypointMovementGenerator<Creature> >,
|
||||||
public PathMovementBase<Creature, WaypointPath*>
|
public PathMovementBase<Creature, WaypointPath*>
|
||||||
{
|
{
|
||||||
TimeTrackerSmall i_nextMoveTime;
|
|
||||||
std::vector<bool> i_hasDone;
|
|
||||||
public:
|
public:
|
||||||
WaypointMovementGenerator(Creature &) : i_nextMoveTime(0) {}
|
WaypointMovementGenerator(Creature &) : i_nextMoveTime(0), b_StopedByPlayer(false) {}
|
||||||
~WaypointMovementGenerator() { ClearWaypoints(); }
|
~WaypointMovementGenerator() { ClearWaypoints(); }
|
||||||
void Initialize(Creature &u)
|
void Initialize(Creature &u)
|
||||||
{
|
{
|
||||||
|
|
@ -85,7 +83,12 @@ public PathMovementBase<Creature, WaypointPath*>
|
||||||
LoadPath(u);
|
LoadPath(u);
|
||||||
}
|
}
|
||||||
void Finalize(Creature &) {}
|
void Finalize(Creature &) {}
|
||||||
void Reset(Creature &u) { ReloadPath(u); }
|
void Reset(Creature &u)
|
||||||
|
{
|
||||||
|
ReloadPath(u);
|
||||||
|
b_StopedByPlayer = false;
|
||||||
|
i_nextMoveTime.Reset(0);
|
||||||
|
}
|
||||||
bool Update(Creature &u, const uint32 &diff);
|
bool Update(Creature &u, const uint32 &diff);
|
||||||
|
|
||||||
void MovementInform(Creature &);
|
void MovementInform(Creature &);
|
||||||
|
|
@ -104,6 +107,9 @@ public PathMovementBase<Creature, WaypointPath*>
|
||||||
static void Initialize(void);
|
static void Initialize(void);
|
||||||
private:
|
private:
|
||||||
void ClearWaypoints();
|
void ClearWaypoints();
|
||||||
|
|
||||||
|
TimeTrackerSmall i_nextMoveTime;
|
||||||
|
std::vector<bool> i_hasDone;
|
||||||
bool b_StopedByPlayer;
|
bool b_StopedByPlayer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -722,7 +722,7 @@ struct GlyphPropertiesEntry
|
||||||
uint32 Id;
|
uint32 Id;
|
||||||
uint32 SpellId;
|
uint32 SpellId;
|
||||||
uint32 TypeFlags;
|
uint32 TypeFlags;
|
||||||
uint32 Unk1;
|
uint32 Unk1; // GlyphIconId (SpellIcon.dbc)
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GlyphSlotEntry
|
struct GlyphSlotEntry
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "6889"
|
#define REVISION_NR "6895"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue