예제 #1
0
        //---------------------------------------------------------------------------------------------

        public static string GetGlobalConfigValueOrDefault(string xpath, string attrName, string defaultValue)
        {
            XmlDocument doc = CalebConfig.GlobalDocument;

            if (doc != null)
            {
                XmlElement itm = doc.DocumentElement.SelectSingleNode(xpath) as XmlElement;
                if (itm != null && itm.HasAttribute(attrName))
                {
                    try
                    {
                        string strval = itm.GetAttribute(attrName);
                        return(strval);
                    }
                    catch (Exception ex)
                    {
                        if (Game.Debug)
                        {
                            Notepad.WriteLine("GetGlobalConfigValueOrDefault ex: " + ex.Message);
                        }
                    }
                }
                else
                {
                    if (Game.Debug)
                    {
                        Notepad.WriteLine("GetGlobalConfigValueOrDefault !itm: " + xpath + " HasAttribute: " + attrName);
                    }
                }
            }
            return(defaultValue);
        }
예제 #2
0
        public SupplyCounter(UOObject container, List <UOItemTypeBase> types)
        {
            this.types = new List <UOItemTypeBase>();
            if (!container.Serial.IsValid)
            {
                throw new ArgumentException("container");
            }

            this.container = container;
            //this.type = type;
            //this.color = color;
            this.types.AddRange(types.ToArray());

            if (container is UOItem)
            {
                collection = ((UOItem)container).AllItems;
            }
            else if (container is UOCharacter)
            {
                collection = ((UOCharacter)container).Layers;

                if (Track)
                {
                    Notepad.WriteLine("Layers " + ((UOCharacter)container).Layers.Count());
                }
            }
            else
            {
                throw new ArgumentException("Invalid container type.");
            }

            container.Changed += new ObjectChangedEventHandler(container_Changed);
            // Init count
            Recalc();
        }
예제 #3
0
        public static void PrintRealDistance()
        {
            World.Player.Print("[Vyber ..]");

            var o = Targeting.GetTarget(null);

            Notepad.WriteLine(String.Format("Serial: {0:X} RealDistance: {1:N10}", o.Object.Serial, o.Object.GetDistance()));
        }
예제 #4
0
 public static void PrintInfo(TargetInfo info)
 {
     //Notepad.WriteLine(format, target.X, target.Y, target.Z, target.Graphic, name);
     //Notepad.WriteLine();
     Notepad.WriteLine("TargetInfo.Success: " + info.Success);
     Notepad.WriteLine("TargetInfo.TargetType: " + info.TargetType);
     Notepad.WriteLine("TargetInfo.X: " + info.StaticTarget.X);
     Notepad.WriteLine("TargetInfo.Y: " + info.StaticTarget.Y);
     Notepad.WriteLine("TargetInfo.Z: " + info.StaticTarget.Z);
     Notepad.WriteLine("TargetInfo.Position: " + info.Position);
     Notepad.WriteLine("TargetInfo.Distance: " + info.Object.Distance);
     Notepad.WriteLine("TargetInfo.Position.Distance: " + info.Position.Distance());
     Notepad.WriteLine("TargetInfo.Position.RealDistance: " + String.Format("{0:n2}", info.Position.RealDistance()));
     Notepad.WriteLine("TargetInfo.Graphic: " + info.StaticTarget.Graphic);
     Notepad.WriteLine("TargetInfo.Serial: " + info.StaticTarget.Serial);
     Notepad.WriteLine("TargetInfo.Serial.IsValidCust: " + ((Serial)info.StaticTarget.Serial).IsValidCust());
     Notepad.WriteLine();
 }
예제 #5
0
        public static void PrintAllTreesCount(int radius)
        {
            IRequestResult r = UO.WaitTargetTile(3348, 339, 4, Graphic.Invariant);

            UO.UseType(0x0F9E);
            //IClientTarget target = UIManager.Target();

            StaticTarget target = ((StaticTarget)r.GetType().GetField("Target").GetValue(r));


            {
                string name = null;
                if (target.Graphic != 0 && target.Graphic < DataFiles.Tiledata.Count)
                {
                    name = DataFiles.Tiledata.GetArt(target.Graphic).Name;
                }

                string format = "Tile X={0} Y={1} Z={2} Graphic=0x{3:X4}";
                if (name != null && name.Length > 0)
                {
                    format += " Name={4}";
                }

                UO.Print(format, target.X, target.Y, target.Z, target.Graphic, name);
            }
            // UO.Print(((StaticTarget)r.GetType().GetField("Target").GetValue(r))+ "" + " / " + Graphic.Invariant);

            {
                string name = null;
                if (target.Graphic != 0 && target.Graphic < DataFiles.Tiledata.Count)
                {
                    name = DataFiles.Tiledata.GetArt(target.Graphic).Name;
                }

                string format = "Tile X={0} Y={1} Z={2} Graphic=0x{3:X4}";
                if (name != null && name.Length > 0)
                {
                    format += " Name={4}";
                }

                Notepad.WriteLine(format, target.X, target.Y, target.Z, target.Graphic, name);
                Notepad.WriteLine();
            }
        }
