public void FairyEnchancementThead() { IsRun = true; FairyItem FFE = SelectFairyForEnchance(); if (FFE.id == 0) { return; } Thread.Sleep(1000); FairyItem F1 = GetEquiped(); while (LevelUpForSpirit()) { Thread.Sleep(2200); FairyItem F2 = GetEquiped(); if (F2.P1 > F1.P1) { RAS.Add(F2.P1 - F1.P1); break; } } Thread.Sleep(2000); FairyItem FF = GetEquiped(); if (!FF.IsGood() && FF.lvl < 100) { Detach(); } FairyEnchancementThead(); THH.SelfStop("FET:" + CHR.Name); IsRun = false; }
public static FairyItem LoadInventoryFairy(Item i) { int FIA = Memory.RD(i.CHR.HNDL, i.ptr + OFS.GetInt("Inventory_Item_Fairy_INF")); FairyItem NFI = new FairyItem(i.CHR); NFI.id = i.id; NFI.place = i.place; NFI.lvl = FIA & 0xFF; NFI.fsc = (FIA >> 16) & 0xFF; NFI.P1 = NFI.lvl < 10 ? 0 : NFI.fsc - NFI.lvl + 1; NFI.P2 = NFI.lvl < 10 ? 0 : (NFI.lvl / 10) * 10; return(NFI); }
public void LoadFairiesFromInventory() { CHR.INV.Load(); FL.Clear(); foreach (Item i in CHR.INV.IL) { if (i.id == 0 || i.ptr == 0 || i.type != 41) { continue; } FL.Add(FairyItem.LoadInventoryFairy(i)); } }
private void button5_Click(object sender, EventArgs e) { LTB.Clear(); LTB.AppendText("============== FAIRY ============\r\n"); FairyItem FFE = Client.CC.CHR.FAIRY.SelectFairyForEnchance(); foreach (FairyItem FI in Client.CC.CHR.FAIRY.FL) { LTB.AppendText("ID:" + FI.id + "\r\n"); LTB.AppendText("LVL:" + FI.lvl + "\r\n"); LTB.AppendText("===============================\r\n"); } LTB.AppendText("[SELECTED] ID:" + FFE.id + "\r\n"); LTB.AppendText("[SELECTED] LVL:" + FFE.lvl + "\r\n"); }
public Boolean LevelUpForSpirit() { FairyItem FI = GetEquiped(); if (!FI.IsGood()) { return(false); } int DSU = (int)((double)Level.EXP[FI.lvl] * 0.4 / (FI.lvl < 11 ? 0.5 : Math.Round((double)FI.lvl / (double)CHR.LVL, 2) * 5)); Packet P = new Packet(CHR.HNDL, "71-00-00-00-00-00-01"); P.Copy(DSU, 2, 4); P.Send(); return(true); }
public FairyItem SelectFairyForEnchance() { if (GetEquiped().id > 0) { int IP = CHR.INV.GetFirstFreePlace(); if (IP > 0) { Item.Equip(CHR.HNDL, IP, 0x17); } } Thread.Sleep(2000); LoadFairiesFromInventory(); FairyItem BEST = new FairyItem(CHR); FairyItem WORST = new FairyItem(CHR); BEST.P1 = 0; BEST.P2 = 1; WORST.P1 = 1; WORST.P2 = 1; int count = 0; foreach (FairyItem FI in FL) { if (FI.IsGood()) { if (FI.lvl < 10) { Item.Equip(CHR.HNDL, FI.place, 0x17); return(FI); } BEST = ((double)FI.P1 / (double)FI.P2 >= (double)BEST.P1 / (double)BEST.P2) ? FI : BEST; WORST = ((double)FI.P1 / (double)FI.P2 < (double)WORST.P1 / (double)WORST.P2) ? FI : WORST; count++; } } if (count == 0) { return(new FairyItem(CHR)); } BEST = BEST.id == 0 ? WORST : BEST; Boolean RA = RAS.Analize(); (RA ? WORST : BEST).Equip(0x17); return(RA ? WORST : BEST); }