Guest User

Untitled

a guest
Oct 21st, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. var quests =
  2. from quest in db.QuestTemplates
  3. where q.MinLevel <= wowMain.Me.Level + 2
  4. where (q.SpecialFlags == 0 || q.SpecialFlags == 4)
  5. where q.SuggestedPlayers <= 1
  6. where q.RequiredMaxRepFaction == 0
  7. where q.RequiredMinRepFaction == 0
  8. where q.RepObjectiveFaction == 0
  9. where q.LimitTime == 0
  10. where q.ReqSourceID1 == 0
  11. where q.ReqSpellCast1 == 0
  12.  
  13. let startEntry = db.CreatureQuestRelations.FirstOrDefault(a => a.Quest == quest.Entry)
  14. let endEntry = db.CreatureQuestRelations.FirstOrDefault(a => a.Quest == quest.Entry)
  15.  
  16. if (startEntry != null || endEntry != null)
  17. {
  18. let start = db.CreatureTemplates.FirstOrDefault(x => x.Entry == startEntry.ID)
  19. let end = db.CreatureTemplates.FirstOrDefault(x => x.Entry == endEntry.ID)
  20.  
  21. if (start != null || end != null)
  22. {
  23. let creatureStart = db.Creatures.FirstOrDefault(x => x.ID == start.Entry)
  24. let creatureEnd = db.Creatures.FirstOrDefault(x => x.ID == end.Entry)
  25.  
  26. if (creatureStart != null &&
  27. creatureEnd != null &&
  28. creatureStart.Map == wowMain.Me.MapId &&
  29. creatureEnd.Map == wowMain.Me.MapId)
  30. {
  31. select new DBQuest(quest, creatureStart, creatureEnd);
  32. }
  33. }
  34. }
Add Comment
Please, Sign In to add comment