예제 #6
0
        /// <summary>
        /// Prepocita to.
        /// </summary>
        public void Recalc()
        {
            lock (this)
            {
                // Reset
                foreach (var item in tracked.Values)
                {
                    item.Changed -= new ObjectChangedEventHandler(item_Changed);
                }
                tracked.Clear();

                int a = 0;

                if (Track)
                {
                    Notepad.WriteLine("collection " + collection.Count());
                }
                // Calculate
                foreach (var item in collection)
                {
                    int foundTypes = this.types.Count(i => i.Graphic == item.Graphic && i.Color == item.Color);
                    //if (item.Graphic != type || item.Color != color)

                    if (foundTypes <= 0)
                    {
                        continue;
                    }

                    if (Track)
                    {
                        Notepad.WriteLine("tracked add " + item.Description);
                    }

                    tracked.Add(item.Serial, item);
                    a += (item.Amount == 0 ? 1 : item.Amount);
                }

                amount = a;
            }

            // Fire event
            OnAmountChanged(EventArgs.Empty);
        }
예제 #7
0
        protected void RefreshForms()
        {
            if (refreshing)
            {
                return;
            }

            if (InvokeRequired)
            {
                BeginInvoke(new ThreadStart(RefreshForms));
                return;
            }

            refreshing = true;
            try
            {
                List <Serial> refresSerials  = new List <Serial>();
                List <Serial> currentChars   = new List <Serial>();
                WindowManager defaultManager = WindowManager.GetDefaultManager();

                //lock (this.SyncRoot)
                //{
                for (int i = this.toDispatchSerials.Count - 1; i >= 0; i--)
                {
                    Serial s = this.toDispatchSerials[i];
                    if (StatusWrapper.GetWrapperType(s) == this.WrapperType)
                    {
                        currentChars.Add(s);
                    }


                    UOCharacter ch = new UOCharacter(s);

                    if (!ch.Exist || ch.Distance > 30)
                    {
                        this.toDispatchSerials.RemoveAt(i);
                    }
                }
                //  }

                List <StatusForm> forms = WindowManager.GetDefaultManager().OwnedWindows.OfType <StatusForm>().Where(f => this.WrapperType == StatusWrapper.GetWrapperType(f.MobileId) && !currentChars.Contains(f.MobileId)).ToList();
                foreach (StatusForm sf in forms)
                {
                    if (sf.Manual)
                    {
                        currentChars.Insert(0, sf.MobileId);
                    }
                    else
                    {
                        currentChars.Add(sf.MobileId);
                    }
                }

                currentChars = SortChars(currentChars);

                List <Serial> dummy = new List <Serial>();
                dummy.AddRange(currentChars.ToArray());

                List <Serial> filteredSorted = new List <Serial>();
                filteredSorted.AddRange(currentChars.ToArray());
                filteredSorted = filteredSorted.Where(s => WindowManager.GetDefaultManager().OwnedWindows.OfType <StatusForm>().Where(f => f.MobileId == s && (f.Keep || f.MouseHovering || f.Manual)).ToArray().Length > 0).ToList();

                Dictionary <Serial, int> order = new Dictionary <Serial, int>();

                for (int i = filteredSorted.Count - 1; i >= 0; i--)
                {
                    Serial s        = filteredSorted[i];
                    int    priority = 0;

                    StatusForm sf = WindowManager.GetDefaultManager().OwnedWindows.OfType <StatusForm>().Where(f => f.MobileId == s).FirstOrDefault();
                    if (sf != null)
                    {
                        if (sf.MouseHovering)
                        {
                            priority += 10000;
                        }

                        if (sf.Keep)
                        {
                            priority += 1000;
                        }

                        if (sf.Manual)
                        {
                            priority += 100;
                        }

                        if (!order.ContainsKey(s))
                        {
                            order.Add(s, priority);
                        }
                    }
                    else
                    {
                        filteredSorted.RemoveAt(i);
                    }
                }

                filteredSorted = filteredSorted.OrderByDescending(s => order[s]).ToList();

                currentChars = new List <Serial>();
                currentChars.AddRange(filteredSorted.ToArray());

                foreach (Serial s in dummy)
                {
                    if (!currentChars.Contains(s))
                    {
                        currentChars.Add(s);
                    }
                }

                int addCounter = 0;
                for (int i = 0; i < currentChars.Count && addCounter < this.MaxBars /*Math.Min(currentChars.Count, this.MaxBars)*/; i++)
                {
                    UOCharacter ch = new UOCharacter(currentChars[i]);
                    StatusForm  sf = WindowManager.GetDefaultManager().OwnedWindows.OfType <StatusForm>().Where(f => f.MobileId == ch.Serial).FirstOrDefault();

                    if (sf != null || this.Auto)
                    {
                        bool add = (sf == null || !sf.DisableWrapper) && ch.Distance < 25 && ch.Exist || sf != null && (sf.Keep || sf.IsNew || sf.MouseHovering) && !sf.DisableWrapper;

                        if (add)
                        {
                            addCounter++;
                            refresSerials.Add(ch.Serial);

                            if (sf == null)
                            {
                                defaultManager.CreateWindow(delegate()
                                {
                                    var f          = new StatusForm(ch.Serial);
                                    f.Transparency = true;
                                    return(f);
                                });
                            }
                        }
                        else if (sf != null && !sf.DisableWrapper && !sf.Keep && !sf.MouseHovering)
                        {
                            if (defaultManager.InvokeRequired)
                            {
                                defaultManager.BeginInvoke(sf.Close);
                            }
                            else
                            {
                                sf.Close();
                            }
                        }
                    }
                }

                if (this.Auto)//??
                {
                    List <StatusForm> delete = WindowManager.GetDefaultManager().OwnedWindows.OfType <StatusForm>().Where(sf => sf.MobileId != World.Player.Serial && StatusWrapper.GetWrapperType(sf.MobileId) == this.WrapperType && !refresSerials.Contains(sf.MobileId) && !sf.DisableWrapper && !sf.Keep && !sf.MouseHovering).ToList();
                    foreach (StatusForm sf in delete)
                    {
                        if (defaultManager.InvokeRequired)
                        {
                            defaultManager.BeginInvoke(sf.Close);
                        }
                        else
                        {
                            sf.Close();
                        }
                    }
                }

                int y = this.Location.Y + this.Height;
                int x = this.Location.X;

                Dictionary <int, Serial> slots = new Dictionary <int, Serial>();
                List <int> slotPointer         = new List <int>();

                for (int i = 0; i < this.MaxBars; i++)
                {
                    int slotY = y + (i * StatusForm.DefaultHeight);
                    slotPointer.Add(slotY);
                    slots.Add(slotY, (Serial)Serial.Invalid);
                }

                StatusForm disabledSlot = WindowManager.GetDefaultManager().OwnedWindows.OfType <StatusForm>().Where(f => refresSerials.Contains(f.MobileId) && f.MouseHovering).FirstOrDefault();

                if (disabledSlot != null && slots.ContainsKey(disabledSlot.Location.Y))
                {
                    slots[disabledSlot.Location.Y] = disabledSlot.MobileId;
                }

                // refresSerials = SortChars(refresSerials);

                for (int i = 0; i < refresSerials.Count; i++)
                {
                    Serial     s  = refresSerials[i];
                    StatusForm sf = WindowManager.GetDefaultManager().OwnedWindows.OfType <StatusForm>().Where(f => f.MobileId == s).FirstOrDefault();

                    if (sf != null)
                    {
                        for (int u = 0; u < slotPointer.Count; u++)
                        {
                            int    slotY  = slotPointer[u];
                            Serial slotId = slots[slotY];

                            if (!slotId.IsValid && slots.Values.Count(sv => sv == sf.MobileId) == 0 || slotId == sf.MobileId)
                            {
                                if (sf.Location.X != x || sf.Location.Y != slotY)
                                {
                                    sf.Location = new Point(x, slotPointer[u]);
                                    sf.Invalidate();
                                }

                                slots[slotY] = sf.MobileId;
                                break;
                            }
                        }
                    }
                }

                this.registeredSerials = refresSerials;
            }
            catch (Exception e)
            {
                Game.PrintMessage("Chyba v zalozkach", MessageType.Error);

                if (!errorOccured)
                {
                    Notepad.WriteLine("Chyba v zalozkach");
                    Notepad.WriteLine("" + e.Message);
                    Notepad.WriteLine();
                    Notepad.WriteLine("" + e.StackTrace);
                    Notepad.WriteLine("Inner: " + (e.InnerException != null ? e.InnerException.Message : ""));
                    Notepad.WriteLine();
                    Notepad.WriteLine((e.InnerException != null ? e.InnerException.StackTrace : ""));
                    errorOccured = true;
                }
            }
            finally
            {
                refreshing = false;
            }
        }
