
Untitled
By: a guest on
Aug 10th, 2012 | syntax:
None | size: 1.32 KB | hits: 5 | expires: Never
var quests =
from quest in db.QuestTemplates
where q.MinLevel <= wowMain.Me.Level + 2
where (q.SpecialFlags == 0 || q.SpecialFlags == 4)
where q.SuggestedPlayers <= 1
where q.RequiredMaxRepFaction == 0
where q.RequiredMinRepFaction == 0
where q.RepObjectiveFaction == 0
where q.LimitTime == 0
where q.ReqSourceID1 == 0
where q.ReqSpellCast1 == 0
let startEntry = db.CreatureQuestRelations.FirstOrDefault(a => a.Quest == quest.Entry)
let endEntry = db.CreatureQuestRelations.FirstOrDefault(a => a.Quest == quest.Entry)
if (startEntry != null || endEntry != null)
{
let start = db.CreatureTemplates.FirstOrDefault(x => x.Entry == startEntry.ID)
let end = db.CreatureTemplates.FirstOrDefault(x => x.Entry == endEntry.ID)
if (start != null || end != null)
{
let creatureStart = db.Creatures.FirstOrDefault(x => x.ID == start.Entry)
let creatureEnd = db.Creatures.FirstOrDefault(x => x.ID == end.Entry)
if (creatureStart != null &&
creatureEnd != null &&
creatureStart.Map == wowMain.Me.MapId &&
creatureEnd.Map == wowMain.Me.MapId)
{
select new DBQuest(quest, creatureStart, creatureEnd);
}
}
}