public static LootContainer GenerateButchery(byte creatureSubType, byte skillLv) { if (!ButcheryEntries.ContainsKey(creatureSubType)) { return(null); } if (skillLv > Program.Config.RankCap * 5) { skillLv = (byte)(Program.Config.RankCap * 5); } uint itemId = ButcheryEntries[creatureSubType][StaticRandom.Instance.Next(ButcheryEntries[creatureSubType].Count)] + (uint)Math.Min(8, skillLv / 25); return(new LootContainer { LootInfo = new List <LootInfo> { new LootInfo(ItemService.GetItem_Info(itemId)) } }); }
public static void GeneratePQuestObjective(PQuest_Objective Obj, PQuest_Info Q) { switch ((Objective_Type)Obj.Type) { case Objective_Type.QUEST_KILL_PLAYERS: { if (Obj.Description.Length < 1) { Obj.Description = "Enemy Players"; } } break; case Objective_Type.QUEST_SPEAK_TO: goto case Objective_Type.QUEST_KILL_MOB; case Objective_Type.QUEST_PROTECT_UNIT: goto case Objective_Type.QUEST_KILL_MOB; case Objective_Type.QUEST_KILL_MOB: { uint ObjID = 0; uint.TryParse(Obj.ObjectId, out ObjID); if (ObjID != 0) { Obj.Creature = CreatureService.GetCreatureProto(ObjID); } if (Obj.Description.Length < 1 && Obj.Creature != null) { Obj.Description = Obj.Creature.Name; } } break; case Objective_Type.QUEST_KILL_GO: { uint ObjID = 0; uint.TryParse(Obj.ObjectId, out ObjID); if (ObjID != 0) { Obj.GameObject = GameObjectService.GetGameObjectProto(ObjID); } if (Obj.Description.Length < 1 && Obj.GameObject != null) { Obj.Description = "Destroy " + Obj.Creature.Name; } } break; case Objective_Type.QUEST_USE_GO: { uint ObjID = 0; uint.TryParse(Obj.ObjectId, out ObjID); if (ObjID != 0) { Obj.GameObject = GameObjectService.GetGameObjectProto(ObjID); } if (Obj.Description.Length < 1 && Obj.GameObject != null) { Obj.Description = "Use " + Obj.GameObject.Name; } } break; case Objective_Type.QUEST_GET_ITEM: { uint ObjID = 0; uint.TryParse(Obj.ObjectId, out ObjID); if (ObjID != 0) { Obj.Item = ItemService.GetItem_Info(ObjID); } } break; } }