예제 #8
0
        void container_Changed(object sender, ObjectChangedEventArgs e)
        {
            lock (this)
            {
                if (Track)
                {
                    Notepad.WriteLine("container_Changed " + e.Type + " / " + e.ItemSerial);
                }

                switch (e.Type)
                {
                case ObjectChangeType.ItemOpened:
                    // Reset
                    foreach (var item in tracked.Values)
                    {
                        item.Changed -= new ObjectChangedEventHandler(item_Changed);
                    }

                    tracked.Clear();
                    amount = 0;
                    break;

                case ObjectChangeType.SubItemUpdated:
                    // New item or update of existing
                {
                    UOItem item       = new UOItem(e.ItemSerial);
                    int    foundTypes = this.types.Count(i => i.Graphic == item.Graphic && i.Color == item.Color);
                    //if (this.types.Count(i => i.Graphic == item.Graphic) == 0 ||  //item.Graphic != type || item.Color != color)

                    if (foundTypes <= 0)
                    {
                        return;
                    }

                    // Make sure, that the item is in the list
                    tracked[e.ItemSerial] = item;
                    item.Changed         += new ObjectChangedEventHandler(item_Changed);
                    break;
                }

                case ObjectChangeType.SubItemRemoved:
                    if (tracked.Remove(e.ItemSerial))
                    {
                        UOItem item = new UOItem(e.ItemSerial);
                        item.Changed -= new ObjectChangedEventHandler(item_Changed);
                    }
                    else
                    {
                        // Item wasn't tracked, exit immediatly
                        return;
                    }
                    break;

                default:
                    return;
                }

                // Recount
                int a = 0;
                foreach (var item in tracked.Values.ToArray())
                {
                    a += (item.Amount == 0 ? 1 : item.Amount);
                }

                amount = a;
            }

            // Fire event
            OnAmountChanged(EventArgs.Empty);
        }
