[10156] Add shared object for auras of same spell and move spell proc code to its own file, also spread procs by auras and effect indexes.

This commit is contained in:
Laise 2010-07-07 19:07:53 +03:00
parent abe6776358
commit a32b3063a2
32 changed files with 7507 additions and 6076 deletions

View file

@ -1814,9 +1814,27 @@ bool Creature::LoadCreaturesAddon(bool reload)
continue;
}
Aura* AdditionalAura = CreateAura(AdditionalSpellInfo, cAura->effect_idx, NULL, this, this, 0);
AddAura(AdditionalAura);
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Spell: %u with Aura %u added to creature (GUIDLow: %u Entry: %u )", cAura->spell_id, AdditionalSpellInfo->EffectApplyAuraName[EFFECT_INDEX_0],GetGUIDLow(),GetEntry());
SpellAuraHolder *holder = GetSpellAuraHolder(cAura->spell_id, GetGUID());
bool addedToExisting = true;
if (!holder)
{
holder = CreateSpellAuraHolder(AdditionalSpellInfo, this, this);
addedToExisting = false;
}
Aura* AdditionalAura = CreateAura(AdditionalSpellInfo, cAura->effect_idx, NULL, holder, this, this, 0);
holder->AddAura(AdditionalAura, cAura->effect_idx);
if (addedToExisting)
{
holder->SetInUse(true);
AdditionalAura->ApplyModifier(true,true);
holder->SetInUse(false);
}
else
AddSpellAuraHolder(holder);
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Spell: %u - Aura %u added to creature (GUIDLow: %u Entry: %u )", cAura->spell_id, AdditionalSpellInfo->EffectApplyAuraName[EFFECT_INDEX_0],GetGUIDLow(),GetEntry());
}
}
return true;