Core/Spells: Fix display for Shaman totems

This commit is contained in:
hondacrx
2018-04-24 17:57:30 -04:00
parent c2b882eb45
commit e88d23ff50
6 changed files with 273 additions and 118 deletions
+5 -12
View File
@@ -68,18 +68,11 @@ namespace Game.Entities
}
// set display id depending on caster's race
SpellInfo createdBySpell = Global.SpellMgr.GetSpellInfo(GetUInt32Value(UnitFields.CreatedBySpell));
if (createdBySpell != null)
{
SpellEffectInfo[] effects = createdBySpell.GetEffectsForDifficulty(Difficulty.None);
var summonEffect = effects.FirstOrDefault(effect =>
{
return effect != null && effect.IsEffect(SpellEffectName.Summon);
});
if (summonEffect != null)
SetDisplayId(owner.GetModelForTotem((PlayerTotemType)summonEffect.MiscValueB));
}
uint totemDisplayId = Global.SpellMgr.GetModelForTotem(GetUInt32Value(UnitFields.CreatedBySpell), owner.GetRace());
if (totemDisplayId == 0)
Log.outError(LogFilter.Spells, $"Spell {GetUInt32Value(UnitFields.CreatedBySpell)} with RaceID ({owner.GetRace()}) have no totem model data defined, set to default model.");
else
SetDisplayId(totemDisplayId);
}
base.InitStats(duration);