Misc Fixes

This commit is contained in:
hondacrx
2017-10-25 17:07:28 -04:00
parent 62585dcfb3
commit d552c65668
15 changed files with 248 additions and 194 deletions
+10 -2
View File
@@ -1045,7 +1045,10 @@ namespace Game.Entities
if (quest.RewardSpell > 0)
{
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(quest.RewardSpell);
if (questGiver.isTypeMask(TypeMask.Unit) && !spellInfo.HasEffect(Difficulty.None, SpellEffectName.LearnSpell) && !spellInfo.HasEffect(Difficulty.None, SpellEffectName.CreateItem) && !spellInfo.HasEffect(Difficulty.None, SpellEffectName.ApplyAura))
if (questGiver && questGiver.isTypeMask(TypeMask.Unit)
&& !spellInfo.HasEffect(Difficulty.None, SpellEffectName.LearnSpell)
&& !spellInfo.HasEffect(Difficulty.None, SpellEffectName.CreateItem)
&& !spellInfo.HasEffect(Difficulty.None, SpellEffectName.ApplyAura))
{
Unit unit = questGiver.ToUnit();
if (unit)
@@ -1061,7 +1064,9 @@ namespace Game.Entities
if (quest.RewardDisplaySpell[i] > 0)
{
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(quest.RewardDisplaySpell[i]);
if (questGiver.IsTypeId(TypeId.Unit) && !spellInfo.HasEffect(Difficulty.None, SpellEffectName.LearnSpell) && !spellInfo.HasEffect(Difficulty.None, SpellEffectName.CreateItem))
if (questGiver && questGiver.IsTypeId(TypeId.Unit)
&& !spellInfo.HasEffect(Difficulty.None, SpellEffectName.LearnSpell)
&& !spellInfo.HasEffect(Difficulty.None, SpellEffectName.CreateItem))
{
Unit unit = questGiver.ToUnit();
if (unit)
@@ -2639,7 +2644,10 @@ namespace Game.Entities
public void SetQuestObjectiveData(QuestObjective objective, int data)
{
if (objective.StorageIndex < 0)
{
Log.outError(LogFilter.Player, "SetQuestObjectiveData: called for quest {0} with invalid StorageIndex {1} (objective data is not tracked)", objective.QuestID, objective.StorageIndex);
return;
}
var status = m_QuestStatus.LookupByKey(objective.QuestID);
if (status == null)