mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
Merge commit 'origin/master' into 330
This commit is contained in:
commit
b10c3e2287
63 changed files with 942 additions and 1102 deletions
|
|
@ -859,12 +859,15 @@ int32 Player::getMaxTimer(MirrorTimerType timer)
|
|||
switch (timer)
|
||||
{
|
||||
case FATIGUE_TIMER:
|
||||
return MINUTE*IN_MILISECONDS;
|
||||
if (GetSession()->GetSecurity() >= sWorld.getConfig(CONFIG_TIMERBAR_FATIGUE_GMLEVEL))
|
||||
return DISABLED_MIRROR_TIMER;
|
||||
return sWorld.getConfig(CONFIG_TIMERBAR_FATIGUE_MAX)*IN_MILISECONDS;
|
||||
case BREATH_TIMER:
|
||||
{
|
||||
if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSession()->GetSecurity() >= sWorld.getConfig(CONFIG_DISABLE_BREATHING))
|
||||
if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) ||
|
||||
GetSession()->GetSecurity() >= sWorld.getConfig(CONFIG_TIMERBAR_BREATH_GMLEVEL))
|
||||
return DISABLED_MIRROR_TIMER;
|
||||
int32 UnderWaterTime = 3*MINUTE*IN_MILISECONDS;
|
||||
int32 UnderWaterTime = sWorld.getConfig(CONFIG_TIMERBAR_BREATH_MAX)*IN_MILISECONDS;
|
||||
AuraList const& mModWaterBreathing = GetAurasByType(SPELL_AURA_MOD_WATER_BREATHING);
|
||||
for(AuraList::const_iterator i = mModWaterBreathing.begin(); i != mModWaterBreathing.end(); ++i)
|
||||
UnderWaterTime = uint32(UnderWaterTime * (100.0f + (*i)->GetModifier()->m_amount) / 100.0f);
|
||||
|
|
@ -872,9 +875,9 @@ int32 Player::getMaxTimer(MirrorTimerType timer)
|
|||
}
|
||||
case FIRE_TIMER:
|
||||
{
|
||||
if (!isAlive())
|
||||
if (!isAlive() || GetSession()->GetSecurity() >= sWorld.getConfig(CONFIG_TIMERBAR_FIRE_GMLEVEL))
|
||||
return DISABLED_MIRROR_TIMER;
|
||||
return 1*IN_MILISECONDS;
|
||||
return sWorld.getConfig(CONFIG_TIMERBAR_FIRE_MAX)*IN_MILISECONDS;
|
||||
}
|
||||
default:
|
||||
return 0;
|
||||
|
|
@ -2182,7 +2185,7 @@ void Player::SetInWater(bool apply)
|
|||
// remove auras that need water/land
|
||||
RemoveAurasWithInterruptFlags(apply ? AURA_INTERRUPT_FLAG_NOT_ABOVEWATER : AURA_INTERRUPT_FLAG_NOT_UNDERWATER);
|
||||
|
||||
getHostilRefManager().updateThreatTables();
|
||||
getHostileRefManager().updateThreatTables();
|
||||
}
|
||||
|
||||
void Player::SetGameMaster(bool on)
|
||||
|
|
@ -2196,7 +2199,7 @@ void Player::SetGameMaster(bool on)
|
|||
if (Pet* pet = GetPet())
|
||||
{
|
||||
pet->setFaction(35);
|
||||
pet->getHostilRefManager().setOnlineOfflineState(false);
|
||||
pet->getHostileRefManager().setOnlineOfflineState(false);
|
||||
}
|
||||
|
||||
for (int8 i = 0; i < MAX_TOTEM; ++i)
|
||||
|
|
@ -2207,7 +2210,7 @@ void Player::SetGameMaster(bool on)
|
|||
RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
|
||||
ResetContestedPvP();
|
||||
|
||||
getHostilRefManager().setOnlineOfflineState(false);
|
||||
getHostileRefManager().setOnlineOfflineState(false);
|
||||
CombatStopWithPets();
|
||||
|
||||
SetPhaseMask(PHASEMASK_ANYWHERE,false); // see and visible in all phases
|
||||
|
|
@ -2225,7 +2228,7 @@ void Player::SetGameMaster(bool on)
|
|||
if (Pet* pet = GetPet())
|
||||
{
|
||||
pet->setFaction(getFaction());
|
||||
pet->getHostilRefManager().setOnlineOfflineState(true);
|
||||
pet->getHostileRefManager().setOnlineOfflineState(true);
|
||||
}
|
||||
|
||||
for (int8 i = 0; i < MAX_TOTEM; ++i)
|
||||
|
|
@ -2240,7 +2243,7 @@ void Player::SetGameMaster(bool on)
|
|||
// restore FFA PvP area state, remove not allowed for GM mounts
|
||||
UpdateArea(m_areaUpdateId);
|
||||
|
||||
getHostilRefManager().setOnlineOfflineState(true);
|
||||
getHostileRefManager().setOnlineOfflineState(true);
|
||||
}
|
||||
|
||||
UpdateVisibilityForPlayer();
|
||||
|
|
@ -10407,7 +10410,7 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo
|
|||
if (IsInWorld() && update)
|
||||
{
|
||||
pItem->AddToWorld();
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SendCreateUpdateToPlayer( this );
|
||||
}
|
||||
|
||||
pItem->SetState(ITEM_CHANGED, this);
|
||||
|
|
@ -10418,7 +10421,7 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo
|
|||
if( IsInWorld() && update )
|
||||
{
|
||||
pItem->AddToWorld();
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SendCreateUpdateToPlayer( this );
|
||||
}
|
||||
pItem->SetState(ITEM_CHANGED, this);
|
||||
pBag->SetState(ITEM_CHANGED, this);
|
||||
|
|
@ -10438,7 +10441,7 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo
|
|||
|
||||
pItem2->SetCount( pItem2->GetCount() + count );
|
||||
if (IsInWorld() && update)
|
||||
pItem2->SendUpdateToPlayer( this );
|
||||
pItem2->SendCreateUpdateToPlayer( this );
|
||||
|
||||
if (!clone)
|
||||
{
|
||||
|
|
@ -10528,7 +10531,7 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update )
|
|||
if( IsInWorld() && update )
|
||||
{
|
||||
pItem->AddToWorld();
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SendCreateUpdateToPlayer( this );
|
||||
}
|
||||
|
||||
ApplyEquipCooldown(pItem);
|
||||
|
|
@ -10548,7 +10551,7 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update )
|
|||
{
|
||||
pItem2->SetCount( pItem2->GetCount() + pItem->GetCount() );
|
||||
if( IsInWorld() && update )
|
||||
pItem2->SendUpdateToPlayer( this );
|
||||
pItem2->SendCreateUpdateToPlayer( this );
|
||||
|
||||
// delete item (it not in any slot currently)
|
||||
//pItem->DeleteFromDB();
|
||||
|
|
@ -10589,7 +10592,7 @@ void Player::QuickEquipItem( uint16 pos, Item *pItem)
|
|||
if( IsInWorld() )
|
||||
{
|
||||
pItem->AddToWorld();
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SendCreateUpdateToPlayer( this );
|
||||
}
|
||||
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry());
|
||||
|
|
@ -10711,7 +10714,7 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update )
|
|||
// pItem->SetUInt64Value( ITEM_FIELD_OWNER, 0 ); not clear owner at remove (it will be set at store). This used in mail and auction code
|
||||
pItem->SetSlot( NULL_SLOT );
|
||||
if( IsInWorld() && update )
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SendCreateUpdateToPlayer( this );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -10859,7 +10862,7 @@ void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool uneq
|
|||
ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
|
||||
pItem->SetCount( pItem->GetCount() - count + remcount );
|
||||
if (IsInWorld() & update)
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SendCreateUpdateToPlayer( this );
|
||||
pItem->SetState(ITEM_CHANGED, this);
|
||||
return;
|
||||
}
|
||||
|
|
@ -10887,7 +10890,7 @@ void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool uneq
|
|||
ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
|
||||
pItem->SetCount( pItem->GetCount() - count + remcount );
|
||||
if (IsInWorld() & update)
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SendCreateUpdateToPlayer( this );
|
||||
pItem->SetState(ITEM_CHANGED, this);
|
||||
return;
|
||||
}
|
||||
|
|
@ -10920,7 +10923,7 @@ void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool uneq
|
|||
ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
|
||||
pItem->SetCount( pItem->GetCount() - count + remcount );
|
||||
if (IsInWorld() && update)
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SendCreateUpdateToPlayer( this );
|
||||
pItem->SetState(ITEM_CHANGED, this);
|
||||
return;
|
||||
}
|
||||
|
|
@ -10953,7 +10956,7 @@ void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool uneq
|
|||
ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
|
||||
pItem->SetCount( pItem->GetCount() - count + remcount );
|
||||
if (IsInWorld() & update)
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SendCreateUpdateToPlayer( this );
|
||||
pItem->SetState(ITEM_CHANGED, this);
|
||||
return;
|
||||
}
|
||||
|
|
@ -11038,7 +11041,7 @@ void Player::DestroyItemCount( Item* pItem, uint32 &count, bool update )
|
|||
pItem->SetCount( pItem->GetCount() - count );
|
||||
count = 0;
|
||||
if( IsInWorld() & update )
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SendCreateUpdateToPlayer( this );
|
||||
pItem->SetState(ITEM_CHANGED, this);
|
||||
}
|
||||
}
|
||||
|
|
@ -11103,7 +11106,7 @@ void Player::SplitItem( uint16 src, uint16 dst, uint32 count )
|
|||
}
|
||||
|
||||
if( IsInWorld() )
|
||||
pSrcItem->SendUpdateToPlayer( this );
|
||||
pSrcItem->SendCreateUpdateToPlayer( this );
|
||||
pSrcItem->SetState(ITEM_CHANGED, this);
|
||||
StoreItem( dest, pNewItem, true);
|
||||
}
|
||||
|
|
@ -11123,7 +11126,7 @@ void Player::SplitItem( uint16 src, uint16 dst, uint32 count )
|
|||
}
|
||||
|
||||
if( IsInWorld() )
|
||||
pSrcItem->SendUpdateToPlayer( this );
|
||||
pSrcItem->SendCreateUpdateToPlayer( this );
|
||||
pSrcItem->SetState(ITEM_CHANGED, this);
|
||||
BankItem( dest, pNewItem, true);
|
||||
}
|
||||
|
|
@ -11143,7 +11146,7 @@ void Player::SplitItem( uint16 src, uint16 dst, uint32 count )
|
|||
}
|
||||
|
||||
if( IsInWorld() )
|
||||
pSrcItem->SendUpdateToPlayer( this );
|
||||
pSrcItem->SendCreateUpdateToPlayer( this );
|
||||
pSrcItem->SetState(ITEM_CHANGED, this);
|
||||
EquipItem( dest, pNewItem, true);
|
||||
AutoUnequipOffhandIfNeed();
|
||||
|
|
@ -11314,8 +11317,8 @@ void Player::SwapItem( uint16 src, uint16 dst )
|
|||
pDstItem->SetState(ITEM_CHANGED, this);
|
||||
if( IsInWorld() )
|
||||
{
|
||||
pSrcItem->SendUpdateToPlayer( this );
|
||||
pDstItem->SendUpdateToPlayer( this );
|
||||
pSrcItem->SendCreateUpdateToPlayer( this );
|
||||
pDstItem->SendCreateUpdateToPlayer( this );
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
|
@ -16936,7 +16939,7 @@ void Player::HandleStealthedUnitsDetection()
|
|||
{
|
||||
if(!hasAtClient)
|
||||
{
|
||||
(*i)->SendUpdateToPlayer(this);
|
||||
(*i)->SendCreateUpdateToPlayer(this);
|
||||
m_clientGUIDs.insert((*i)->GetGUID());
|
||||
|
||||
#ifdef MANGOS_DEBUG
|
||||
|
|
@ -18109,7 +18112,7 @@ void Player::UpdateVisibilityOf(WorldObject const* viewPoint, WorldObject* targe
|
|||
{
|
||||
if(target->isVisibleForInState(this, viewPoint, false))
|
||||
{
|
||||
target->SendUpdateToPlayer(this);
|
||||
target->SendCreateUpdateToPlayer(this);
|
||||
if(target->GetTypeId()!=TYPEID_GAMEOBJECT||!((GameObject*)target)->IsTransport())
|
||||
m_clientGUIDs.insert(target->GetGUID());
|
||||
|
||||
|
|
@ -18163,7 +18166,6 @@ void Player::UpdateVisibilityOf(WorldObject const* viewPoint, T* target, UpdateD
|
|||
if(target->isVisibleForInState(this,viewPoint,false))
|
||||
{
|
||||
visibleNow.insert(target);
|
||||
target->BuildUpdate(data_updates);
|
||||
target->BuildCreateUpdateBlockForPlayer(&data, this);
|
||||
UpdateVisibilityOf_helper(m_clientGUIDs,target);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue