public int GetDrop(MapleCharacter killer) { var mi = MapleMonsterInformationProvider.Instance; var lastAssigned = -1; var minChance = 1; var dl = mi.RetrieveDropChances(Id); foreach (var d in dl) { if (d.Chance > minChance) { minChance = d.Chance; } } foreach (var d in dl) { d.AssignedRangeStart = lastAssigned + 1; d.AssignedRangeLength = (int)Math.Ceiling(1.0 / d.Chance * minChance); lastAssigned += d.AssignedRangeLength; } var c = (int)(Randomizer.NextDouble() * minChance); foreach (var d in dl) { var itemid = d.ItemId; if ((c >= d.AssignedRangeStart) && (c < d.AssignedRangeStart + d.AssignedRangeLength)) { if (d.QuestId != 0) { if (killer.GetQuest(MapleQuest.GetInstance(d.QuestId)).Status == MapleQuestStatusType.Started) { return(itemid); } } else { return(itemid); } } } return(-1); }
public bool IsQuestFinished(int id) => Player.GetQuest(MapleQuest.GetInstance(id)).Status == MapleQuestStatusType.Completed;
public bool IsQuestActive(int id) => Player.GetQuest(MapleQuest.GetInstance(id)).Status == MapleQuestStatusType.Started;
public MapleQuestStatusType GetQuestStatus(int id) => Player.GetQuest(MapleQuest.GetInstance(id)).Status;