예제 #1
0
 private void ClearFoundryAction(FoundryActionTypes CurrentAction)
 {
     FoundryActionList[(int)CurrentAction].FireAction = false;
     FoundryActionList[(int)CurrentAction].ActionStartTime = DateTime.MinValue;
     FoundryActionList[(int)CurrentAction].ToDoList.Clear();
     FoundryActionList[(int)CurrentAction].ToDoValetTicket.Clear();
 }
 private void FoundryAddToStorage(FoundryActionTypes CurrentAction)
 {
     try
     {
         FoundryAction FA = FoundryActionList[(int)CurrentAction];
         Core.Actions.MoveItem(FA.ToDoList[0], Core.Actions.OpenedContainer, 0, true);
     }catch(Exception ex){LogError(ex);}
 }
        private bool Foundry_NeedsMorePyreals(FoundryActionTypes CurrentAction)
        {
            try
            {
                FoundryAction FA = FoundryActionList[(int)CurrentAction];

                AetherFilter.Vendor.VendorItem vo = AetherTrade.VendorWindow.VendorItems.Where(x => x.Type == FA.ToDoList[0]).FirstOrDefault();

                if(vo != null && vo.Value * AetherTrade.VendorWindow.BuyFromVendorRate < mCurrentInventory.Pyreals) {return false;}

                SpellComp fsc = null;

                int CalculatedComponentsNeeded = 0;
                long MaximumPyrealsNeeded = 0;

                for(int i = FA.ToDoList.Count - 1; i >= 0; i--)
                {
                    vo = AetherTrade.VendorWindow.VendorItems.Where(x => x.Type == FA.ToDoList[i]).FirstOrDefault();
                    fsc = AetherCharacter.CharStats.FillSpellComps.Where(x => x.ComponentId == FA.ToDoList[i]).FirstOrDefault();

                    if(vo != null && fsc != null)
                    {
                        CalculatedComponentsNeeded = fsc.Total - mCurrentInventory.InvCountBytype(fsc.ComponentId);
                        MaximumPyrealsNeeded = (long)Math.Ceiling((double)vo.Value * AetherTrade.VendorWindow.BuyFromVendorRate * (double)CalculatedComponentsNeeded);
                    }
                }

                if(MaximumPyrealsNeeded > int.MaxValue || MaximumPyrealsNeeded > mCurrentInventory.Pyreals)
                {
                    Foundry_LoadAction(FoundryActionTypes.SellTradeNote, (int)MaximumPyrealsNeeded - mCurrentInventory.Pyreals);
                    return true;
                }
                return false;

            }catch(Exception ex)
            {
                LogError(ex);
                ClearFoundryAction(CurrentAction);
                return true;
            }
        }
        private bool Foundry_DoesNotNeedRevealing(FoundryActionTypes CurrentAction)
        {
            try
            {
                FoundryAction FA = FoundryActionList[(int)CurrentAction];

                for(int i = 0; i < FA.ToDoList.Count; i++)
                {
                    AetherObject ao = AetherObjects.Collection[FA.ToDoList[i]];
                    if(ao.Name != "Coalesced Aetheria")
                    {
                        LOHash.RemoveWhere(x => x.Id == ao.Id);
                        FA.ToDoList.RemoveAt(i);
                    }
                }

                if(FA.ToDoList.Count == 0){return true;}
                return false;
            }
            catch(Exception ex)
            {
                LogError(ex);
                ClearFoundryAction(CurrentAction);
                return true;
            }
        }
        private int Foundry_MatchKeyToChest(FoundryActionTypes CurrentAction)
        {
            try
            {
                FoundryAction FA = FoundryActionList[(int)CurrentAction];
                AetherObject Chest = AetherObjects.Collection[FA.ToDoList[0]];
                int ChestMatchIndex = mGeneralSettings.FoundrySettings.ChestKeyMatchList.FindIndex(x => @x.ChestName == @Chest.Name);

                if(ChestMatchIndex < 0)
                {
                    ClearFoundryAction(CurrentAction);
                    return 0;
                }

                int KeyMatch = 0;
                List<string> KeyNames = mGeneralSettings.FoundrySettings.ChestKeyMatchList[ChestMatchIndex].KeyNames;
                for(int i = 0; i < KeyNames.Count; i++)
                {
                    KeyMatch = mCurrentInventory.FindKey(@KeyNames[i]);
                    if(KeyMatch != 0) {break;}
                }

                if(KeyMatch == 0)
                {

                    if(mCurrentInventory.IntricateCarvingTool == 0)
                    {
                        WriteToChat("Character has no carving tool.  " + CurrentAction.ToString() + " disabled.");
                        ClearFoundryAction(CurrentAction);
                        return 0;
                    }

                    int KeyRingMatchIndex = mGeneralSettings.FoundrySettings.KeyRingMatchList.FindIndex(x => mGeneralSettings.FoundrySettings.ChestKeyMatchList[ChestMatchIndex].KeyNames.Contains(@x.KeyName));

                    if(KeyRingMatchIndex == -1){return 0;}

                    int RemoveKeyFromRing = mCurrentInventory.FindFilledKeyRing(@mGeneralSettings.FoundrySettings.KeyRingMatchList[KeyRingMatchIndex].RingName);

                    if(RemoveKeyFromRing == 0)
                    {
                        WriteToChat("Character has no matching ringed keys.  " + CurrentAction.ToString() + " disabled.");
                        ClearFoundryAction(CurrentAction);
                        return 0;
                    }
                    Foundry_LoadAction(FoundryActionTypes.CarvingTool, RemoveKeyFromRing);

                    return 0;
                }

                return KeyMatch;

            }catch(Exception ex)
            {
                LogError(ex);
                ClearFoundryAction(CurrentAction);
                return 0;
            }
        }
예제 #6
0
        private void Foundry_LoadAction(FoundryActionTypes action, int Id)
        {
            try
            {
                //Control of on/off actions is provided here by simply not loading disabled actions.
                if(!mGeneralSettings.FoundrySettings.FoundyEnabled) {return;}

                switch(action)
                {
                    case FoundryActionTypes.Salvage:
                        if(!mGeneralSettings.FoundrySettings.AutoSalvage)
                        {
                            return;
                        }
                        else
                        {
                            ToggleFoundryAction(FoundryActionTypes.OpenUst);
                        }
                        break;

                    case FoundryActionTypes.Cram:
                        if(!mGeneralSettings.FoundrySettings.AutoCram) {return;}
                        else {break;}

                    case FoundryActionTypes.Stack:
                        if(!mGeneralSettings.FoundrySettings.AutoStack) {return;}
                        else {break;}

                    case FoundryActionTypes.MoveToPack:
                        if(!mGeneralSettings.FoundrySettings.AutoMoveToPack) {return;}
                        else {break;}

                    case FoundryActionTypes.Read:
                        if(!mGeneralSettings.FoundrySettings.AutoReadScrolls) {return;}
                        else {break;}

                    case FoundryActionTypes.Desiccate:
                        if(!mGeneralSettings.FoundrySettings.AutoDessicateJunkLootAetheria) {return;}
                        else {break;}

                    case FoundryActionTypes.Reveal:
                        if(!mGeneralSettings.FoundrySettings.AutoRevealAetheria) {return;}
                        else {break;}

                    case FoundryActionTypes.ManaStone:
                        if(!mGeneralSettings.FoundrySettings.AutoDrainMana) {return;}
                        else {break;}

                    case FoundryActionTypes.CraftCombine:
                        if(!mGeneralSettings.FoundrySettings.AutoCraftCombine) {return;}
                        else {break;}

                    case FoundryActionTypes.CarvingTool:
                        if(!mGeneralSettings.FoundrySettings.AutoCraftCarve) {return;}
                        else {break;}

                    case FoundryActionTypes.RingKey:
                        if(!mGeneralSettings.FoundrySettings.AutoRingKeys) {return;}
                        else {break;}

                    case FoundryActionTypes.BuyTradeNote:
                    case FoundryActionTypes.SellItems:
                    case FoundryActionTypes.SellTradeNote:
                        ToggleFoundryAction(FoundryActionTypes.NetworkDelay2);
                        break;

                }

                FoundryActionList[(int)action].ToDoList.Add(Id);
                FoundryActionList[(int)action].FireAction = true;

                Foundry_ToggleCleanUp();

                InitiateFoundryActions();
            }catch(Exception ex){LogError(ex);}
        }
예제 #7
0
 private void SetFoundryAction(FoundryActionTypes CurrentAction)
 {
     FoundryActionList[(int)CurrentAction].ActionStartTime = DateTime.Now;
 }
 private bool Foundry_NothingOrNowhereToCram(FoundryActionTypes CurrentAction)
 {
     try
     {
         if(mCurrentInventory.MainPackItem == 0 ||mCurrentInventory.UnfilledPacks.Count == 0)
         {
             ClearFoundryAction(CurrentAction);
             return  true;
         }
         else{return false;}
     }
     catch(Exception ex)
     {
         LogError(ex);
         ClearFoundryAction(CurrentAction);
         return true;
     }
 }
예제 #9
0
        private void ToggleFoundryAction(FoundryActionTypes action)
        {
            switch(action)
            {
                case FoundryActionTypes.Cram:
                    if(!mGeneralSettings.FoundrySettings.AutoCram) {return;}
                    else {break;}

                case FoundryActionTypes.Stack:
                    if(!mGeneralSettings.FoundrySettings.AutoStack) {return;}
                    else {break;}

                case FoundryActionTypes.BuyTradeNote:
                case FoundryActionTypes.SellItems:
                case FoundryActionTypes.SellTradeNote:
                    ToggleFoundryAction(FoundryActionTypes.NetworkDelay2);
                    break;
            }

            FoundryActionList[(int)action].FireAction = true;
            Foundry_ToggleCleanUp();

            InitiateFoundryActions();
        }
 private bool Foundry_HasNoUst(FoundryActionTypes CurrentAction)
 {
     try
     {
         if(mCurrentInventory.Ust == 0)
         {
             ClearFoundryAction(FoundryActionTypes.OpenUst);
             ClearFoundryAction(FoundryActionTypes.Salvage);
             WriteToChat("Character has no ust!  Salvaging disabled.");
             return true;
         }
         return false;
     }
     catch(Exception ex)
     {
         LogError(ex);
         ClearFoundryAction(CurrentAction);
         return true;
     }
 }
        private bool Foundry_HasPurchasedEnough(FoundryActionTypes CurrentAction)
        {
            try
            {
                FoundryAction FA = FoundryActionList[(int)CurrentAction];
                for(int i = FA.ToDoList.Count - 1; i >= 0; i--)
                {
                    if(mCurrentInventory.InvCountBytype(FA.ToDoList[i]) >= AetherCharacter.CharStats.FillSpellComps.Where(x => x.ComponentId == FA.ToDoList[i]).First().Total)
                    {
                        FA.ToDoList.RemoveAt(i);
                    }
                }

                if(FA.ToDoList.Count == 0)
                {
                    ClearFoundryAction(CurrentAction);
                    ToggleFoundryAction(FoundryActionTypes.BuyTradeNote);
                    return true;
                }
                return false;
            }catch(Exception ex){LogError(ex); return true;}
        }
 private bool Foundry_HasNoEmptyManaStones(FoundryActionTypes CurrentAction)
 {
     try
     {
         if(mCurrentInventory.EmptyManaStones == 0)
         {
             WriteToChat("Character has no empty Mana Stones!");
             ClearFoundryAction(CurrentAction);
             return true;
         }
         return false;
     }
     catch(Exception ex)
     {
         LogError(ex);
         ClearFoundryAction(CurrentAction);
         return true;
     }
 }
 private bool Foundry_HasNoLockpicks(FoundryActionTypes CurrentAction)
 {
     try
     {
         if(mCurrentInventory.Lockpick == 0)
         {
             WriteToChat("Character has no lockpicks.");
             ClearFoundryAction(CurrentAction);
             return true;
         }
         return false;
     }
     catch(Exception ex)
     {
         LogError(ex);
         ClearFoundryAction(CurrentAction);
         return true;
     }
 }
 private bool Foundry_HasNoDesiccant(FoundryActionTypes CurrentAction)
 {
     try
     {
         if(mCurrentInventory.Dessicant == 0)
         {
             WriteToChat("Character has no Aetheria Desiccant!");
             ClearFoundryAction(CurrentAction);
             return true;
         }
         return false;
     }
     catch(Exception ex)
     {
         LogError(ex);
         ClearFoundryAction(CurrentAction);
         return true;
     }
 }
 private bool Foundry_HasNoCarvingTool(FoundryActionTypes CurrentAction)
 {
     try
     {
         if(mCurrentInventory.IntricateCarvingTool == 0)
         {
             WriteToChat("Character has no carving tool.");
             ClearFoundryAction(CurrentAction);
             return true;
         }
         return false;
     }
     catch(Exception ex)
     {
         LogError(ex);
         ClearFoundryAction(CurrentAction);
         return true;
     }
 }
 private bool Foundry_HasNoAetheriaManaStone(FoundryActionTypes CurrentAction)
 {
     try
     {
         if(mCurrentInventory.AetheriaManaStone == 0)
         {
             WriteToChat("Character has Aetheria Mana Stone.");
             ClearFoundryAction(CurrentAction);
             return true;
         }
         return false;
     }
     catch(Exception ex)
     {
         LogError(ex);
         ClearFoundryAction(CurrentAction);
         return true;
     }
 }
        private bool Foundry_NeedsMoreTradeNotes(FoundryActionTypes CurrentAction)
        {
            try
            {
                FoundryAction FA = FoundryActionList[(int)CurrentAction];

                if(FA.ToDoList[0] <= mCurrentInventory.AllTradeNotesValue){	return false;}

                WriteToChat("Insufficient trade notes to purchase components.  Actions disabled.");
                ClearFoundryAction(CurrentAction);
                ClearFoundryAction(FoundryActionTypes.PurchaseComponents);
                return true;

            }catch(Exception ex)
            {
                LogError(ex);
                ClearFoundryAction(CurrentAction);
                return true;
            }
        }
 private bool Foundry_HasSufficentPyreals(FoundryActionTypes CurrentAction)
 {
     try
     {
         FoundryAction FA = FoundryActionList[(int)CurrentAction];
         if(mCurrentInventory.Pyreals >= FA.ToDoList[0])
         {
             ClearFoundryAction(CurrentAction);
             return true;
         }
         return false;
     }
     catch(Exception ex)
     {
         LogError(ex);
         ClearFoundryAction(CurrentAction);
         return true;
     }
 }
 private bool Foundry_NoMatchingKeyRings(FoundryActionTypes CurrentAction)
 {
     try
     {
         FoundryAction FA = FoundryActionList[(int)CurrentAction];
         for(int i = FA.ToDoList.Count - 1; i >= 0; i--)
         {
             if(Foundry_MatchKeyToKeyring(FA.ToDoList[i]) == 0){FA.ToDoList.RemoveAt(i);}
         }
         if(FA.ToDoList.Count == 0)
         {
             WriteToChat("Character has no matching keyrings.  Ringing of key disabled.");
             return true;
         }
         return false;
     }
     catch(Exception ex)
     {
         ClearFoundryAction(CurrentAction);
         LogError(ex);
         return true;
     }
 }
        private bool Foundry_InventoryIsFull(FoundryActionTypes CurrentAction)
        {
            try
            {
                int spacesneeded = 2;
                FoundryAction FA = FoundryActionList[(int)CurrentAction];

                if(CurrentAction == FoundryActionTypes.SellTradeNote)
                {
                    spacesneeded = (int)Math.Ceiling((double)FA.ToDoList[0]/25000d);
                }

                if(mCurrentInventory.InventorySpacesAvailable <  spacesneeded)
                {
                    WriteToChat("Inventory is full.  " + CurrentAction.ToString() + " cleared.");
                    ClearFoundryAction(CurrentAction);
                    return true;
                }
                if(mCurrentInventory.MainPackSpacesAvailable <  spacesneeded)
                {
                    if(mGeneralSettings.FoundrySettings.AutoStack && mCurrentInventory.StackForSpace)
                    {
                        foreach(AetherObject ao in AetherObjects.GetUnstackedInventory()){Foundry_LoadAction(FoundryActionTypes.Stack, ao.Id);}
                        return false;
                    }
                    else if(mGeneralSettings.FoundrySettings.AutoCram && mCurrentInventory.UnfilledPacks.Count > 0){ToggleFoundryAction(FoundryActionTypes.Cram); return false;}
                    else
                    {
                        WriteToChat(CurrentAction.ToString() + " disabled due to insufficent pack space.");
                        if(!mGeneralSettings.FoundrySettings.AutoStack)
                        {
                            WriteToChat("AutoStack is disabled in the Foundry tab and could have improved pack management.");
                        }
                        if(!mGeneralSettings.FoundrySettings.AutoCram)
                        {
                            WriteToChat("AutoCram is disabled in the Foundry tab and could have improved pack management.");
                        }
                        ClearFoundryAction(CurrentAction);
                        return true;
                    }
                }
                return false;
            }
            catch(Exception ex)
            {
                LogError(ex);
                ClearFoundryAction(CurrentAction);
                return true;
            }
        }
 private bool Foundry_NothingToDoCheck(FoundryActionTypes CurrentAction)
 {
     try
     {
         FoundryAction FA = FoundryActionList[(int)CurrentAction];
         for(int i = 0; i < FA.ToDoList.Count; i++)
         {
             if(!AetherObjects.IsValid(FA.ToDoList[i])){FA.ToDoList.RemoveAt(i);}
         }
         if(FA.ToDoList.Count == 0)
         {
             ClearFoundryAction(CurrentAction);
             return true;
         }
         else
         {
             return false;
         }
     }
     catch(Exception ex)
     {
         LogError(ex);
         ClearFoundryAction(CurrentAction);
         return true;
     }
 }
 private bool Foundry_IsInInventoryCheck(FoundryActionTypes CurrentAction)
 {
     try
     {
         FoundryAction FA = FoundryActionList[(int)CurrentAction];
         for(int i = 0; i < FA.ToDoList.Count; i++)
         {
             if(AetherObjects.IsInInventory(FA.ToDoList[i]))
             {
                 SynchWithLOHash(FA.ToDoList[i]);
                 FA.ToDoList.RemoveAt(i);
             }
         }
         if(FA.ToDoList.Count == 0)
         {
             ClearFoundryAction(CurrentAction);
             return true;
         }
         return false;
     }
     catch(Exception ex)
     {
         LogError(ex);
         ClearFoundryAction(CurrentAction);
         return true;
     }
 }
예제 #23
0
        private void FoundryLoadBypassAction(FoundryActionTypes action, int Id)
        {
            try
            {
                if(!mGeneralSettings.FoundrySettings.FoundyEnabled) {return;}
                if(action == FoundryActionTypes.Salvage) {ToggleFoundryAction(FoundryActionTypes.OpenUst);}

                FoundryActionList[(int)action].ToDoList.Add(Id);
                FoundryActionList[(int)action].FireAction = true;

                InitiateFoundryActions();
            }catch(Exception ex){LogError(ex);}
        }
예제 #24
0
        private void FoundryLoadAction(FoundryActionTypes action, List<int> Ids)
        {
            try
            {
                if(action == FoundryActionTypes.Salvage || action == FoundryActionTypes.SalvageCombine)
                {
                    FoundryToggleAction(FoundryActionTypes.OpenUst);
                }

                int index =  FoundryActionList.FindIndex(x => x.Action == action);
                FoundryActionList[index].FireAction = true;
                FoundryActionList[index].ToDoStack.Add(Ids);
            }catch(Exception ex){LogError(ex);}
        }
예제 #25
0
        private void Foundry_LoadAction(FoundryActionTypes action, List<ValetTicket> VTickets)
        {
            try
            {
                FoundryActionList[(int)action].ToDoValetTicket.AddRange(VTickets.OrderBy(x => x.Priority));
                FoundryActionList[(int)action].FireAction = true;

                Foundry_ToggleCleanUp();

                InitiateFoundryActions();
            }catch(Exception ex){LogError(ex);}
        }
 private void Foundry_CramItems(FoundryActionTypes CurrentAction)
 {
     try
     {
         FoundryAction FA = FoundryActionList[(int)CurrentAction];
         SetFoundryAction(CurrentAction);
         FoundryMoveItem(mCurrentInventory.MainPackItem, mCurrentInventory.UnfilledPacks.First());
     }
     catch(Exception ex)
     {
         LogError(ex);
     }
 }
 private bool Foundry_IsOpenChest(FoundryActionTypes CurrentAction)
 {
     try
     {
         if(Core.Actions.OpenedContainer == 0)
         {
             if(ToggleNetworkDelay)
             {
                 ToggleNetworkDelay = false;
                 ToggleFoundryAction(FoundryActionTypes.NetworkDelay2);
                 return true;
             }
             return false;
         }
         string containername = AetherObjects.Collection[Core.Actions.OpenedContainer].Name;
         if(containername.Contains("Chest") || containername.Contains("Vault") ||  containername.Contains("Reliquary"))
         {
             if(Foundry_CheckAutoClose()){return true;}
             else
             {
                 ToggleNetworkDelay = true;
                 return true;
             }
         }
         return false;
     }catch(Exception ex)
     {
         LogError(ex);
         ClearFoundryAction(CurrentAction);
         return false;
     }
 }
 private bool Foundry_DoesNotHaveTwo(FoundryActionTypes CurrentAction)
 {
     try
     {
         FoundryAction FA = FoundryActionList[(int)CurrentAction];
         for(int i = FA.ToDoList.Count - 1; i >= 0; i --)
         {
             if(!mCurrentInventory.HasTwo(FA.ToDoList[i])){FA.ToDoList.RemoveAt(i);}
         }
         if(FA.ToDoList.Count == 0){return true;}
         return false;
     }
     catch(Exception ex)
     {
         LogError(ex);
         ClearFoundryAction(CurrentAction);
         return true;
     }
 }
예제 #29
0
 private void FoundryToggleAction(FoundryActionTypes action)
 {
     FoundryActionList.Find(x => x.Action == action).FireAction = true;
 }
        private bool Foundry_ItemIsNotLocked(FoundryActionTypes CurrentAction)
        {
            try
            {
                FoundryAction FA = FoundryActionList[(int)CurrentAction];
                AetherObject ao = AetherObjects.Collection[FA.ToDoList[0]];

                if(ao.Values(ABoolValueKeys.Locked)){return false;}

                if(ao.ObjectClass == AObjectClass.Door){Foundry_LoadAction(FoundryActionTypes.UseLandscape, ao.Id);}
                if(ao.ObjectClass == AObjectClass.Container){Foundry_LoadAction(FoundryActionTypes.OpenContainer, ao.Id);}
                ClearFoundryAction(CurrentAction);
                return true;
            }
            catch(Exception ex)
            {
                LogError(ex);
                ClearFoundryAction(CurrentAction);
                return true;
            }
        }