예제 #9
0
        public void help()
        {
            Notepad.WriteLine(" Prehled funkci:");
            Notepad.WriteLine("         Veskere nastaveni se uklada zavrenim herniho okna Krizkem vpravo nahore ;-)");
            Notepad.WriteLine("Autolot:");
            Notepad.WriteLine("     ,lot - zapnuti/vypnuti");
            Notepad.WriteLine("     ,lotzem - jendorazove vylotovani nastavenych veci pod nohama");
            Notepad.WriteLine("     ,lotpvp - loti zbrane z nejblizsiho tela");
            Notepad.WriteLine("     ,kuch - rozrezani okolnich mrtvol");
            Notepad.WriteLine("     ,lotset - nastaveni lotovaciho batohu a rezaciho nastroje");
            Notepad.WriteLine("     ,lotsetex1 - nastaveni dodatecneho typu k lotu");
            Notepad.WriteLine("     ,lotsetex2 - nastaveni dodatecneho typu k lotu");
            Notepad.WriteLine("  Nasledujici prikazy slouzi k zapinani/vypinani lotu ruznych typu predmetu");
            Notepad.WriteLine("     ,lotfood");
            Notepad.WriteLine("     ,lotgems");
            Notepad.WriteLine("     ,lotregs");
            Notepad.WriteLine("     ,lotfeathers");
            Notepad.WriteLine("     ,lotbolts");
            Notepad.WriteLine("     ,lotleather - jsou-li v batohu nuzky tak automaticky kuze nastriha");
            Notepad.WriteLine("     ,lotex1");
            Notepad.WriteLine("     ,lotex2");
            Notepad.WriteLine("     ,vyber - presune vsechny itemy v oznacene truhle/tele do lotbaglu");
            Notepad.WriteLine("     ,vyber X - X = pauza v ms mezi presunem jednotlivych itemu");
            Notepad.WriteLine("     ,vyberpvp - vybere oznacene telo s pvp pauzou");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("Ability:");
            Notepad.WriteLine("     ,leap");
            Notepad.WriteLine("     ,probo");
            Notepad.WriteLine("     ,bomba");
            Notepad.WriteLine("     ,kudla");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("Poisoning:");
            Notepad.WriteLine("     ,poisset - nastaveni lahve, ktera se bude pouzivat");
            Notepad.WriteLine("     ,pois - aplikvoani nastavene lahve na zbran v prave ruce");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("Leceni:");
            Notepad.WriteLine("     ,bandage - po nalognuti se postava sama nastavi na eq15 na ktery tento prikaz hazi bandu");
            Notepad.WriteLine("     ,bandage true . k leceni pouzije krvave bandaze - Shaman");
            Notepad.WriteLine("     ,bandage Equip CleanBandage - Equip: 0-15 CleanBandage: true/false");
            Notepad.WriteLine("     ,res - oziveni pomoci cistych bandazi");
            Notepad.WriteLine("     ,shamanres - oziveni pomoci krvavych bandazi");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("Herni okno:");
            Notepad.WriteLine("     ,setresolution X Y - X - sirka Y - delka okna maximum klienta je 800x600 timto lze rozmery upravit libovolne");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("Dalsi Nastaveni/Funkce:");
            Notepad.WriteLine("     ,hpprint - zapnuti/vypnuti vypisu HP nad hlavami");
            Notepad.WriteLine("     ,hitbandage - zapnuti/vypnuti bandy po rane");
            Notepad.WriteLine("     ,autodrink true/false - zapnuti/vypnuti automatickeho piti Healu pri nastavenych HP, nebo pri dmg jehoz opakovani = smrt");
            Notepad.WriteLine("     ,criticalhits X - nastaveni minimalni urovne pro piti X= ciselna hodnota");
            Notepad.WriteLine("     ,naprahy - zaponani/vypinani vypisu naprahu");
            Notepad.WriteLine("     ,automorf - automaticka zmena velkych monster a spiritu na humanoidy");
            Notepad.WriteLine("     ,setbandage - prepinani mezi Klerikem a Shamanem u Autohealu");
            Notepad.WriteLine("     ,goldlimit - vypis aktualniho nastaveni limitu goldu v lotbaglu pred zavolanim .mesec");
            Notepad.WriteLine("     ,goldlimit Castka");
            Notepad.WriteLine("     ,autospell - prepinani mezi automatickou Sipkou nebo Harmem");
            Notepad.WriteLine("     ,autosipka - zapnuti/vypnuti automaticke sipky");
            Notepad.WriteLine("     ,runy - nove okno s fcemi pro nacteni run a jejich pouziti");
            Notepad.WriteLine("     ,hid - odpocita hiding a blokuje beh tesne pred hidnutim");
            Notepad.WriteLine("     ,hidoff -vypne blokovani behu, pro odhidnuti, pripadne kdyz se blokovani automaticky nevypne ( vypada jako lagy pri behu, pri chuzi normalni hra)");
            Notepad.WriteLine("     ,friend - da 'all friend' na vsechny modre a vsechny ovladane summony v okoli");
            Notepad.WriteLine("         summony je treba mit otargetovane, nebo mit postahovane zalozky");
            Notepad.WriteLine("     ,kill - misto 'all friend pouzije 'all kill' na vse s cervenou karmou v okoli");
            Notepad.WriteLine("     ,presun X - presune X nahodnych veci z 1 kontejneru do loticiho backpacku");
            Notepad.WriteLine("     ,id pouzeje 'identifikace' u vetesnika na vsechny predmety v danem batohu");
            Notepad.WriteLine("     ,war - prepina warmod DURAZNE doporucuji nastavit jako hotkej na klavesu Tab");
            Notepad.WriteLine("     ,exp - vypise ziskane zkusenosti od pusteni Phoenixe");
            Notepad.WriteLine("     ,clearexp vymaze exp pocitadlo");
            Notepad.WriteLine("     ,dropdispel  - vyhodi pod nohy dispel bombu");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("Magery:");
            Notepad.WriteLine("     ,ccast frostbolt/necrobolt Target - zvoleny spell zacasti na target");
            Notepad.WriteLine("     ,reactivearmor Target - vycasti rectiv na zadany target a odpocita jeho konec pro casteni na sebe ,reactivearmor self, jsou-li svitky pouzije prvni svitky");
            Notepad.WriteLine("     ,teleport target - zakouzli na dany target Teleport, jsou li svitky v batohu casti ze svitku");
            Notepad.WriteLine("     ,invis - zacasti na sebe Invis spell a odpocita ho");
            Notepad.WriteLine("     ,arrowself - zacasti na sebe sipku");
            Notepad.WriteLine("     ,harmself - zacasti na sebe harm");
            Notepad.WriteLine("     ,arrowself true - zacasti na sebe sipku a zautoci na predesly target");
            Notepad.WriteLine("     ,harmself true - zacasti na sebe harm a zautoci na predesly target");
            Notepad.WriteLine("     ,autocast Spell Charged Target - automaticky casti zadany Spell, pri zadani Charged(true/false) jako true casti nabijeci spelly");
            Notepad.WriteLine("         Spells - Harm, Fireball, Flame, Meteor, Bolt, Mind");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("Music:");
            Notepad.WriteLine("     ,peace - zacne uspavat laststatus");
            Notepad.WriteLine("     ,entic - zacne oslabovat laststatus");
            Notepad.WriteLine("     ,setprovo - vyhodi targety pro nastaveni 2 cilu");
            Notepad.WriteLine("     ,provo vyprovokuje nastavene cile");
            // Notepad.WriteLine("     ,musicreset - pri erroru ..Callback already registred pouzit toto");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("Targeting:");
            Notepad.WriteLine("     ,targetnext - targetuje cervenou a sedou karmu, v pripade ze nikdo takovy neni targetuje i modrou");
            Notepad.WriteLine("     ,targetnext true - targetuje nejblizsi cervenou karmu");
            Notepad.WriteLine("     ,tpvp - prepina PVM a PVP targetovani");

            Notepad.WriteLine("     ");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("Tracking");
            Notepad.WriteLine("     ,track - vypise potrebne informace o prikazu ,track");
            Notepad.WriteLine("     ,trackadd - zamerit hrace/jeho hlavu pro ignorovani pri tracku");
            Notepad.WriteLine("     ,trackadd JMENO - pridani ignorovani hrace zadanim jeho JMENA");
            Notepad.WriteLine("     ,trackinfo - vypis ignorovanych hracu");
            Notepad.WriteLine("     ,trackremove X - odstraneni hrace z ignorovani podle indexu z trackinfo");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("Veterinary:");
            Notepad.WriteLine("     ,setpet - nastaveni zvirete ktere se ma lecit");
            Notepad.WriteLine("     ,healpet - pokusi se vylecit peta");
            Notepad.WriteLine("     ,autopetheal - leci peta do full hp");
            Notepad.WriteLine("     ,HitVet -  on/off leci peta po rane");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("Voodoo:");
            Notepad.WriteLine("     ,obet - provede prikaz .sacrafire, ma-li hrac alespon 80 hp");
            Notepad.WriteLine("     ,boost type - vyhazuje targety pro oznaceni hlav, ktere maji dostat voodoo daneho typu, do zruseni targetu");
            Notepad.WriteLine("         v batohu musi byt pro dany typ potion, hlavy mohou byt vy pytliku mimo postavu, script si je bere a vraci");
            Notepad.WriteLine("         typy- str, dex, int, def");
            Notepad.WriteLine("     ,selfboost type - hodi na sebe voodoo, vlastni hlava a potiony musi byt v otevrenem baglu u postavy");
            Notepad.WriteLine("         v pripade ze nenajde hlavu zacasti spell Cunning a Protection");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("Autoheal:    ");
            Notepad.WriteLine("     ,healinfo - vypise info o pridanych hracich do sc");
            Notepad.WriteLine("     ,healclear - vymaze seznam hracu");
            Notepad.WriteLine("     ,healadd - prida zamereneho hrace do seznau lecenych");
            Notepad.WriteLine("     ,healremove X - vymaze leceneho s X=ID, ziskane z ,healinfo");
            Notepad.WriteLine("     ,heal - zapina/vypina automaticke leceni");
            Notepad.WriteLine("     ,bandagehits X - X mnozstvi HP pod kteryma bude bandit sebe ");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("Weapons: ");
            Notepad.WriteLine("     ,weaponadd - prida zbran do seznamu");
            Notepad.WriteLine("     ,weaponsclear - vymaze zapamatovane zbrane");
            Notepad.WriteLine("     ,switch - prehazuje mezi nastavenymi zbranemi");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("     ");
            Notepad.WriteLine("Equipy:     ");
            Notepad.WriteLine("     ,equipadd - zamerenim na baglik s equipem ho nacte a ulozi, pred pridanim musi byt baglik otevreny");
            Notepad.WriteLine("     ,eq - vypis ulozenych equipu");
            Notepad.WriteLine("     ,equipsclear - vymaze zapamatovane equipy");
            Notepad.WriteLine("     ,equipdel X - vymaze equip s danym id=X");
            Notepad.WriteLine("     ,dress X - oblece equip s id=X");
            Notepad.WriteLine("     ,dresssave X - oblece equip s id=X a aktualni  schova do zamereneho pytliku");
            Notepad.WriteLine("     ");
        }
