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
aa161f802b
35 changed files with 548 additions and 341 deletions
|
|
@ -2098,15 +2098,14 @@ Player::GetNPCIfCanInteractWith(uint64 guid, uint32 npcflagmask)
|
|||
return NULL;
|
||||
|
||||
// player check
|
||||
if(!CanInteractWithNPCs(!unit->isSpiritService()))
|
||||
if(!CanInteractWithNPCs(!(unit->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_GHOST)))
|
||||
return NULL;
|
||||
|
||||
// appropriate npc type
|
||||
if(npcflagmask && !unit->HasFlag( UNIT_NPC_FLAGS, npcflagmask ))
|
||||
return NULL;
|
||||
|
||||
// alive or spirit healer
|
||||
if(!unit->isAlive() && (!unit->isSpiritService() || isAlive() ))
|
||||
if (isAlive() && !unit->isAlive())
|
||||
return NULL;
|
||||
|
||||
// not allow interaction under control, but allow with own pets
|
||||
|
|
@ -2357,10 +2356,21 @@ void Player::GiveXP(uint32 xp, Unit* victim)
|
|||
if(level >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
return;
|
||||
|
||||
// handle SPELL_AURA_MOD_XP_PCT auras
|
||||
Unit::AuraList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_PCT);
|
||||
for(Unit::AuraList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
|
||||
xp = uint32(xp*(1.0f + (*i)->GetModifier()->m_amount / 100.0f));
|
||||
if(victim)
|
||||
{
|
||||
// handle SPELL_AURA_MOD_KILL_XP_PCT auras
|
||||
Unit::AuraList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_KILL_XP_PCT);
|
||||
for(Unit::AuraList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
|
||||
xp = uint32(xp*(1.0f + (*i)->GetModifier()->m_amount / 100.0f));
|
||||
}
|
||||
else
|
||||
{
|
||||
// handle SPELL_AURA_MOD_QUEST_XP_PCT auras
|
||||
Unit::AuraList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_QUEST_XP_PCT);
|
||||
for(Unit::AuraList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
|
||||
xp = uint32(xp*(1.0f + (*i)->GetModifier()->m_amount / 100.0f));
|
||||
}
|
||||
|
||||
|
||||
// XP resting bonus for kill
|
||||
uint32 rested_bonus_xp = victim ? GetXPRestBonus(xp) : 0;
|
||||
|
|
@ -12561,6 +12571,13 @@ bool Player::CanRewardQuest( Quest const *pQuest, uint32 reward, bool msg )
|
|||
return true;
|
||||
}
|
||||
|
||||
void Player::SendPetTameFailure(PetTameFailureReason reason)
|
||||
{
|
||||
WorldPacket data(SMSG_PET_TAME_FAILURE, 1);
|
||||
data << uint8(reason);
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
void Player::AddQuest( Quest const *pQuest, Object *questGiver )
|
||||
{
|
||||
uint16 log_slot = FindQuestSlot( 0 );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue