Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var questTemplates =
- 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;
- var _startEntry = quest => db.CreatureQuestRelations.FirstOrDefault(a => a.Quest == quest.Entry);
- var _endEntry = quest => db.CreatureQuestRelations.FirstOrDefault(a => a.Quest == quest.Entry);
- var _start = startEntry => db.CreatureTemplates.FirstOrDefault(x => x.Entry == startEntry.ID);
- var _end = endEntry => db.CreatureTemplates.FirstOrDefault(x => x.Entry == endEntry.ID);
- var _creatureStart = start => db.Creatures.FirstOrDefault(x => x.ID == start.Entry);
- var _creatureEnd = end => db.Creatures.FirstOrDefault(x => x.ID == end.Entry);
- var _mapStart = creatureStart => creatureStart.Map == wowMain.Me.MapId;
- var _mapEnd = creatureEnd => creatureEnd.Map == wowMain.Me.MapId;
- var quests =
- from quest in questTemplates
- let creatureStart = _creatureStart(_start(_startEntry(quest)))
- let creatureEnd = _creatureEnd(_end(_endEntry(quest)))
- select DBQuest
- {
- Quest = quest,
- CreatureStart = _mapStart(creatureStart) ? creatureStart : null,
- CreatureEnd = _mapEnd(creatureEnd) ? creatureEnd : null
- }
Add Comment
Please, Sign In to add comment