[11973] Various Cleanups

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
stfx 2012-04-22 19:41:24 +02:00 committed by Schmoozerd
parent c243c42c3c
commit f3f3349661
50 changed files with 153 additions and 134 deletions

View file

@ -590,6 +590,7 @@ void Spell::EffectSchoolDMG(SpellEffectIndex effect_idx)
// Lookup for Deadly poison (only attacker applied)
Unit::AuraList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
{
if ((*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_ROGUE &&
((*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x10000)) &&
(*itr)->GetCasterGuid() == m_caster->GetObjectGuid())
@ -597,6 +598,7 @@ void Spell::EffectSchoolDMG(SpellEffectIndex effect_idx)
poison = *itr;
break;
}
}
// count consumed deadly poison doses at target
if (poison)
{
@ -2699,7 +2701,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
{
if (!unitTarget)
return;
m_caster->CastSpell(unitTarget, 21887, true);// spell mod
m_caster->CastSpell(unitTarget, 21887, true); // spell mod
return;
}
// Last Stand
@ -3175,6 +3177,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
{
if (!unitTarget || unitTarget->getPowerType() != POWER_MANA)
return;
// Glyph of Mana Tide
if (Unit *owner = m_caster->GetOwner())
if (Aura *dummy = owner->GetDummyAura(55441))
@ -4204,10 +4207,10 @@ void Spell::DoCreateItem(SpellEffectIndex eff_idx, uint32 itemtype)
ItemPosCountVec dest;
uint32 no_space = 0;
InventoryResult msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, newitemid, num_to_add, &no_space );
if( msg != EQUIP_ERR_OK )
if (msg != EQUIP_ERR_OK)
{
// convert to possible store amount
if( msg == EQUIP_ERR_INVENTORY_FULL || msg == EQUIP_ERR_CANT_CARRY_MORE_OF_THIS )
if (msg == EQUIP_ERR_INVENTORY_FULL || msg == EQUIP_ERR_CANT_CARRY_MORE_OF_THIS)
num_to_add -= no_space;
else
{
@ -4234,7 +4237,7 @@ void Spell::DoCreateItem(SpellEffectIndex eff_idx, uint32 itemtype)
}
// set the "Crafted by ..." property of the item
if( pItem->GetProto()->Class != ITEM_CLASS_CONSUMABLE && pItem->GetProto()->Class != ITEM_CLASS_QUEST)
if (pItem->GetProto()->Class != ITEM_CLASS_CONSUMABLE && pItem->GetProto()->Class != ITEM_CLASS_QUEST)
pItem->SetGuidValue(ITEM_FIELD_CREATOR, player->GetObjectGuid());
// send info to the client
@ -6544,7 +6547,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
// check presence
for(int j = 0; j < 4; ++j)
if(unitTarget->HasAura(spells[j], EFFECT_INDEX_0))
if (unitTarget->HasAura(spells[j], EFFECT_INDEX_0))
return;
// cast
@ -7946,6 +7949,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
return;
}
break;
}
case SPELLFAMILY_POTION:
{
@ -8593,10 +8597,10 @@ void Spell::EffectLeapForward(SpellEffectIndex eff_idx)
void Spell::EffectLeapBack(SpellEffectIndex eff_idx)
{
if(unitTarget->IsTaxiFlying())
if (unitTarget->IsTaxiFlying())
return;
m_caster->KnockBackFrom(unitTarget,float(m_spellInfo->EffectMiscValue[eff_idx])/10,float(damage)/10);
m_caster->KnockBackFrom(unitTarget, float(m_spellInfo->EffectMiscValue[eff_idx])/10, float(damage)/10);
}
void Spell::EffectReputation(SpellEffectIndex eff_idx)
@ -8827,10 +8831,10 @@ void Spell::DoSummonCritter(SpellEffectIndex eff_idx, uint32 forceFaction)
void Spell::EffectKnockBack(SpellEffectIndex eff_idx)
{
if(!unitTarget)
if (!unitTarget)
return;
unitTarget->KnockBackFrom(m_caster,float(m_spellInfo->EffectMiscValue[eff_idx])/10,float(damage)/10);
unitTarget->KnockBackFrom(m_caster, float(m_spellInfo->EffectMiscValue[eff_idx])/10, float(damage)/10);
}
void Spell::EffectSendTaxi(SpellEffectIndex eff_idx)
@ -8843,14 +8847,14 @@ void Spell::EffectSendTaxi(SpellEffectIndex eff_idx)
void Spell::EffectPlayerPull(SpellEffectIndex eff_idx)
{
if(!unitTarget)
if (!unitTarget)
return;
float dist = unitTarget->GetDistance2d(m_caster);
if (damage && dist > damage)
dist = float(damage);
unitTarget->KnockBackFrom(m_caster,-dist,float(m_spellInfo->EffectMiscValue[eff_idx])/10);
unitTarget->KnockBackFrom(m_caster, -dist, float(m_spellInfo->EffectMiscValue[eff_idx])/10);
}
void Spell::EffectDispelMechanic(SpellEffectIndex eff_idx)