Exemple #1
0
 private bool TryGettingLootFor(int npcNetId, int timesMultiplier, out string outputText)
 {
   SimulatorInfo info = new SimulatorInfo();
   NPC npc = new NPC();
   npc.SetDefaults(npcNetId, new NPCSpawnParams());
   info.npcVictim = npc;
   LootSimulationItemCounter simulationItemCounter = new LootSimulationItemCounter();
   info.itemCounter = simulationItemCounter;
   foreach (ISimulationConditionSetter neededTestCondition in this._neededTestConditions)
   {
     neededTestCondition.Setup(info);
     int amount = neededTestCondition.GetTimesToRunMultiplier(info) * timesMultiplier;
     for (int index = 0; index < amount; ++index)
       npc.NPCLoot();
     simulationItemCounter.IncreaseTimesAttempted(amount, info.runningExpertMode);
     neededTestCondition.TearDown(info);
     this.SetCleanSlateWorldConditions();
   }
   simulationItemCounter.Exclude(((IEnumerable<int>) this._excludedItemIds).ToArray<int>());
   string str1 = simulationItemCounter.PrintCollectedItems(false);
   string str2 = simulationItemCounter.PrintCollectedItems(true);
   string str3 = string.Format("FindEntryByNPCID(NPCID.{0})", (object) NPCID.Search.GetName(npcNetId));
   if (str1.Length > 0)
     str3 = string.Format("{0}\n.AddDropsNormalMode({1})", (object) str3, (object) str1);
   if (str2.Length > 0)
     str3 = string.Format("{0}\n.AddDropsExpertMode({1})", (object) str3, (object) str2);
   string str4 = str3 + ";";
   outputText = str4;
   return str1.Length > 0 || str2.Length > 0;
 }
Exemple #2
0
        private bool TryGettingLootFor(int npcNetId, int timesMultiplier, out string outputText)
        {
            SimulatorInfo simulatorInfo = new SimulatorInfo();
            NPC           nPC           = new NPC();

            nPC.SetDefaults(npcNetId);
            simulatorInfo.npcVictim = nPC;
            LootSimulationItemCounter lootSimulationItemCounter = simulatorInfo.itemCounter = new LootSimulationItemCounter();

            foreach (ISimulationConditionSetter neededTestCondition in _neededTestConditions)
            {
                neededTestCondition.Setup(simulatorInfo);
                int num = neededTestCondition.GetTimesToRunMultiplier(simulatorInfo) * timesMultiplier;
                for (int i = 0; i < num; i++)
                {
                    nPC.NPCLoot();
                }
                lootSimulationItemCounter.IncreaseTimesAttempted(num, simulatorInfo.runningExpertMode);
                neededTestCondition.TearDown(simulatorInfo);
                SetCleanSlateWorldConditions();
            }
            lootSimulationItemCounter.Exclude(_excludedItemIds.ToArray());
            string text  = lootSimulationItemCounter.PrintCollectedItems(expert: false);
            string text2 = lootSimulationItemCounter.PrintCollectedItems(expert: true);
            string name  = NPCID.Search.GetName(npcNetId);
            string text3 = $"FindEntryByNPCID(NPCID.{name})";

            if (text.Length > 0)
            {
                text3 = $"{text3}\n.AddDropsNormalMode({text})";
            }
            if (text2.Length > 0)
            {
                text3 = $"{text3}\n.AddDropsExpertMode({text2})";
            }
            text3 = (outputText = text3 + ";");
            if (text.Length <= 0)
            {
                return(text2.Length > 0);
            }
            return(true);
        }