[10028] Reward group for shareable quests at cast event to creature/go.

This commit is contained in:
VladimirMangos 2010-06-04 18:37:27 +04:00
parent ff3fb9b727
commit 6ebbcd8dbb
5 changed files with 85 additions and 56 deletions

View file

@ -1083,7 +1083,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
// ignore pets or autorepeat/melee casts for speed (not exist quest for spells (hm... )
if (real_caster && !((Creature*)unit)->isPet() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive())
if (Player* p = real_caster->GetCharmerOrOwnerPlayerOrPlayerItself())
p->CastedCreatureOrGO(unit->GetEntry(), unit->GetObjectGuid(), m_spellInfo->Id);
p->RewardPlayerAndGroupAtCast(unit, m_spellInfo->Id);
if(((Creature*)unit)->AI())
((Creature*)unit)->AI()->SpellHit(m_caster, m_spellInfo);
@ -1249,7 +1249,7 @@ void Spell::DoAllEffectOnTarget(GOTargetInfo *target)
if( !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive() )
{
if ( Player* p = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself() )
p->CastedCreatureOrGO(go->GetEntry(), go->GetObjectGuid(), m_spellInfo->Id);
p->RewardPlayerAndGroupAtCast(go, m_spellInfo->Id);
}
}
@ -3147,7 +3147,7 @@ void Spell::update(uint32 difftime)
if (unit == NULL)
continue;
p->CastedCreatureOrGO(unit->GetEntry(), unit->GetObjectGuid(), m_spellInfo->Id);
p->RewardPlayerAndGroupAtCast(unit, m_spellInfo->Id);
}
for(std::list<GOTargetInfo>::iterator ihit = m_UniqueGOTargetInfo.begin(); ihit != m_UniqueGOTargetInfo.end(); ++ihit)
@ -3158,7 +3158,7 @@ void Spell::update(uint32 difftime)
if(!go)
continue;
p->CastedCreatureOrGO(go->GetEntry(), go->GetObjectGuid(), m_spellInfo->Id);
p->RewardPlayerAndGroupAtCast(go, m_spellInfo->Id);
}
}
}