コード例 #1
0
ファイル: GearButler.cs プロジェクト: Kkarinisme/GearTemp
        private void ButlerHudList_Click(object sender, int row, int col)
        {
            try
            {
                ButlerRow = ButlerHudList[row];
                int ItemGuid = Convert.ToInt32(((HudStaticText)ButlerRow[6]).Text);
                LootObject lo = new LootObject(Core.WorldFilter[ItemGuid]);

                if(col == 0)
                {
                    Host.Actions.SelectItem(lo.Id);
                }
                if(col == 1)
                {
                    try
                    {
                        if(GISettings.GSStrings){HudToChat(lo.GSReportString(), 2);}
                        if(GISettings.AlincoStrings){HudToChat(lo.LinkString(),2);}
                    }catch{}
                }
                if(col == 2)
                {
                    Core.Actions.MoveItem(lo.Id, Core.CharacterFilter.Id, 0, false);
                }
                if(col == 3)
                {
                    if(lo.LValue(LongValueKey.Unknown10) == 8)
                    {
                        if(!lo.Name.Contains("Mana Stone") || !lo.Name.Contains("Dessicant"))
                        {
                            Host.Actions.UseItem(lo.Id, 1);
                        }
                    }
                    else
                    {
                        Host.Actions.UseItem(lo.Id, 0);
                    }
                }
                if(col == 4)
                {
                    if(Core.WorldFilter[Core.Actions.CurrentSelection].ObjectClass == ObjectClass.Npc ||  Core.WorldFilter[Core.Actions.CurrentSelection].ObjectClass == ObjectClass.Player)
                    {
                       if(lo.LValue(LongValueKey.EquippedSlots) > 0 || lo.LValue(LongValueKey.Unknown10) == 56)
                       {
                           	WriteToChat("Unequip the item first.");
                       }
                       else
                       {
                       		Host.Actions.GiveItem(lo.Id, Host.Actions.CurrentSelection);
                       }
                    }
                    else
                    {
                        WriteToChat("First select an NPC, Player, or yourself.");
                    }
                }
                if(col == 5)
                {
                    if(bButlerTradeOpen)
                    {
                        Core.Actions.TradeAdd(lo.Id);
                    }
                    else if(Core.WorldFilter.OpenVendor.MerchantId != 0)
                    {
                       if(lo.LValue(LongValueKey.EquippedSlots) > 0 || lo.LValue(LongValueKey.Unknown10) == 56)
                       {
                           	WriteToChat("Unequip the item first.");
                       }
                       else
                       {
                       		Core.Actions.VendorAddSellList(lo.Id);
                       }
                    }
                }
            }
            catch (Exception ex) { LogError(ex); }
            return;
        }
コード例 #2
0
 private void CheckRare(ref LootObject IOItemRare)
 {
     try
     {
         if(IOItemRare.LValue(LongValueKey.RareId) > 0)
         {
             IOItemRare.IOR = IOResult.rare;
         }
     }catch(Exception ex){LogError(ex);}
 }
