mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
Merge remote branch 'origin/master' into 330
This commit is contained in:
commit
292f6189ea
50 changed files with 363 additions and 318 deletions
|
|
@ -60,6 +60,7 @@
|
|||
#include "Spell.h"
|
||||
#include "SocialMgr.h"
|
||||
#include "AchievementMgr.h"
|
||||
#include "Mail.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
|
|
@ -431,10 +432,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
|
|||
|
||||
////////////////////Rest System/////////////////////
|
||||
time_inn_enter=0;
|
||||
inn_pos_mapid=0;
|
||||
inn_pos_x=0;
|
||||
inn_pos_y=0;
|
||||
inn_pos_z=0;
|
||||
inn_trigger_id=0;
|
||||
m_rest_bonus=0;
|
||||
rest_type=REST_TYPE_NO;
|
||||
////////////////////Rest System/////////////////////
|
||||
|
|
@ -1246,7 +1244,7 @@ void Player::Update( uint32 p_time )
|
|||
if (time_inn >= 10) //freeze update
|
||||
{
|
||||
float bubble = 0.125f*sWorld.getConfig(CONFIG_FLOAT_RATE_REST_INGAME);
|
||||
//speed collect rest bonus (section/in hour)
|
||||
//speed collect rest bonus (section/in hour)
|
||||
SetRestBonus( float(GetRestBonus()+ time_inn*(GetUInt32Value(PLAYER_NEXT_LEVEL_XP)/72000)*bubble ));
|
||||
UpdateInnerTime(time(NULL));
|
||||
}
|
||||
|
|
@ -4130,8 +4128,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
|
|||
CharacterDatabase.PExecute("DELETE FROM character_achievement WHERE guid = '%u'",guid);
|
||||
CharacterDatabase.PExecute("DELETE FROM character_achievement_progress WHERE guid = '%u'",guid);
|
||||
CharacterDatabase.PExecute("DELETE FROM character_equipmentsets WHERE guid = '%u'",guid);
|
||||
CharacterDatabase.PExecute("DELETE FROM guild_eventlog WHERE PlayerGuid1 = '%u'",guid);
|
||||
CharacterDatabase.PExecute("DELETE FROM guild_eventlog WHERE PlayerGuid2 = '%u'",guid);
|
||||
CharacterDatabase.PExecute("DELETE FROM guild_eventlog WHERE PlayerGuid1 = '%u' OR PlayerGuid2 = '%u'",guid, guid);
|
||||
CharacterDatabase.PExecute("DELETE FROM guild_bank_eventlog WHERE PlayerGuid = '%u'",guid);
|
||||
CharacterDatabase.CommitTransaction();
|
||||
|
||||
|
|
@ -6487,38 +6484,19 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
|
|||
}
|
||||
|
||||
if(zone->flags & AREA_FLAG_CAPITAL) // in capital city
|
||||
{
|
||||
SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
|
||||
SetRestType(REST_TYPE_IN_CITY);
|
||||
InnEnter(time(0),GetMapId(),0,0,0);
|
||||
|
||||
if(sWorld.IsFFAPvPRealm())
|
||||
SetFFAPvP(false);
|
||||
}
|
||||
else // anywhere else
|
||||
{
|
||||
if(HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING)) // but resting (walk from city or maybe in tavern or leave tavern recently)
|
||||
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING)) // but resting (walk from city or maybe in tavern or leave tavern recently)
|
||||
{
|
||||
if(GetRestType()==REST_TYPE_IN_TAVERN) // has been in tavern. Is still in?
|
||||
if (GetRestType()==REST_TYPE_IN_TAVERN) // has been in tavern. Is still in?
|
||||
{
|
||||
if(GetMapId()!=GetInnPosMapId() || sqrt((GetPositionX()-GetInnPosX())*(GetPositionX()-GetInnPosX())+(GetPositionY()-GetInnPosY())*(GetPositionY()-GetInnPosY())+(GetPositionZ()-GetInnPosZ())*(GetPositionZ()-GetInnPosZ()))>40)
|
||||
{
|
||||
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
|
||||
AreaTriggerEntry const* at = sAreaTriggerStore.LookupEntry(inn_trigger_id);
|
||||
if (!at || !IsPointInAreaTriggerZone(at, GetMapId(), GetPositionX(), GetPositionY(), GetPositionY()))
|
||||
SetRestType(REST_TYPE_NO);
|
||||
|
||||
if(sWorld.IsFFAPvPRealm())
|
||||
SetFFAPvP(true);
|
||||
}
|
||||
}
|
||||
else // not in tavern (leave city then)
|
||||
{
|
||||
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
|
||||
SetRestType(REST_TYPE_NO);
|
||||
|
||||
// Set player to FFA PVP when not in rested environment.
|
||||
if(sWorld.IsFFAPvPRealm())
|
||||
SetFFAPvP(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -19384,9 +19362,9 @@ void Player::SendAurasForTarget(Unit *target)
|
|||
else
|
||||
data << uint8(aura->GetStackAmount());
|
||||
|
||||
if(!(auraFlags & AFLAG_NOT_CASTER))
|
||||
if(!(auraFlags & AFLAG_NOT_CASTER)) // packed GUID of caster
|
||||
{
|
||||
data << uint8(0); // packed GUID of someone (caster?)
|
||||
data.appendPackGUID(aura->GetCasterGUID());
|
||||
}
|
||||
|
||||
if(auraFlags & AFLAG_DURATION) // include aura duration
|
||||
|
|
@ -21753,3 +21731,27 @@ Object* Player::GetObjectByTypeMask(ObjectGuid guid, TypeMask typemask)
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Player::SetRestType( RestType n_r_type, uint32 areaTriggerId /*= 0*/)
|
||||
{
|
||||
rest_type = n_r_type;
|
||||
|
||||
if (rest_type == REST_TYPE_NO)
|
||||
{
|
||||
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
|
||||
|
||||
// Set player to FFA PVP when not in rested environment.
|
||||
if(sWorld.IsFFAPvPRealm())
|
||||
SetFFAPvP(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
|
||||
|
||||
inn_trigger_id = areaTriggerId;
|
||||
time_inn_enter = time(NULL);
|
||||
|
||||
if(sWorld.IsFFAPvPRealm())
|
||||
SetFFAPvP(false);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue