//--------------------------------------------------------------------------------------------- public MobKillInfo(UOCharacter mob, int resetTimer) { this.Mob = mob; this.resetTimer = resetTimer; this.Enemy = new UOCharacter(Serial.Invalid); this.Mob.Changed += Mob_Changed; }
//--------------------------------------------------------------------------------------------- public static void PrintHitsMessage(this UOCharacter character, string message, params object[] args) { string test = message + String.Empty; bool needBranches = test.Contains("["); bool needSpaces = test.Contains("..") || test.Contains(".") || test.Contains("[ "); test = test.Replace("[", "").Replace("]", "").Replace("....", "").Replace("...", "").Replace("..", "").Replace(".", "").Trim(new char[] { ' ' }); //.ToLower(); //if (needBranches) // test = test.ToLower(); if (!String.IsNullOrEmpty(test) && needBranches) { test = "[" + (needSpaces ? " " : "") + test + (needSpaces ? " " : "") + "]"; } UOColor color = Game.Val_GreenBlue; if (character.Notoriety == Notoriety.Murderer || character.Notoriety == Notoriety.Enemy) { color = Game.GetEnemyColorByHits(character); } else { color = Game.GetAlieColorByHits(character); } //character.Print("");//reset 1 //character.Print("");//reset 2 character.Print(color, test, args); }
//--------------------------------------------------------------------------------------------- public UOCharacter GetEnemy() { Serial target = Aliases.GetObject("LastStatusManual");//Aliases.GetObject("LastStatusManualMobs"); UOCharacter enemy = new UOCharacter(target); if (!enemy.ExistCust()) { enemy = new UOCharacter(Aliases.LastAttack);//new UOCharacter(Aliases.GetObject("LastAttackMobs")); } if (!enemy.ExistCust()) { enemy = new Targeting().SearchNearestEnemy(this.Mob.GetPosition()); } else { enemy = new UOCharacter(target); } if (enemy.ExistCust() && String.IsNullOrEmpty(enemy.Name) && !enemy.RequestStatus(200)) { Game.PrintMessage("Vyprsel Timeout na zalozku enemyho"); } return(enemy); }
public void Leap() { if (DateTime.Now - LastLeap > TimeSpan.FromMilliseconds(4400)) { UOCharacter ch = new UOCharacter(Aliases.LastAttack); if (ch.Distance < 10 && World.Player.Warmode) { if (!World.Player.Warmode) { UO.Warmode(true); } UO.Attack(ch); UO.Say(".leap"); LastLeap = DateTime.Now; while (DateTime.Now - LastLeap < TimeSpan.FromMilliseconds(4400)) { UO.Wait(100); } World.Player.Print("===== LEAP ====="); } else { UO.PrintError("Moc Daleko"); } } else { UO.PrintError("Jeste nemuzes pouzit Leap"); } }
//--------------------------------------------------------------------------------------------- public static bool IsMobRenamed(Serial e) { UOCharacter ch = new UOCharacter(e); string name = ch.Name; return(IsRenamedByPlayer(name)); }
public static void WrongKlic() { List <UOCharacter> npcs = World.Characters.Where(i => i.Distance < 25 && i.Notoriety == Notoriety.Innocent && i.Serial != World.Player.Serial).OrderBy(i => (uint)i.Serial).ToList(); List <UOCharacter> npcsNext = npcs.Where(i => (uint)i.Serial > lastWrongSerial).ToList(); UOCharacter ch = new UOCharacter(Serial.Invalid); if (npcsNext.Count > 0) { ch = npcsNext[0]; } else if (npcs.Count > 0) { ch = npcs[0]; } if (ch.Serial.IsValidCust() && ch.Exist) { Journal.Clear(); if (String.IsNullOrEmpty(ch.Name)) { ch.Click(); Game.Wait(150); } if (!String.IsNullOrEmpty(ch.Name)) { UO.Say(ch.Name + " klic "); Game.Wait(250); if (ch.Exist) { if (Journal.Contains(true, "modry")) { ch.PrintMessage("[Modry..]", Game.Val_Blue); } else if (Journal.Contains(true, "cerveny")) { ch.PrintMessage("[Cerveny..]", Game.Val_Red); } else if (Journal.Contains(true, "zeleny")) { ch.PrintMessage("[Zleny..]", Game.Val_Green); } else if (Journal.Contains(true, "zluty")) { ch.PrintMessage("[Zluty..]", Game.Val_LightYellow); } else { ch.PrintMessage("[Zadny..]", Game.Val_LightPurple); } } } lastWrongSerial = ch.Serial; } }
public void morfTo(ushort model) { UO.Print("Zamer character na morf"); UOCharacter chara = World.GetCharacter(UIManager.TargetObject()); byte[] buffer = new byte[17] { 0x77, 0x00, 0x20, 0xBF, 0x0F, 0x00, 0x07, 0x04, 0xD0, 0x05, 0x64, 0x00, 0x02, 0x05, 0x7D, 0x00, 0x06 }; if (!morfedCharacterSerials.Contains(chara.Serial)) { morfedCharacterSerials.Add(chara.Serial); } if (!morfedCharactersModels.ContainsKey(chara.Serial)) { morfedCharactersModels.Add(chara.Serial, model); } ByteConverter.BigEndian.ToBytes(chara.Serial, buffer, 1); ByteConverter.BigEndian.ToBytes(model, buffer, 5); ByteConverter.BigEndian.ToBytes(chara.X, buffer, 7); ByteConverter.BigEndian.ToBytes(chara.Y, buffer, 9); ByteConverter.BigEndian.ToBytes(chara.Z, buffer, 11); ByteConverter.BigEndian.ToBytes(chara.Direction, buffer, 12); ByteConverter.BigEndian.ToBytes(chara.Color, buffer, 13); ByteConverter.BigEndian.ToBytes(chara.Flags, buffer, 15); ByteConverter.BigEndian.ToBytes((byte)chara.Notoriety, buffer, 16); Core.SendToClient(buffer); }
public void kudla() { UOCharacter cil = new UOCharacter(Aliases.GetObject("laststatus")); if (cil.Distance > 6) { UO.PrintError("Moc daleko <{0}>", cil.Distance); return; } Journal.Clear(); UO.Say(".throw"); //new UOItem(Aliases.GetObject("ActualWeapon")).Equip(); if (Journal.WaitForText(true, 1000, "Nemas zadny cil.", "Nevidis na cil")) { UO.PrintInformation("HAZ!!"); return; } if (Journal.Contains("Dyka byla magicky ", " jsi cil!")) { UO.Wait(1000); UO.PrintInformation("<<KUDLA>> 3 <<KUDLA>>"); UO.Wait(1000); UO.PrintInformation("<<KUDLA>> 2 <<KUDLA>>"); UO.Wait(1000); UO.PrintInformation("<<KUDLA>> 1 <<KUDLA>>"); UO.Wait(1000); } UO.PrintInformation("HAZ!!"); World.Player.Print("Hazej!!!"); System.Media.SystemSounds.Asterisk.Play(); }
//--------------------------------------------------------------------------------------------- protected void World_CharacterAppeared(object sender, CharacterAppearedEventArgs e) { World.CharacterAppeared -= World_CharacterAppeared; UOCharacter appeared = new UOCharacter(e.Serial); if (appeared.Model == 0x0053 && !appeared.Renamable) { if (CalExtension.Abilities.GolemMaster.AdaHammer.Exist) { Targeting.ResetTarget(); UO.WaitTargetObject(appeared); CalExtension.Abilities.GolemMaster.AdaHammer.Use(); if (!Game.IsMob(appeared) && !Game.IsMobRenamed(appeared)) { appeared.Click(); Game.Wait(200); if (appeared.RequestStatus(200)) { Game.Rename(appeared); } } } } }
public void MobGo() { Serial mob = Aliases.GetObject("SelectedMob"); UOCharacter ch = new UOCharacter(mob); string name = null; if (ch.Renamable && mob.IsValid && ch.Exist && ch.Distance < 15 && !String.IsNullOrEmpty(ch.Name)) { ch.PrintMessage("[go...]"); name = ch.Name; List <MobKillInfo> mobQueue = this.MobQueue; foreach (MobKillInfo k in mobQueue) { if (k.Mob.Serial == ch.Serial) { k.CommandCount = 0; k.Enemy = new UOCharacter(Serial.Invalid); } } } string command = "all go"; if (!String.IsNullOrEmpty(name)) { command = name + " go"; } UO.Say(Game.Val_GreenBlue, command); }
//--------------------------------------------------------------------------------------------- public static CastResultInfo CastBishopGreaterHeal(bool useScrool, Serial target, bool silence) { CastResultInfo info = new CastResultInfo(); UOItem scrools = World.Player.Backpack.AllItems.FindType(Magery.SpellScrool[StandardSpell.GreaterHeal]); info.Spell = StandardSpell.GreaterHeal; if (useScrool && scrools.Exist) { Journal.Clear(); scrools.Use(); if (Journal.WaitForText(true, 250, "You activated KVM", "You can't cast this spell yet")) { if (!Journal.Contains(true, "You activated KVM")) { UOCharacter ch = new UOCharacter(target); double dmg = ch.MaxHits - ch.Hits; if (ch.ExistCust() && dmg < 25) { info.Spell = StandardSpell.Heal; } } } } info = Magery.Current.CastSpell(info.Spell, target, false, false, silence, false); return(info); }
public void TrainManual() { this.doneList = new List <Serial>(); Game.PrintMessage("Vyber >"); UOCharacter character = new UOCharacter(UIManager.TargetObject()); Game.Wait(); character.Click(); Game.PrintMessage("" + character.Name); if (character.Exist) { UOItem equipedKrk = World.Player.Layers[Layer.Neck]; UOItem tamingNeklak = World.Player.Backpack.AllItems.FindType(0x1088, 0x0B18); if (tamingNeklak.Exist) { tamingNeklak.Use(); Game.Wait(); } this.TameCharacter(character, 100, false); if (equipedKrk.Exist) { equipedKrk.Use(); } } }
//--------------------------------------------------------------------------------------------- /// <summary> /// Initializes a new instance of the <see cref="T:StatusForm"/> class. /// </summary> public StatusFormTiny(Serial id) { initTime = DateTime.Now; mobile = new UOCharacter(id); InitializeComponent(); MouseEnter += new EventHandler(StatusForm_MouseEnter); MouseLeave += new EventHandler(StatusForm_MouseLeave); MouseDoubleClick += new MouseEventHandler(StatusForm_MouseDoubleClick); MouseClick += StatusForm_MouseClick; Target += new EventHandler(StatusForm_Target); if (id == World.Player.Serial) { this.StatusType = StatusType.Player; } else if (mobile.Renamable) { this.StatusType = StatusType.Mob; } else if (mobile.Notoriety == Notoriety.Guild || mobile.Notoriety == Notoriety.Innocent || mobile.Notoriety == Notoriety.Neutral) { this.StatusType = StatusType.Friend; } else { this.StatusType = StatusType.Enemy; } lastMaxHits = mobile.MaxHits; }
//--------------------------------------------------------------------------------------------- public static StatusFormWrapperType GetWrapperType(Serial serial) { if (serial == World.Player.Serial) { return(StatusFormWrapperType.None); } if (Game.IsMyMob(serial) && !Game.IsMobActive(serial)) { return(StatusFormWrapperType.None); } UOCharacter mobile = new UOCharacter(serial); if (Game.IsMob(mobile)) { return(StatusFormWrapperType.Mob); } else if (Game.CurrentGame.IsAlie(serial) && !Game.IsMyMob(serial) || mobile.Notoriety == Notoriety.Innocent || mobile.Notoriety == Notoriety.Guild) { return(StatusFormWrapperType.Other); } else { return(StatusFormWrapperType.Enemy); } }
//--------------------------------------------------------------------------------------------- public static bool IsSummon(UOCharacter ch) { bool result = false; if (ch.Renamable || Game.IsMob(ch.Serial) || Game.IsMobRenamed(ch.Serial)) { result = true; } if (!result) { foreach (IUOItemType itemType in ItemLibrary.PlayerSummons) { if (itemType.Graphic == ch.Model && itemType.Color == ch.Color) { if (ItemLibrary.IsMonsterConflictSummon(ch)) { IUOItemType conflictType = ItemLibrary.GetMonsterConflictSummon(ch); string defaultName = (conflictType.Name + String.Empty).Replace(" ", "").ToLower(); string compareName = (ch.Name + String.Empty).Replace(" ", "").ToLower(); result = !compareName.Contains(defaultName); } else { result = true; } break; } } } return(result); }
public void morfToid(ushort model, Serial sers) { UO.Print("Character byl zmenen"); UOCharacter chara = new UOCharacter(sers); byte[] buffer = new byte[17] { 0x77, 0x00, 0x20, 0xBF, 0x0F, 0x00, 0x07, 0x04, 0xD0, 0x05, 0x64, 0x00, 0x02, 0x05, 0x7D, 0x00, 0x06 }; if (!morfedCharacterSerials.Contains(chara.Serial)) { morfedCharacterSerials.Add(chara.Serial); } if (!morfedCharactersModels.ContainsKey(chara.Serial)) { morfedCharactersModels.Add(chara.Serial, model); } ByteConverter.BigEndian.ToBytes(chara.Serial, buffer, 1); ByteConverter.BigEndian.ToBytes(model, buffer, 5); ByteConverter.BigEndian.ToBytes(chara.X, buffer, 7); ByteConverter.BigEndian.ToBytes(chara.Y, buffer, 9); ByteConverter.BigEndian.ToBytes(chara.Z, buffer, 11); ByteConverter.BigEndian.ToBytes(chara.Direction, buffer, 12); ByteConverter.BigEndian.ToBytes(chara.Color, buffer, 13); ByteConverter.BigEndian.ToBytes(chara.Flags, buffer, 15); ByteConverter.BigEndian.ToBytes((byte)chara.Notoriety, buffer, 16); Core.SendToClient(buffer); }
public void probo() { UOCharacter target = new UOCharacter(Aliases.GetObject("laststatus")); bool first = true; while (World.Player.Hidden) { UO.Wait(100); if (!target.Serial.Equals(Aliases.GetObject("laststatus"))) { target = new UOCharacter(Aliases.GetObject("laststatus")); } if (DateTime.Now - Hiding.HiddenTime < TimeSpan.FromSeconds(3)) { continue; } if (first) { UO.PrintError("Muzes Bodat!"); first = false; } if (target.Distance < 2) { Journal.Clear(); target.WaitTarget(); UO.Say(".usehand"); Journal.WaitForText(true, 500, "Utok se nepovedl.", "Cil prilis daleko.", "Nevidis na cil.", "Nedosahnes na cil."); } } UO.RunCmd("hidoff"); UO.RunCmd("hid"); }
/// <summary> /// Initializes a new instance of the <see cref="T:HealthBar"/> class. /// </summary> public StatusMultipleItem(Serial id) { Enabled = false; this.mobile = new UOCharacter(id); mobile.Changed += new ObjectChangedEventHandler(mobile_Changed); InitializeComponent(); }
public void TrackAdd() { UOCharacter ch = new UOCharacter(UIManager.TargetObject()); ch.Click(); UO.Wait(200); Ignored.Add(ch.Name); }
protected MobKillInfo GetCurrentInActive() { List <MobKillInfo> mobQueue = this.MobQueue; UOCharacter lastCh = new UOCharacter(Serial.Invalid); MobKillInfo current = null; MobKillInfo last = null; int startIndex = 0; for (int i = 0; i < mobQueue.Count; i++) { MobKillInfo k = mobQueue[i]; if (lastInactiveMob.IsValid && lastInactiveMob == k.Mob.Serial) { if (i < mobQueue.Count - 1) { startIndex = i + 1; lastInactiveMob = Serial.Invalid; } else { last = new MobKillInfo(new UOCharacter(lastInactiveMob), ResetTimerDefault); } } if (!k.Enemy.ExistCust()) { current = mobQueue[i]; break; } } if (current == null) { for (int i = startIndex; i < mobQueue.Count; i++) { MobKillInfo k = mobQueue[i]; if (!k.Enemy.ExistCust()) { current = k; break; } } } if (current == null && last != null && last.NeedCommand()) { current = last; } if (current != null) { lastInactiveMob = current.Mob.Serial; } return(current); }
//--------------------------------------------------------------------------------------------- public Mob(UOCharacter mob, string name) { this.mobChar = mob; this.givenName = name; if (mob != null && mob.Exist) { this.mobChar.Rename(this.givenName); } }
public OneTargetDetails() { InitializeComponent(); t = new System.Timers.Timer(200); t.Elapsed += T_Elapsed; Target = new UOCharacter(0xFFF); t.Start(); }
//--------------------------------------------------------------------------------------------- public bool Contains(UOCharacter mobChar) { foreach (Mob mob in this) { if (mob.MobChar.Serial == mobChar.Serial) { return(true); } } return(false); }
//--------------------------------------------------------------------------------------------- public UOCharacter SelectNextTarget(int resetTimer, Notoriety[] notos) { UOCharacter ch = SearchNextTarget(World.Player.GetPosition(), notos, resetTimer, true); Aliases.LastAttack = ch.Serial; Aliases.SetObject("LastAttackMobs", ch.Serial); if (ch.ExistCust()) { SelectNPCInClient(ch.Serial); } return(ch); }
public bool Vet() { if (pet == null || pet.Distance > 15) { UO.Print("Zamer mezlicka"); pet = new UOCharacter(UIManager.TargetObject()); } if (pet == null) { return(false); } if (pet.Distance > 6) { UO.PrintError("Moc daleko"); return(false); } if (UIManager.CurrentState != UIManager.State.Ready) { UO.Wait(200); return(true); } Core.UnregisterServerMessageCallback(0x1C, onHeal); Core.RegisterServerMessageCallback(0x1C, onHeal); pet.WaitTarget(); UO.Say(".bandage"); healed = false; harmed = true; DateTime start = DateTime.Now; //TODO eq weapon while (!healed) { UO.Wait(100); if (DateTime.Now - start > TimeSpan.FromSeconds(7)) { break; } if (!harmed) { UO.PrintInformation("Neni zranen"); Core.UnregisterServerMessageCallback(0x1C, onHeal); return(false); } } Core.UnregisterServerMessageCallback(0x1C, onHeal); return(true); }
public void rename(string newName) { UOCharacter ch = new UOCharacter(UIManager.TargetObject()); PacketWriter pw = new PacketWriter(0x75); pw.Write((UInt32)ch.Serial); var tmp = newName; while (tmp.Length != 30) { tmp += " "; } pw.WriteAsciiString(tmp, tmp.Length); Core.SendToServer(pw.GetBytes()); }
public void bomba() { UOCharacter cil = new UOCharacter(Aliases.GetObject("laststatus")); if (cil.Distance > 5) { UO.PrintError("Moc daleko"); return; } cil.WaitTarget(); UO.Say(".throwexplosion"); UO.Wait(100); new UOItem(Aliases.GetObject("ActualWeapon")).Equip(); new UOItem(Aliases.GetObject("ActualShield")).Use(); }
//--------------------------------------------------------------------------------------------- private void mob_Changed(object sender, ObjectChangedEventArgs e) { UOCharacter mob = new UOCharacter(e.Serial); if (Game.Debug) { Game.PrintMessage("!mob_Changed " + (mob.Name != null)); } if (mob.Name != null) { mob.Changed -= mob_Changed; Init(mob); } }
public CallbackResult OnOpenStatus(byte[] data, CallbackResult prevState) { if (prevState == CallbackResult.Normal) { if (data[5] == 4) { Serial s = ByteConverter.BigEndian.ToUInt32(data, 6); //if (!Targeting.IsLastSelectedNPC(s)) //{ UOCharacter ch = new UOCharacter(s); if (/*ch.Notoriety == Notoriety.Guild || ch.Notoriety == Notoriety.Innocent || */ Game.CurrentGame.IsAlie(s)) { Aliases.SetObject("laststatus", s); Aliases.SetObject("LastAlieManual", s); Aliases.SetObject("LastStatusManual", s); Aliases.SetObject("LastStatusManualMobs", s); } else { Aliases.SetObject("laststatus", s); Aliases.SetObject("LastStatusManual", s); Aliases.SetObject("LastStatusManualMobs", s); } if ((Game.IsMob(s) && Game.IsMobActive(s)) || ch.Renamable) { Aliases.SetObject("SelectedMob", s); } if (Game.IsPossibleMob(ch) || ch.Renamable) { Rename.RenameCharacter(s); } // if (EnableShowStatusBar && !Rename.RenameCharacter(s)) if (ch.Serial == World.Player.Serial || EnableShowStatusBar) { new StatusBar().Show(s); } } return(CallbackResult.Normal); // } } return(CallbackResult.Normal); }
private void World_CharacterAppeared(object sender, CharacterAppearedEventArgs e) { UOCharacter ch = new UOCharacter(e.Serial); if (String.IsNullOrEmpty(ch.Name)) { ch.RequestStatus(250); } StatusMultipleItem itm = new StatusMultipleItem(e.Serial); this.Controls.Add(itm); //this.name.Text += ch.Name + Environment.NewLine; this.Invalidate(); }