コード例 #3
0
        private bool MatchAdvanced(ItemRule rule, LootObject item)
        {
            bool result = false;
            bool[] tumbler = {false,false,false,false,false};
            List<int> ands = new List<int>();

            try
            {
                for(int i = 0; i < rule.Advanced.Count; i ++)
                {
                    if(rule.Advanced[i].keylink == 1) {ands.Add(i);}

                    if(rule.Advanced[i].keytype == 0)
                    {
                        switch(rule.Advanced[i].keycompare)
                        {
                            case 0:
                                if(item.DValue((DoubleValueKey)rule.Advanced[i].key) == rule.Advanced[i].keyvalue) {tumbler[i] = true;}
                                break;
                            case 1:
                                if(item.DValue((DoubleValueKey)rule.Advanced[i].key) != rule.Advanced[i].keyvalue) {tumbler[i] = true;}
                                break;
                            case 2:
                                if(item.DValue((DoubleValueKey)rule.Advanced[i].key) >= rule.Advanced[i].keyvalue) {tumbler[i] = true;}
                                break;
                            case 3:
                                if(item.DValue((DoubleValueKey)rule.Advanced[i].key) <= rule.Advanced[i].keyvalue) {tumbler[i] = true;}
                                break;
                        }
                    }
                    else if(rule.Advanced[i].keytype == 1)
                    {
                        switch(rule.Advanced[i].keycompare)
                        {
                            case 0:
                                if(item.LValue((LongValueKey)rule.Advanced[i].key) == rule.Advanced[i].keyvalue) {tumbler[i] = true;}
                                break;
                            case 1:
                                if(item.LValue((LongValueKey)rule.Advanced[i].key) != rule.Advanced[i].keyvalue) {tumbler[i] = true;}
                                break;
                            case 2:
                                if(item.LValue((LongValueKey)rule.Advanced[i].key) >= rule.Advanced[i].keyvalue) {tumbler[i] = true;}
                                break;
                            case 3:
                                if(item.LValue((LongValueKey)rule.Advanced[i].key) <= rule.Advanced[i].keyvalue) {tumbler[i] = true;}
                                break;
                        }
                    }
                }

                switch(rule.Advanced.Count)
                {
                    case 1:  //2 ^ 0 == 1
                        if(tumbler[0]) {result = true;}
                        break;
                    case 2:  //2 ^ 1 == 2
                        if(rule.Advanced[0].keylink == 1)
                        {
                            if(tumbler[0] && tumbler[1]) {result = true;}
                        }
                        else if(rule.Advanced[0].keylink == 2)
                        {
                            if(tumbler[0] || tumbler[1]) {result = true;}
                        }
                        break;
                    case 3:  //2 ^ 2 == 4
                        if(rule.Advanced[0].keylink == 1 && rule.Advanced[1].keylink == 1)
                        {
                            if(tumbler[0] && tumbler[1] && tumbler[2]) {result = true;}
                        }
                        else if(rule.Advanced[0].keylink == 1 && rule.Advanced[1].keylink == 2)
                        {
                            if((tumbler[0] && tumbler[1]) || tumbler[2]) {result = true;}
                        }
                        else if(rule.Advanced[0].keylink == 2 && rule.Advanced[1].keylink == 1)
                        {
                            if(tumbler[0] || (tumbler[1] && tumbler[2])) {result = true;}
                        }
                        else if(rule.Advanced[0].keylink == 2 && rule.Advanced[1].keylink == 2)
                        {
                            if(tumbler[0] || tumbler[1] || tumbler[2]) {result = true;}
                        }
                        break;
                    case 4:  //2 ^ 3 == 8
                        if(rule.Advanced[0].keylink == 1 && rule.Advanced[1].keylink == 1 && rule.Advanced[2].keylink == 1)
                        {
                            if(tumbler[0] && tumbler[1] && tumbler[2] && tumbler[3]) {result = true;}
                        }
                        else if(rule.Advanced[0].keylink == 1 && rule.Advanced[1].keylink == 1 && rule.Advanced[2].keylink == 2)
                        {
                            if((tumbler[0] && tumbler[1] && tumbler[2]) || tumbler[3]) {result = true;}
                        }
                        else if(rule.Advanced[0].keylink == 1 && rule.Advanced[1].keylink == 2 && rule.Advanced[2].keylink == 1)
                        {
                            if((tumbler[0] && tumbler[1]) || (tumbler[2] && tumbler[3])) {result = true;}
                        }
                        else if(rule.Advanced[0].keylink == 2 && rule.Advanced[1].keylink == 1 && rule.Advanced[2].keylink == 1)
                        {
                            if(tumbler[0] || (tumbler[1] && tumbler[2] && tumbler[3])) {result = true;}
                        }
                        else if(rule.Advanced[0].keylink == 1 && rule.Advanced[1].keylink == 2 && rule.Advanced[2].keylink == 2)
                        {
                            if((tumbler[0] && tumbler[1]) || tumbler[2] || tumbler[3]) {result = true;}
                        }
                        else if(rule.Advanced[0].keylink == 2 && rule.Advanced[1].keylink == 2 && rule.Advanced[2].keylink == 1)
                        {
                            if(tumbler[0] || tumbler[1] || (tumbler[2] && tumbler[3])) {result = true;}
                        }
                        else if(rule.Advanced[0].keylink == 2 && rule.Advanced[1].keylink == 2 && rule.Advanced[2].keylink == 2)
                        {
                            if(tumbler[0] || tumbler[1] || tumbler[2] || tumbler[3]) {result = true;}
                        }
                        else if(rule.Advanced[0].keylink == 2 && rule.Advanced[1].keylink == 1 && rule.Advanced[2].keylink == 2)
                        {
                            if(tumbler[0] || (tumbler[1] && tumbler[2]) || tumbler[3]) {result = true;}
                        }
                        break;
                    case 5:  //2 ^ 4 == 16
                        // 0 Or
                        if(rule.Advanced[0].keylink == 1 && rule.Advanced[1].keylink == 1 && rule.Advanced[2].keylink == 1 && rule.Advanced[3].keylink == 1)
                        {
                            if(tumbler[0] && tumbler[1] && tumbler[2] && tumbler[3] && tumbler[4]) {result = true;}
                        }

                        // 1 Or
                        if(rule.Advanced[0].keylink == 1 && rule.Advanced[1].keylink == 1 && rule.Advanced[2].keylink == 1 && rule.Advanced[3].keylink == 2)
                        {
                            if((tumbler[0] && tumbler[1] && tumbler[2] && tumbler[3]) || tumbler[4]) {result = true;}
                        }
                        if(rule.Advanced[0].keylink == 1 && rule.Advanced[1].keylink == 1 && rule.Advanced[2].keylink == 2 && rule.Advanced[3].keylink == 1)
                        {
                            if((tumbler[0] && tumbler[1] && tumbler[2]) || (tumbler[3] && tumbler[4])) {result = true;}
                        }
                        if(rule.Advanced[0].keylink == 1 && rule.Advanced[1].keylink == 2 && rule.Advanced[2].keylink == 1 && rule.Advanced[3].keylink == 1)
                        {
                            if((tumbler[0] && tumbler[1]) || (tumbler[2] && tumbler[3] && tumbler[4])) {result = true;}
                        }
                        if(rule.Advanced[0].keylink == 2 && rule.Advanced[1].keylink == 1 && rule.Advanced[2].keylink == 1 && rule.Advanced[3].keylink == 1)
                        {
                            if(tumbler[0] || (tumbler[1] && tumbler[2] && tumbler[3] && tumbler[4])) {result = true;}
                        }

                        // 2 Or
                        if(rule.Advanced[0].keylink == 1 && rule.Advanced[1].keylink == 1 && rule.Advanced[2].keylink == 2 && rule.Advanced[3].keylink == 2)
                        {
                            if((tumbler[0] && tumbler[1] && tumbler[2]) || tumbler[3] || tumbler[4]) {result = true;}
                        }
                        if(rule.Advanced[0].keylink == 1 && rule.Advanced[1].keylink == 2 && rule.Advanced[2].keylink == 2 && rule.Advanced[3].keylink == 1)
                        {
                            if((tumbler[0] && tumbler[1]) || tumbler[2] || (tumbler[3] && tumbler[4])) {result = true;}
                        }
                        if(rule.Advanced[0].keylink == 2 && rule.Advanced[1].keylink == 2 && rule.Advanced[2].keylink == 1 && rule.Advanced[3].keylink == 1)
                        {
                            if(tumbler[0] || tumbler[1] || (tumbler[2] && tumbler[3] && tumbler[4])) {result = true;}
                        }
                        if(rule.Advanced[0].keylink == 1 && rule.Advanced[1].keylink == 2 && rule.Advanced[2].keylink == 1 && rule.Advanced[3].keylink == 2)
                        {
                            if((tumbler[0] && tumbler[1]) || (tumbler[2] && tumbler[3]) || tumbler[4]) {result = true;}
                        }
                        if(rule.Advanced[0].keylink == 2 && rule.Advanced[1].keylink == 1 && rule.Advanced[2].keylink == 2 && rule.Advanced[3].keylink == 1)
                        {
                            if(tumbler[0] || (tumbler[1] && tumbler[2]) || (tumbler[3] && tumbler[4])) {result = true;}
                        }
                        if(rule.Advanced[0].keylink == 2 && rule.Advanced[1].keylink == 1 && rule.Advanced[2].keylink == 1 && rule.Advanced[3].keylink == 2)
                        {
                            if(tumbler[0] || (tumbler[1] && tumbler[2] && tumbler[3]) ||  tumbler[4]) {result = true;}
                        }

                        // 3 Or
                        if(rule.Advanced[0].keylink == 1 && rule.Advanced[1].keylink == 2 && rule.Advanced[2].keylink == 2 && rule.Advanced[3].keylink == 2)
                        {
                            if((tumbler[0] && tumbler[1]) || tumbler[2] || tumbler[3] || tumbler[4]) {result = true;}
                        }
                        if(rule.Advanced[0].keylink == 2 && rule.Advanced[1].keylink == 1 && rule.Advanced[2].keylink == 2 && rule.Advanced[3].keylink == 2)
                        {
                            if(tumbler[0] || (tumbler[1] && tumbler[2]) || tumbler[3] || tumbler[4]) {result = true;}
                        }
                        if(rule.Advanced[0].keylink == 2 && rule.Advanced[1].keylink == 2 && rule.Advanced[2].keylink == 2 && rule.Advanced[3].keylink == 1)
                        {
                            if(tumbler[0] || tumbler[1] || tumbler[2] || (tumbler[3] && tumbler[4])) {result = true;}
                        }
                        if(rule.Advanced[0].keylink == 2 && rule.Advanced[1].keylink == 2 && rule.Advanced[2].keylink == 1 && rule.Advanced[3].keylink == 2)
                        {
                            if(tumbler[0] || tumbler[1] || (tumbler[2] && tumbler[3]) || tumbler[4]) {result = true;}
                        }

                        // 4 Or
                        if(rule.Advanced[0].keylink == 2 && rule.Advanced[1].keylink == 2 && rule.Advanced[2].keylink == 2 && rule.Advanced[3].keylink == 2)
                        {
                            if(tumbler[0] || tumbler[1] || tumbler[2] || tumbler[3] || tumbler[4]) {result = true;}
                        }

                        break;
                }
            }catch(Exception ex){LogError(ex);}
            return result;
        }
コード例 #4
0
 private void CheckManaItem(ref LootObject IOItemMana)
 {
     try
     {
         if(GISettings.LootByMana == 0){return;}
         if(Core.WorldFilter.GetInventory().Where(x => x.ObjectClass == ObjectClass.ManaStone && x.Values(LongValueKey.IconOutline) == 0).Count() == 0){return;}
         if(IOItemMana.LValue(LongValueKey.CurrentMana) > GISettings.LootByMana)
         {
             IOItemMana.IOR = IOResult.manatank;
         }
     } catch(Exception ex){LogError(ex);}
 }
コード例 #5
0
        private void CheckValueItem(ref LootObject IOItemVal)
        {
            try
            {
                if(GISettings.LootByValue == 0){return;}

                if(IOItemVal.LValue(LongValueKey.Value) >= GISettings.LootByValue)
                {
                    if(GISettings.SalvageHighValue)
                    {
                        IOItemVal.IOR = IOResult.salvage;
                        IOItemVal.rulename = "Value";
                    }
                    else
                    {
                        IOItemVal.IOR = IOResult.val;
                    }
                }
            } catch(Exception ex){LogError(ex);}
        }