Merge commit 'origin/master' into 320

Conflicts:
	src/game/Player.cpp
	src/game/Totem.cpp
This commit is contained in:
tomrus88 2009-07-21 08:22:30 +04:00
commit 4c709772c1
61 changed files with 912 additions and 454 deletions

View file

@ -189,7 +189,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectApplyAreaAura, //129 SPELL_EFFECT_APPLY_AREA_AURA_ENEMY
&Spell::EffectNULL, //130 SPELL_EFFECT_REDIRECT_THREAT
&Spell::EffectUnused, //131 SPELL_EFFECT_131 used in some test spells
&Spell::EffectNULL, //132 SPELL_EFFECT_PLAY_MUSIC sound id in misc value (SoundEntries.dbc)
&Spell::EffectPlayMusic, //132 SPELL_EFFECT_PLAY_MUSIC sound id in misc value (SoundEntries.dbc)
&Spell::EffectUnlearnSpecialization, //133 SPELL_EFFECT_UNLEARN_SPECIALIZATION unlearn profession specialization
&Spell::EffectKillCredit, //134 SPELL_EFFECT_KILL_CREDIT misc value is creature entry
&Spell::EffectNULL, //135 SPELL_EFFECT_CALL_PET
@ -404,9 +404,72 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
// Incinerate Rank 1 & 2
if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x00004000000000)) && m_spellInfo->SpellIconID==2128)
{
// Incinerate does more dmg (dmg*0.25) if the target is Immolated.
if(unitTarget->HasAuraState(AURA_STATE_IMMOLATE))
damage += int32(damage*0.25f);
// Incinerate does more dmg (dmg*0.25) if the target have Immolate debuff.
// Check aura state for speed but aura state set not only for Immolate spell
if(unitTarget->HasAuraState(AURA_STATE_CONFLAGRATE))
{
Unit::AuraList const& RejorRegr = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
{
// Immolate
if((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK &&
((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x00000000000004)))
{
damage += damage/4;
break;
}
}
}
}
// Shadowflame
else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0001000000000000))
{
// Apply DOT part
switch(m_spellInfo->Id)
{
case 47897: m_caster->CastSpell(unitTarget, 47960, true); break;
case 61290: m_caster->CastSpell(unitTarget, 61291, true); break;
default:
sLog.outError("Spell::EffectDummy: Unhandeled Shadowflame spell rank %u",m_spellInfo->Id);
break;
}
}
// Conflagrate - consumes Immolate or Shadowflame
else if (m_spellInfo->TargetAuraState == AURA_STATE_CONFLAGRATE)
{
Aura const* aura = NULL; // found req. aura for damage calculation
Unit::AuraList const &mPeriodic = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
{
// for caster applied auras only
if ((*i)->GetSpellProto()->SpellFamilyName != SPELLFAMILY_WARLOCK ||
(*i)->GetCasterGUID()!=m_caster->GetGUID())
continue;
// Immolate
if ((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000004))
{
aura = *i; // it selected always if exist
break;
}
// Shadowflame
if ((*i)->GetSpellProto()->SpellFamilyFlags2 & 0x00000002)
aura = *i; // remember but wait possible Immolate as primary priority
}
// found Immolate or Shadowflame
if (aura)
{
int32 damagetick = m_caster->SpellDamageBonus(unitTarget, aura->GetSpellProto(), aura->GetModifier()->m_amount, DOT);
damage += damagetick * 4;
// Glyph of Conflagrate
if (!m_caster->HasAura(56235))
unitTarget->RemoveAurasByCasterSpell(aura->GetId(), m_caster->GetGUID());
break;
}
}
break;
}
@ -839,7 +902,7 @@ void Spell::EffectDummy(uint32 i)
case 23448: // Transporter Arrival - Ultrasafe Transporter: Gadgetzan - backfires
{
int32 r = irand(0, 119);
if ( r < 20 ) // Transporter Malfunction - 1/6 polymorph
if ( r < 20 ) // Transporter Malfunction - 1/6 polymorph
m_caster->CastSpell(m_caster, 23444, true);
else if ( r < 100 ) // Evil Twin - 4/6 evil twin
m_caster->CastSpell(m_caster, 23445, true);
@ -1064,13 +1127,13 @@ void Spell::EffectDummy(uint32 i)
m_caster->CastSpell(m_caster, 45088, true);
return;
}
case 55004: // Nitro Boosts
if(!m_CastItem) return;
if(roll_chance_i(95)) // Nitro Boosts - success
m_caster->CastSpell(m_caster, 54861, true, m_CastItem);
else // Knocked Up - backfire 5%
m_caster->CastSpell(m_caster, 46014, true, m_CastItem);
return;
case 55004: // Nitro Boosts
if(!m_CastItem) return;
if(roll_chance_i(95)) // Nitro Boosts - success
m_caster->CastSpell(m_caster, 54861, true, m_CastItem);
else // Knocked Up - backfire 5%
m_caster->CastSpell(m_caster, 46014, true, m_CastItem);
return;
case 50243: // Teach Language
{
if(m_caster->GetTypeId() != TYPEID_PLAYER)
@ -1147,6 +1210,21 @@ void Spell::EffectDummy(uint32 i)
case 58418: // Portal to Orgrimmar
case 58420: // Portal to Stormwind
return; // implemented in EffectScript[0]
case 59640: // Underbelly Elixir
{
if(m_caster->GetTypeId() != TYPEID_PLAYER)
return;
uint32 spell_id = 0;
switch(urand(1,3))
{
case 1: spell_id = 59645; break;
case 2: spell_id = 59831; break;
case 3: spell_id = 59843; break;
}
m_caster->CastSpell(m_caster,spell_id,true,NULL);
return;
}
}
//All IconID Check in there
@ -1431,7 +1509,7 @@ void Spell::EffectDummy(uint32 i)
m_caster->CastSpell(unitTarget, 5940, true);
return;
}
case 14185: // Preparation Rogue
case 14185: // Preparation
{
if(m_caster->GetTypeId()!=TYPEID_PLAYER)
return;
@ -1483,7 +1561,7 @@ void Spell::EffectDummy(uint32 i)
switch(m_spellInfo->Id)
{
case 23989: //Readiness talent
case 23989: // Readiness talent
{
if(m_caster->GetTypeId()!=TYPEID_PLAYER)
return;
@ -1645,8 +1723,8 @@ void Spell::EffectDummy(uint32 i)
}
break;
case SPELLFAMILY_SHAMAN:
//Shaman Rockbiter Weapon
if (m_spellInfo->SpellFamilyFlags == 0x400000)
// Rockbiter Weapon
if (m_spellInfo->SpellFamilyFlags & 0x400000)
{
// TODO: use expect spell for enchant (if exist talent)
// In 3.0.3 no mods present for rockbiter
@ -1719,8 +1797,7 @@ void Spell::EffectDummy(uint32 i)
if(!unitTarget || unitTarget->getPowerType() != POWER_MANA)
return;
// Glyph of Mana Tide
Unit *owner = m_caster->GetOwner();
if (owner)
if(Unit *owner = m_caster->GetOwner())
if (Aura *dummy = owner->GetDummyAura(55441))
damage+=dummy->GetModifier()->m_amount;
// Regenerate 6% of Total Mana Every 3 secs
@ -2016,7 +2093,7 @@ void Spell::EffectTriggerSpell(uint32 i)
m_caster->CastSpell(unitTarget,spellInfo,true,m_CastItem,NULL,m_originalCasterGUID);
}
else
m_TriggerSpells.push_back(spellInfo);
AddTriggeredSpell(spellInfo);
}
void Spell::EffectTriggerMissileSpell(uint32 effect_idx)
@ -5668,14 +5745,10 @@ void Spell::EffectSummonObject(uint32 i)
default: return;
}
uint64 guid = m_caster->m_ObjectSlot[slot];
if(guid != 0)
if(uint64 guid = m_caster->m_ObjectSlot[slot])
{
GameObject* obj = NULL;
if( m_caster )
obj = m_caster->GetMap()->GetGameObject(guid);
if(obj) obj->Delete();
if(GameObject* obj = m_caster ? m_caster->GetMap()->GetGameObject(guid) : NULL)
obj->SetLootState(GO_JUST_DEACTIVATED);
m_caster->m_ObjectSlot[slot] = 0;
}
@ -6610,3 +6683,21 @@ void Spell::EffectRenamePet(uint32 /*eff_idx*/)
unitTarget->SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_ALLOWED);
}
void Spell::EffectPlayMusic(uint32 i)
{
if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
uint32 soundid = m_spellInfo->EffectMiscValue[i];
if (!sSoundEntriesStore.LookupEntry(soundid))
{
sLog.outError("EffectPlayMusic: Sound (Id: %u) not exist in spell %u.",soundid,m_spellInfo->Id);
return;
}
WorldPacket data(SMSG_PLAY_MUSIC, 4);
data << uint32(soundid);
((Player*)unitTarget)->GetSession()->SendPacket(&data);
}