[11073] Prevent applying SPELLMOD_DURATION for summons with unlimited duration.

Fixes summon duration of spell 70908 in combination with talent 44557 and ranks.
This commit is contained in:
Lynx3d 2011-01-26 02:56:59 +01:00
parent 47ef4eca32
commit 6fbf464786
3 changed files with 20 additions and 15 deletions

View file

@ -1908,6 +1908,8 @@ bool Pet::IsPermanentPetFor(Player* owner)
case SUMMON_PET:
switch(owner->getClass())
{
// oddly enough, Mage's Water Elemental is still treated as temporary pet with Glyph of Eternal Water
// i.e. does not unsummon at mounting, gets dismissed at teleport etc.
case CLASS_WARLOCK:
return GetCreatureInfo()->type == CREATURE_TYPE_DEMON;
case CLASS_DEATH_KNIGHT:

View file

@ -4328,6 +4328,7 @@ void Spell::DoSummon(SpellEffectIndex eff_idx)
Pet* spawnCreature = new Pet(SUMMON_PET);
int32 duration = GetSpellDuration(m_spellInfo);
if (duration > 0)
if (Player* modOwner = m_caster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
@ -4801,6 +4802,7 @@ void Spell::DoSummonGuardian(SpellEffectIndex eff_idx, uint32 forceFaction)
float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[eff_idx]));
int32 duration = GetSpellDuration(m_spellInfo);
if (duration > 0)
if (Player* modOwner = m_caster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
@ -7320,6 +7322,7 @@ void Spell::DoSummonTotem(SpellEffectIndex eff_idx, uint8 slot_dbc)
pTotem->SetTypeBySummonSpell(m_spellInfo); // must be after Create call where m_spells initialized
int32 duration=GetSpellDuration(m_spellInfo);
if (duration > 0)
if (Player* modOwner = m_caster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
pTotem->SetDuration(duration);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11072"
#define REVISION_NR "11073"
#endif // __REVISION_NR_H__