예제 #10
0
        //---------------------------------------------------------------------------------------------

        protected ConsoleOverrideItem GetOverrideItem(AsciiSpeech packet)
        {
            XmlDocument doc = CalebConfig.GlobalDocument;

            if (doc != null)
            {
                XmlElement items = doc.DocumentElement.SelectSingleNode("IngameConsoleOverride/Items") as XmlElement;
                if (items != null && items != null)
                {
                    foreach (XmlNode node in items.ChildNodes)
                    {
                        XmlElement item = node as XmlElement;
                        if (item == null)
                        {
                            continue;
                        }

                        ConsoleOverrideItem oItem = new ConsoleOverrideItem();

                        string attrValue = item.GetAttribute("CompareType");
                        if (!String.IsNullOrEmpty(attrValue))
                        {
                            oItem.CompareType = attrValue;
                        }

                        attrValue = item.GetAttribute("PrintType");
                        if (!String.IsNullOrEmpty(attrValue))
                        {
                            oItem.PrintType = attrValue;
                        }

                        attrValue = item.GetAttribute("CallbackResult");
                        if (!String.IsNullOrEmpty(attrValue))
                        {
                            try { oItem.CallbackResult = (CallbackResult)Enum.Parse(typeof(CallbackResult), attrValue); }
                            catch { }
                        }

                        attrValue = item.GetAttribute("PrintColor");
                        if (!String.IsNullOrEmpty(attrValue))
                        {
                            if (attrValue.StartsWith("Color_"))
                            {
                                oItem.PrintColor = CalebConfig.GetUOColorOrDefault(attrValue, oItem.PrintColor);
                            }
                            else
                            {
                                try { oItem.PrintColor = UOColor.Parse(attrValue); }
                                catch { }
                            }
                        }

                        attrValue = item.GetAttribute("IgnoreCase");
                        if (!String.IsNullOrEmpty(attrValue))
                        {
                            try { oItem.IgnoreCase = Boolean.Parse(attrValue); }
                            catch { }
                        }

                        attrValue = item.GetAttribute("Active");
                        if (!String.IsNullOrEmpty(attrValue))
                        {
                            try { oItem.Active = Boolean.Parse(attrValue); }
                            catch { }
                        }

                        oItem.Text      = item.GetAttribute("Text");
                        oItem.AlterText = item.GetAttribute("AlterText");

                        string itemText    = oItem.Text + String.Empty;
                        string compareText = packet.Text + String.Empty;

                        if (oItem.IgnoreCase)
                        {
                            itemText    = itemText.ToLower();
                            compareText = compareText.ToLower();
                        }

                        bool success = false;
                        if (oItem.CompareType == "Equal")
                        {
                            success = itemText == compareText;
                        }
                        else if (oItem.CompareType == "Contains")
                        {
                            success = compareText.Contains(itemText);
                        }
                        else if (oItem.CompareType == "StartsWith")
                        {
                            success = compareText.StartsWith(itemText);
                        }
                        else if (oItem.CompareType == "EndsWith")
                        {
                            success = compareText.EndsWith(itemText);
                        }

                        if (success && oItem.Active)
                        {
                            return(oItem);
                        }
                    }
                }
                else if (Game.Debug)
                {
                    Notepad.WriteLine("GetOverrideItem !/IngameConsoleOverride/Items");
                }
            }


            return(null);
        }