Merge commit 'origin/master' into 320

This commit is contained in:
tomrus88 2009-08-05 14:52:29 +04:00
commit f97da77cbd
38 changed files with 788 additions and 538 deletions

View file

@ -1856,6 +1856,28 @@ void Spell::EffectDummy(uint32 i)
m_caster->CastSpell(m_caster, 51209, true);
return;
}
// Death Strike
else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000000010))
{
uint32 count = 0;
Unit::AuraMap const& auras = unitTarget->GetAuras();
for(Unit::AuraMap::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
{
if(itr->second->GetSpellProto()->Dispel == DISPEL_DISEASE &&
itr->second->GetCasterGUID() == m_caster->GetGUID() &&
IsSpellLastAuraEffect(itr->second->GetSpellProto(), itr->second->GetEffIndex()))
{
++count;
// max. 15%
if(count == 3)
break;
}
}
int32 bp = count * m_caster->GetMaxHealth() * m_spellInfo->DmgMultiplier[0] / 100;
m_caster->CastCustomSpell(m_caster, 45470, &bp, NULL, NULL, true);
return;
}
break;
}
@ -1942,7 +1964,7 @@ void Spell::EffectTriggerSpell(uint32 i)
// special cases
switch(triggered_spell_id)
{
// Vanish
// Vanish (not exist)
case 18461:
{
m_caster->RemoveSpellsCausingAura(SPELL_AURA_MOD_ROOT);
@ -1991,7 +2013,8 @@ void Spell::EffectTriggerSpell(uint32 i)
// Brittle Armor - (need add max stack of 24575 Brittle Armor)
case 29284:
{
const SpellEntry *spell = sSpellStore.LookupEntry(24575);
// Brittle Armor
SpellEntry const* spell = sSpellStore.LookupEntry(24575);
if (!spell)
return;
@ -2002,7 +2025,8 @@ void Spell::EffectTriggerSpell(uint32 i)
// Mercurial Shield - (need add max stack of 26464 Mercurial Shield)
case 29286:
{
const SpellEntry *spell = sSpellStore.LookupEntry(26464);
// Mercurial Shield
SpellEntry const* spell = sSpellStore.LookupEntry(26464);
if (!spell)
return;
@ -2017,7 +2041,7 @@ void Spell::EffectTriggerSpell(uint32 i)
return;
}
// Cloak of Shadows
case 35729 :
case 35729:
{
Unit::AuraMap& Auras = m_caster->GetAuras();
for(Unit::AuraMap::iterator iter = Auras.begin(); iter != Auras.end(); ++iter)
@ -2348,7 +2372,7 @@ void Spell::EffectApplyAura(uint32 i)
return;
// ghost spell check, allow apply any auras at player loading in ghost mode (will be cleanup after load)
if( !unitTarget->isAlive() && m_spellInfo->Id != 20584 && m_spellInfo->Id != 8326 &&
if( !unitTarget->isAlive() && !IsDeathPersistentSpell(m_spellInfo) &&
(unitTarget->GetTypeId()!=TYPEID_PLAYER || !((Player*)unitTarget)->GetSession()->PlayerLoading()) )
return;
@ -2391,7 +2415,7 @@ void Spell::EffectApplyAura(uint32 i)
return;
// Prayer of Mending (jump animation), we need formal caster instead original for correct animation
if( m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x00002000000000)))
if( m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000002000000000)))
m_caster->CastSpell(unitTarget, 41637, true, NULL, Aur, m_originalCasterGUID);
}
@ -3260,12 +3284,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:
@ -3311,6 +3340,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)
@ -3508,25 +3547,12 @@ void Spell::EffectDispel(uint32 i)
}
m_caster->SendMessageToSet(&data, true);
// On succes dispel
// On success dispel
// Devour Magic
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->Category == SPELLCATEGORY_DEVOUR_MAGIC)
{
uint32 heal_spell = 0;
switch (m_spellInfo->Id)
{
case 19505: heal_spell = 19658; break;
case 19731: heal_spell = 19732; break;
case 19734: heal_spell = 19733; break;
case 19736: heal_spell = 19735; break;
case 27276: heal_spell = 27278; break;
case 27277: heal_spell = 27279; break;
default:
sLog.outDebug("Spell for Devour Magic %d not handled in Spell::EffectDispel", m_spellInfo->Id);
break;
}
if (heal_spell)
m_caster->CastSpell(m_caster, heal_spell, true);
int32 heal_amount = m_spellInfo->CalculateSimpleValue(1);
m_caster->CastCustomSpell(m_caster, 19658, &heal_amount, NULL, NULL, true);
}
}
// Send fail log to client
@ -3699,13 +3725,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);
@ -4501,6 +4520,38 @@ void Spell::EffectWeaponDmg(uint32 i)
}
}
}
break;
}
case SPELLFAMILY_DEATHKNIGHT:
{
// Blood Strike, Heart Strike, Obliterate
// Blood-Caked Strike, Scourge Strike
if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0002000001400000) ||
m_spellInfo->SpellIconID == 1736 || m_spellInfo->SpellIconID == 3143)
{
uint32 count = 0;
Unit::AuraMap const& auras = unitTarget->GetAuras();
for(Unit::AuraMap::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
{
if(itr->second->GetSpellProto()->Dispel == DISPEL_DISEASE &&
itr->second->GetCasterGUID() == m_caster->GetGUID() &&
IsSpellLastAuraEffect(itr->second->GetSpellProto(), itr->second->GetEffIndex()))
++count;
}
if (count)
{
// Effect 1(for Blood-Caked Strike)/3(other) damage is bonus
double bonus = count * CalculateDamage(m_spellInfo->SpellIconID == 1736 ? 0 : 2, unitTarget) / 100.0f;
// Blood Strike, Blood-Caked Strike and Obliterate store bonus*2
if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0002000000400000) ||
m_spellInfo->SpellIconID == 1736)
bonus /= 2.0f;
totalDamagePercentMod += bonus;
}
}
break;
}
}
@ -5173,6 +5224,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
{
uint32 spellId = 0;
int32 basePoint = 0;
Unit* target = unitTarget;
Unit::AuraMap& Auras = unitTarget->GetAuras();
for(Unit::AuraMap::iterator i = Auras.begin(); i != Auras.end(); ++i)
{
@ -5197,6 +5249,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
{
spellId = 53358; // 53358 Chimera Shot - Viper
basePoint = aura->GetModifier()->m_amount * 4 * 60 / 100;
target = m_caster;
}
// Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute.
if (familyFlag & UI64LIT(0x0000000000008000))
@ -5209,7 +5262,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
//}
}
if (spellId)
m_caster->CastCustomSpell(unitTarget, spellId, &basePoint, 0, 0, false);
m_caster->CastCustomSpell(target, spellId, &basePoint, 0, 0, false);
return;
}
default:
@ -5219,8 +5272,8 @@ void Spell::EffectScriptEffect(uint32 effIndex)
}
case SPELLFAMILY_PALADIN:
{
// Judgement
if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000800000))
// Judgement (seal trigger)
if (m_spellInfo->Category == SPELLCATEGORY_JUDGEMENT)
{
if(!unitTarget || !unitTarget->isAlive())
return;
@ -5230,12 +5283,12 @@ void Spell::EffectScriptEffect(uint32 effIndex)
// Judgement self add switch
switch (m_spellInfo->Id)
{
case 41467: break; // Judgement
case 53407: spellId1 = 20184; break; // Judgement of Justice
case 20271: // Judgement of Light
case 57774: spellId1 = 20185; break; // Judgement of Light
case 53408: spellId1 = 20186; break; // Judgement of Wisdom
default:
sLog.outError("Unsupported Judgement (seal trigger) spell (Id: %u) in Spell::EffectScriptEffect",m_spellInfo->Id);
return;
}
// all seals have aura dummy in 2 effect
@ -6219,7 +6272,7 @@ void Spell::EffectSummonDeadPet(uint32 /*i*/)
pet->AIM_Initialize();
_player->PetSpellInitialize();
// _player->PetSpellInitialize(); -- action bar not removed at death and not required send at revive
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
}
@ -6503,6 +6556,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;
@ -6535,13 +6591,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);
}
}
}