[8301] Restore work 1122 broken after switch.

Also small cleanup in summon code: move statue summon cal from EffectSummonGuardian
to common summon type selector code.
This commit is contained in:
VladimirMangos 2009-08-03 16:03:21 +04:00
parent f05ac51b8a
commit 19ccf59cd4
4 changed files with 37 additions and 15 deletions

View file

@ -3266,12 +3266,17 @@ void Spell::EffectSummonType(uint32 i)
case SUMMON_TYPE_POSESSED2:
case SUMMON_TYPE_FORCE_OF_NATURE:
case SUMMON_TYPE_GUARDIAN2:
EffectSummonGuardian(i);
// Jewelery statue case (totem like)
if(m_spellInfo->SpellIconID == 2056)
EffectSummonTotem(i);
else
EffectSummonGuardian(i);
break;
case SUMMON_TYPE_WILD:
EffectSummonWild(i);
break;
case SUMMON_TYPE_DEMON:
case SUMMON_TYPE_INFERNO:
EffectSummonDemon(i);
break;
case SUMMON_TYPE_SUMMON:
@ -3317,6 +3322,16 @@ void Spell::EffectSummon(uint32 i)
if(m_caster->GetTypeId()==TYPEID_PLAYER && spawnCreature->LoadPetFromDB((Player*)m_caster,pet_entry))
{
// Summon in dest location
float x, y, z;
if(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
{
x = m_targets.m_destX;
y = m_targets.m_destY;
z = m_targets.m_destZ;
spawnCreature->Relocate(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, -m_caster->GetOrientation());
}
// set timer for unsummon
int32 duration = GetSpellDuration(m_spellInfo);
if(duration > 0)
@ -3692,13 +3707,6 @@ void Spell::EffectSummonGuardian(uint32 i)
if(!pet_entry)
return;
// Jewelery statue case (totem like)
if(m_spellInfo->SpellIconID == 2056)
{
EffectSummonTotem(i);
return;
}
// set timer for unsummon
int32 duration = GetSpellDuration(m_spellInfo);
@ -6505,6 +6513,9 @@ void Spell::EffectSummonDemon(uint32 i)
int32 amount = damage > 0 ? damage : 1;
if (m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_INFERNO)
amount = 1;
for(int32 count = 0; count < amount; ++count)
{
float px, py, pz;
@ -6537,13 +6548,15 @@ void Spell::EffectSummonDemon(uint32 i)
// TODO: Add damage/mana/hp according to level
// Enslave demon effect, without mana cost and cooldown
if (m_spellInfo->EffectMiscValue[i] == 89) // Inferno summon
{
// Enslave demon effect, without mana cost and cooldown
m_caster->CastSpell(Charmed, 20882, true); // FIXME: enslave does not scale with level, level 62+ minions cannot be enslaved
// Inferno effect
Charmed->CastSpell(Charmed, 22703, true, 0);
// Inferno effect for non player calls
if (m_spellInfo->EffectMiscValueB[i]!=SUMMON_TYPE_INFERNO)
Charmed->CastSpell(Charmed, 22703, true, 0);
}
}
}