/// <summary> /// Returns <c>true</c> if the <c>PropertySet</c> is equal /// To the specified parameter, else <c>false</c>. /// </summary> /// <param name="o">the object To Compare this /// <c>PropertySet</c> /// with</param> /// <returns><c>true</c> /// if the objects are equal, /// <c>false</c> /// if not</returns> public override bool Equals(Object o) { if (o == null || !(o is PropertySet)) { return(false); } PropertySet ps = (PropertySet)o; int byteOrder1 = ps.ByteOrder; int byteOrder2 = ByteOrder; ClassID classID1 = ps.ClassID; ClassID classID2 = ClassID; int format1 = ps.Format; int format2 = Format; int osVersion1 = ps.OSVersion; int osVersion2 = OSVersion; int sectionCount1 = ps.SectionCount; int sectionCount2 = SectionCount; if (byteOrder1 != byteOrder2 || !classID1.Equals(classID2) || format1 != format2 || osVersion1 != osVersion2 || sectionCount1 != sectionCount2) { return(false); } /* Compare the sections: */ return(Util.AreEqual(Sections, ps.Sections)); }
public void BinClassData() { ProductClassSystem productClassSystem = new ProductClassSystem(); ClassID.DataSource = productClassSystem.Get_ProductClass(0); ClassID.DataBind(); }
/// <summary> /// The get remote mine damage. /// </summary> /// <param name="level"> /// The level. /// </param> /// <param name="classId"> /// The class id. /// </param> /// <param name="creep"> /// The creep. /// </param> /// <returns> /// The <see cref="float" />. /// </returns> public float GetRemoteMineDamage(uint level, ClassID classId, Unit creep = null) { Dictionary <ClassID, float> dictionary; if (!this.remoteMineDamageDictionary.TryGetValue(level, out dictionary)) { var damage = Variables.Techies.AghanimState() ? Variables.RemoteMinesAbility.GetAbilityData("damage_scepter", level) : Variables.RemoteMinesAbility.GetAbilityData("damage", level); dictionary = Heroes.GetByTeam(Variables.EnemyTeam) .ToDictionary( hero => hero.ClassID, hero => hero.DamageTaken(damage, DamageType.Magical, Variables.Techies)); } if (!dictionary.ContainsKey(classId) && (classId == ClassID.CDOTA_BaseNPC_Creep || classId == ClassID.CDOTA_BaseNPC_Creep_Lane || classId == ClassID.CDOTA_BaseNPC_Creep_Siege)) { dictionary.Add( classId, creep.DamageTaken(this.currentRemoteMineDamage, DamageType.Magical, Variables.Techies)); } return(!dictionary.ContainsKey(classId) ? 0 : dictionary[classId]); }
private void FrmAddStudents_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'dataSet1.StudentsTBL' table. You can move, or remove it, as needed. this.studentsTBLTableAdapter.Fill(this.dataSet1.StudentsTBL); lblClassNameOverride.Text = ClassName.ToString(); lblClassIDOverride.Text = ClassID.ToString(); }
private void StudentsFrm_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'dataSet1.StudentsTBL' table. You can move, or remove it, as needed. this.studentsTBLTableAdapter.Fill(this.dataSet1.StudentsTBL); metroLabelclassid1.Text = ClassID.ToString(); metroLabelclassname1.Text = ClassName.ToString(); }
/// <summary> /// Initializes a new instance of the <see cref="Property"/> class. /// </summary> protected Property() { _raw_data = new byte[POIFSConstants.PROPERTY_SIZE]; for (int i = 0; i < this._raw_data.Length; i++) { this._raw_data[i] = _default_fill; } _name_size = new ShortField(_name_size_offset); _property_type = new ByteField(PropertyConstants.PROPERTY_TYPE_OFFSET); _node_color = new ByteField(_node_color_offset); _previous_property = new IntegerField(_previous_property_offset, _NO_INDEX, _raw_data); _next_property = new IntegerField(_next_property_offset, _NO_INDEX, _raw_data); _child_property = new IntegerField(_child_property_offset, _NO_INDEX, _raw_data); _storage_clsid = new ClassID(_raw_data, _storage_clsid_offset); _user_flags = new IntegerField(_user_flags_offset, 0, _raw_data); _seconds_1 = new IntegerField(_seconds_1_offset, 0, _raw_data); _days_1 = new IntegerField(_days_1_offset, 0, _raw_data); _seconds_2 = new IntegerField(_seconds_2_offset, 0, _raw_data); _days_2 = new IntegerField(_days_2_offset, 0, _raw_data); _start_block = new IntegerField(_start_block_offset); _size = new IntegerField(_size_offset, 0, _raw_data); _index = _NO_INDEX; this.Name = ""; this.NextChild = null; this.PreviousChild = null; }
/// <summary> /// 页面加载方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("ReadProduct", PowerCheckType.Single); ClassID.DataSource = ProductClassBLL.ReadNamedList(); ClassID.DataTextField = "Name"; ClassID.DataValueField = "ID"; ClassID.DataBind(); ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); BrandID.DataSource = ProductBrandBLL.ReadList(); BrandID.DataTextField = "Name"; BrandID.DataValueField = "ID"; BrandID.DataBind(); BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); Key.Text = RequestHelper.GetQueryString <string>("Key"); ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.IsSale = (int)BoolType.True; productSearch.IsDelete = 0;//未删除的 productSearch.StandardType = (int)ProductStandardType.No; productSearch.Key = RequestHelper.GetQueryString <string>("Key"); productSearch.ClassId = RequestHelper.GetQueryString <string>("ClassID"); productSearch.BrandId = RequestHelper.GetQueryString <int>("BrandID"); BindControl(ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count), RecordList, MyPager); } }
public WeaponType GetWeaponType(ClassID ID) { switch (ID) { case ClassID.AK47: case ClassID.WeaponAUG: case ClassID.WeaponAWP: case ClassID.WeaponBizon: case ClassID.WeaponG3SG1: case ClassID.WeaponGalilAR: case ClassID.WeaponM249: case ClassID.WeaponM4A1: case ClassID.WeaponMP7: case ClassID.WeaponMP9: case ClassID.WeaponMag7: case ClassID.WeaponNOVA: case ClassID.WeaponNegev: case ClassID.WeaponSG556: case ClassID.WeaponSSG08: case ClassID.WeaponUMP45: case ClassID.WeaponXM1014: return(WeaponType.AssaultRifle); default: return(WeaponType.Melee); } }
public Entity(Entity copyFrom) { this.address = copyFrom.Address; this.health = copyFrom.Health; this.x = copyFrom.X; this.y = copyFrom.Y; this.z = copyFrom.Z; this.pitch = copyFrom.Pitch; this.yaw = copyFrom.Yaw; this.roll = copyFrom.Roll; this.viewAngle = new Vector3(pitch, yaw, roll); this.team = copyFrom.InTeam; this.vector3 = new Vector3(x, y, z); this.vector2 = new Vector2(x, y); this.velx = copyFrom.velx; this.vely = copyFrom.vely; this.velz = copyFrom.velz; this.velocity = new Vector3(velx, vely, velz); this.punchX = copyFrom.punchX; this.punchY = copyFrom.punchY; this.punchZ = copyFrom.punchZ; this.punchVector = new Vector3(punchX, punchY, punchZ); this.name = (string)copyFrom.name.Clone(); if (copyFrom.skeleton != null) { this.skeleton = (Skeleton)copyFrom.Skeleton.Clone(); } this.classID = copyFrom.ClassID; }
/** * Writes a 16-byte {@link ClassID} To an output stream. * * @param out The stream To Write To * @param n The value To Write * @return The number of bytes written * @exception IOException if an I/O error occurs */ public static int WriteToStream(Stream out1, ClassID n) { byte[] b = new byte[16]; n.Write(b, 0); out1.Write(b, 0, b.Length); return(b.Length); }
/// <summary> /// The draw suicide. /// </summary> /// <param name="classId"> /// The class id. /// </param> /// <param name="health"> /// The health. /// </param> /// <param name="x"> /// The x. /// </param> /// <param name="sizey"> /// The size y. /// </param> /// <param name="sizeX"> /// The size x. /// </param> /// <param name="enabled"> /// The enabled. /// </param> /// <param name="hero"> /// The hero. /// </param> private static void DrawSuicide( ClassID classId, float health, double x, double sizey, double sizeX, bool enabled, Unit hero) { var suicideAttackDmg = Variables.Damage.GetSuicideDamage()[classId]; if (!(suicideAttackDmg > 0)) { return; } var dmg = health - suicideAttackDmg; var canKill = dmg <= 0; if (Variables.Menu.DrawingsMenu.Item("drawTopPanel").GetValue <bool>()) { Drawing.DrawText( canKill ? "Yes" : "No", new Vector2(canKill ? (float)(x + sizeX / 2) : (float)(x + sizeX / 1.7), (float)sizey), new Vector2(17, 17), enabled ? Color.DarkOrange : Color.DimGray, FontFlags.AntiAlias); } if (!hero.IsVisible || !hero.IsAlive) { return; } if (!Variables.Menu.DrawingsMenu.Item("drawSuicideKills").GetValue <bool>()) { return; } var screenPos = HUDInfo.GetHPbarPosition(hero); if (screenPos.X + 20 > Drawing.Width || screenPos.X - 20 < 0 || screenPos.Y + 100 > Drawing.Height || screenPos.Y - 30 < 0) { return; } var text = canKill ? "Yes" : "No " + Math.Floor(dmg); var size = new Vector2(15, 15); var textSize = Drawing.MeasureText(text, "Arial", size, FontFlags.AntiAlias); var position = new Vector2(screenPos.X - textSize.X - 2, screenPos.Y - 3); Drawing.DrawText( text, position, size, enabled ? (canKill ? Color.LawnGreen : Color.Red) : Color.Gray, FontFlags.AntiAlias); }
/// <summary> /// Initializes a new instance of the <see cref="AttackAnimation" /> class. /// </summary> /// <param name="unitName"> /// The unit name. /// </param> /// <param name="unitClassId"> /// The unit class id. /// </param> /// <param name="moveTime"> /// The attack animation move time. /// </param> /// <param name="endTime"> /// The attack animation end time. /// </param> /// <param name="canMove"> /// Indicates whether the unit can move. /// </param> public AttackAnimation(string unitName, ClassID unitClassId, double moveTime, double endTime, bool canMove) { this.UnitName = unitName; this.UnitClassId = unitClassId; this.MoveTime = moveTime; this.EndTime = endTime; this.CanMove = canMove; }
public Entity(ClassID eClass, int eEXP, ClassHealth eHealth, ClassDamage eDamage, int eX, int eY) //Default struct for a player instance { Class = eClass; EXP = eEXP; Health = eHealth; Damage = eDamage; X = eX; Y = eY; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { NewClassSystem newClassSystem = new NewClassSystem(); ClassID.DataSource = newClassSystem.Get_NewClass(0); ClassID.DataBind(); } }
void AssertClass(ClassID expected, string functionName) { ClassID classOfThis = Class; if (classOfThis != expected) { throw new InvalidClassIDException(expected, classOfThis, functionName); } }
public void BinClassData() { NewClassSystem newClassSystem = new NewClassSystem(); ClassID.DataSource = newClassSystem.Get_NewClass(0); ClassID.DataTextField = "ClassName"; ClassID.DataValueField = "ClassID"; ClassID.DataBind(); }
public void BinClassData() { ProductClassSystem productClass = new ProductClassSystem(); ClassID.DataSource = productClass.Get_ProductClass(0); ClassID.DataTextField = "ClassName"; ClassID.DataValueField = "ClassID"; ClassID.DataBind(); }
public CounterHelp(ClassID hero, string strKey = "", int intKey = 0, NetworkActivity activity = 0, string modifer = "") : this() { Hero = hero; Modifer = modifer; Activity = activity; IntKey = intKey; StrKey = strKey; }
public void TestWriteTwoSections() { String STREAM_NAME = "PropertySetStream"; String SECTION1 = "Section 1"; String SECTION2 = "Section 2"; FileStream file = _samples.GetFile(POI_FS); //filename.deleteOnExit(); FileStream out1 = file; POIFSFileSystem poiFs = new POIFSFileSystem(); MutablePropertySet ps = new MutablePropertySet(); ps.ClearSections(); ClassID formatID = new ClassID(); formatID.Bytes = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; MutableSection s1 = new MutableSection(); s1.SetFormatID(formatID); s1.SetProperty(2, SECTION1); ps.AddSection(s1); MutableSection s2 = new MutableSection(); s2.SetFormatID(formatID); s2.SetProperty(2, SECTION2); ps.AddSection(s2); poiFs.CreateDocument(ps.GetStream(), STREAM_NAME); poiFs.WriteFileSystem(out1); //out1.Close(); /* Read the POIFS: */ psa = new PropertySet[1]; POIFSReader reader2 = new POIFSReader(); reader2.StreamReaded += new POIFSReaderEventHandler(reader2_StreamReaded); reader2.Read(file); Assert.IsNotNull(psa[0]); Section s = (Section)(psa[0].Sections[0]); Assert.AreEqual(s.FormatID, formatID); Object p = s.GetProperty(2); Assert.AreEqual(SECTION1, p); s = (Section)(psa[0].Sections[1]); p = s.GetProperty(2); Assert.AreEqual(SECTION2, p); file.Close(); //File.Delete(dataDir + POI_FS); }
public void TestClassID1() { ClassID clsidTest = new ClassID( new byte[] {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10} , 0 ); Assert.AreEqual(clsidTest.ToString().ToUpper(), "{04030201-0605-0807-090A-0B0C0D0E0F10}" ); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ClassID.DataSource = WebBLL.Tbl_ClassManager.GetTbl_ClassByAllParentID(79); ClassID.DataTextField = "ClassName"; ClassID.DataValueField = "ClassName"; ClassID.DataBind(); ClassID.Items.Insert(0, new ListItem("选择信息分类", "")); } }
public void BinData() { List <ProductClass> List_ProductClass = new List <ProductClass>(); ProductClassSystem productClassSystem = new ProductClassSystem(); List_ProductClass = productClassSystem.Get_ProductClass(0); ClassID.DataSource = List_ProductClass; ClassID.DataTextField = "ClassName"; ClassID.DataValueField = "ClassID"; ClassID.DataBind(); }
public void SetWardsCount(ClassID id, uint count) { if (id == ClassID.CDOTA_Item_ObserverWard) { ObserversCount = count; } else { SentryCount = count; } }
/// <summary> /// Sets the section's format ID. /// </summary> /// <param name="formatID">The section's format ID as a byte array. It components /// are in big-endian format.</param> public void SetFormatID(byte[] formatID) { ClassID fid = this.FormatID; if (fid == null) { fid = new ClassID(); SetFormatID(fid); } fid.Bytes = formatID; }
public YAMLDocument ExportYAMLDocument(IExportContainer container) { YAMLDocument document = new YAMLDocument(); YAMLMappingNode root = document.CreateMappingRoot(); root.Tag = ClassID.ToInt().ToString(); root.Anchor = container.GetExportID(this).ToString(); YAMLMappingNode node = ExportYAMLRoot(container); root.Add(container.ExportLayout.ClassNames[ClassID], node); return(document); }
public static PCIDevice GetDeviceClass(ClassID Class, SubclassID SubClass) { foreach (var xDevice in Devices) { if ((ClassID)xDevice.ClassCode == Class && (SubclassID)xDevice.Subclass == SubClass) { return(xDevice); } } return(null); }
public YAMLDocument ExportYAMLDocument(IAssetsExporter exporter) { YAMLDocument document = new YAMLDocument(); YAMLMappingNode node = ExportYAMLRoot(exporter); YAMLMappingNode root = document.CreateMappingRoot(); root.Tag = ClassID.ToInt().ToString(); root.Anchor = exporter.GetExportID(this); root.Add(ClassIDName, node); return(document); }
/// <summary> /// Initializes this {@link PropertySet} instance from a byte /// array. The method assumes that it has been checked alReady that /// the byte array indeed represents a property Set stream. It does /// no more checks on its own. /// </summary> /// <param name="src">Byte array containing the property Set stream</param> /// <param name="offset">The property Set stream starts at this offset</param> /// <param name="Length">Length of the property Set stream.</param> private void init(byte[] src, int offset, int Length) { /* FIXME (3): Ensure that at most "Length" bytes are Read. */ /* * Read the stream's header fields. */ int o = offset; byteOrder = LittleEndian.GetUShort(src, o); o += LittleEndianConsts.SHORT_SIZE; format = LittleEndian.GetUShort(src, o); o += LittleEndianConsts.SHORT_SIZE; osVersion = (int)LittleEndian.GetUInt(src, o); o += LittleEndianConsts.INT_SIZE; classID = new ClassID(src, o); o += ClassID.LENGTH; int sectionCount = LittleEndian.GetInt(src, o); o += LittleEndianConsts.INT_SIZE; if (sectionCount < 0) { throw new HPSFRuntimeException("Section count " + sectionCount + " is negative."); } /* * Read the sections, which are following the header. They * start with an array of section descriptions. Each one * consists of a format ID telling what the section Contains * and an offset telling how many bytes from the start of the * stream the section begins. */ /* * Most property Sets have only one section. The Document * Summary Information stream has 2. Everything else is a rare * exception and is no longer fostered by Microsoft. */ sections = new ArrayList(sectionCount); /* * Loop over the section descriptor array. Each descriptor * consists of a ClassID and a DWord, and we have To increment * "offset" accordingly. */ for (int i = 0; i < sectionCount; i++) { Section s = new Section(src, o); o += ClassID.Length + LittleEndianConsts.INT_SIZE; sections.Add(s); } }
public override int GetHashCode() { int hash = 113; unchecked { hash = hash + 457 * Attribute.GetHashCode(); hash = hash * 433 + Path.GetHashCode(); hash = hash * 223 + ClassID.GetHashCode(); hash = hash * 911 + Script.GetHashCode(); } return(hash); }
public static PCIDevice GetDeviceClass(ClassID Class, SubclassID SubClass) { for (int i = 0; i < Devices.Count; i++) { var xDevice = Devices[i]; if ((ClassID)xDevice.ClassCode == Class && (SubclassID)xDevice.Subclass == SubClass) { return(Devices[i]); } } return(null); }
/// <summary> /// The get land mine damage. /// </summary> /// <param name="level"> /// The level. /// </param> /// <param name="classId"> /// The class id. /// </param> /// <returns> /// The <see cref="float" />. /// </returns> public float GetLandMineDamage(uint level, ClassID classId) { Dictionary<ClassID, float> dictionary; if (!this.landMineDamageDictionary.TryGetValue(level, out dictionary)) { var damage = Variables.LandMinesAbility.GetAbilityData("damage", level); dictionary = Heroes.GetByTeam(Variables.EnemyTeam) .ToDictionary( hero => hero.ClassID, hero => hero.DamageTaken(damage, DamageType.Physical, Variables.Techies)); } return !dictionary.ContainsKey(classId) ? 0 : dictionary[classId]; }
/// <summary> /// Initializes a new instance of the <see cref="ExternalDmgAmps" /> class. /// </summary> /// <param name="modifierName"> /// The modifier name. /// </param> /// <param name="sourceTeam"> /// The source team. /// </param> /// <param name="amp"> /// The amp. /// </param> /// <param name="sourceSpellName"> /// The source spell name. /// </param> /// <param name="heroId"> /// The hero id. /// </param> /// <param name="type"> /// The type. /// </param> public ExternalDmgAmps( string modifierName, double sourceTeam, string amp, string sourceSpellName, ClassID heroId, DamageType type) { this.ModifierName = modifierName; this.SourceTeam = sourceTeam; this.Amp = amp; this.SourceSpellName = sourceSpellName; this.HeroId = heroId; this.Type = type; }
public Prediction( string unitName, ClassID unitClassID, Vector3 speed, float rotSpeed, Vector3 lastPosition, float lastRotR, float lasttick) { this.UnitName = unitName; this.UnitClassID = unitClassID; this.Speed = speed; this.RotSpeed = rotSpeed; this.LastPosition = lastPosition; this.LastRotR = lastRotR; this.Lasttick = lasttick; }
/// <summary> /// Initializes a new instance of the <see cref="ExternalDmgReductions" /> class. /// </summary> /// <param name="modifierName"> /// The modifier name. /// </param> /// <param name="sourceTeam"> /// The source team. /// </param> /// <param name="reduce"> /// The reduce. /// </param> /// <param name="sourceSpellName"> /// The source spell name. /// </param> /// <param name="heroId"> /// The hero id. /// </param> /// <param name="type"> /// The type. /// </param> /// <param name="magicOnly"> /// The magic only. /// </param> public ExternalDmgReductions( string modifierName, double sourceTeam, string reduce, string sourceSpellName, ClassID heroId, float type, bool magicOnly) { this.ModifierName = modifierName; this.SourceTeam = sourceTeam; this.Reduce = reduce; this.SourceSpellName = sourceSpellName; this.HeroID = heroId; this.Type = type; this.MagicOnly = magicOnly; }
/// <summary> /// Initializes a new instance of the <see cref="AttackAnimationData" /> class. /// </summary> /// <param name="unitName"> /// The unit name. /// </param> /// <param name="unitClassId"> /// The unit class id. /// </param> /// <param name="attackRate"> /// The attack animation rate. /// </param> /// <param name="attackPoint"> /// The attack animation point. /// </param> /// <param name="attackBackswing"> /// The attack animation backswing. /// </param> /// <param name="projectileSpeed"> /// The attack animation projectile speed. /// </param> /// <param name="turnRate"> /// The attack animation turn rate. /// </param> public AttackAnimationData( string unitName, ClassID unitClassId, double attackRate, double attackPoint, double attackBackswing, int projectileSpeed, double turnRate) { this.UnitName = unitName; this.UnitClassId = unitClassId; this.AttackRate = attackRate; this.AttackPoint = attackPoint; this.AttackBackswing = attackBackswing; this.ProjectileSpeed = projectileSpeed; this.TurnRate = turnRate; }
public bool IsEnabled(ClassID id) { var name = id == ClassID.CDOTA_NPC_Observer_Ward ? "item_ward_observer" : "item_ward_sentry"; return IsEnabled(name); }
public static bool HasItem(ClassID classId) { return (ObjectMgr.LocalHero.Inventory.Items.Any(item => item.ClassID == classId)); }
/// <summary> /// Gets the attack animation data by class id. /// </summary> /// <param name="classId"> /// The class id. /// </param> /// <returns> /// The <see cref="AttackAnimationData" />. /// </returns> public static AttackAnimationData GetByClassId(ClassID classId) { return Units.FirstOrDefault(unitData => unitData.UnitClassId.Equals(classId)); }
public Entity(Entity copyFrom) { this.address = copyFrom.Address; this.health = copyFrom.Health; this.x = copyFrom.X; this.y = copyFrom.Y; this.z = copyFrom.Z; this.pitch = copyFrom.Pitch; this.yaw = copyFrom.Yaw; this.roll = copyFrom.Roll; this.viewAngle = new Vector3(pitch, yaw, roll); this.team = copyFrom.InTeam; this.vector3 = new Vector3(x, y, z); this.vector2 = new Vector2(x, y); this.velx = copyFrom.velx; this.vely = copyFrom.vely; this.velz = copyFrom.velz; this.velocity = new Vector3(velx, vely, velz); this.punchX = copyFrom.punchX; this.punchY = copyFrom.punchY; this.punchZ = copyFrom.punchZ; this.punchVector = new Vector3(punchX, punchY, punchZ); this.name = (string)copyFrom.name.Clone(); if (copyFrom.skeleton != null) this.skeleton = (Skeleton)copyFrom.Skeleton.Clone(); this.classID = copyFrom.ClassID; }
private static string GetDotabuffName(ClassID classId) { switch (classId) { case ClassID.CDOTA_Unit_Hero_DoomBringer: return "doom"; case ClassID.CDOTA_Unit_Hero_Furion: return "natures-prophet"; case ClassID.CDOTA_Unit_Hero_Magnataur: return "magnus"; case ClassID.CDOTA_Unit_Hero_Necrolyte: return "necrophos"; case ClassID.CDOTA_Unit_Hero_Nevermore: return "shadow-fiend"; case ClassID.CDOTA_Unit_Hero_Obsidian_Destroyer: return "outworld-devourer"; case ClassID.CDOTA_Unit_Hero_Rattletrap: return "clockwerk"; case ClassID.CDOTA_Unit_Hero_Shredder: return "timbersaw"; case ClassID.CDOTA_Unit_Hero_SkeletonKing: return "wraith-king"; case ClassID.CDOTA_Unit_Hero_Wisp: return "io"; case ClassID.CDOTA_Unit_Hero_Zuus: return "zeus"; case ClassID.CDOTA_Unit_Hero_Windrunner: return "windranger"; case ClassID.CDOTA_Unit_Hero_Life_Stealer: return "lifestealer"; case ClassID.CDOTA_Unit_Hero_Treant: return "treant-protector"; case ClassID.CDOTA_Unit_Hero_MonkeyKing: return "monkey-king"; case ClassID.CDOTA_Unit_Hero_AbyssalUnderlord: return "underlord"; } var name = classId.ToString().Substring("CDOTA_Unit_Hero_".Length).Replace("_", string.Empty); var newName = new StringBuilder(name[0].ToString()); foreach (var ch in name.Skip(1)) { if (char.IsUpper(ch)) { newName.Append('-'); } newName.Append(ch); } return newName.ToString().ToLower(); }
/// <summary> /// The draw suicide. /// </summary> /// <param name="classId"> /// The class id. /// </param> /// <param name="health"> /// The health. /// </param> /// <param name="x"> /// The x. /// </param> /// <param name="sizey"> /// The size y. /// </param> /// <param name="sizeX"> /// The size x. /// </param> /// <param name="enabled"> /// The enabled. /// </param> /// <param name="hero"> /// The hero. /// </param> private static void DrawSuicide( ClassID classId, float health, double x, double sizey, double sizeX, bool enabled, Unit hero) { var suicideAttackDmg = Variables.Damage.GetSuicideDamage()[classId]; if (!(suicideAttackDmg > 0)) { return; } var dmg = health - suicideAttackDmg; var canKill = dmg <= 0; if (Variables.Menu.DrawingsMenu.Item("drawTopPanel").GetValue<bool>()) { Drawing.DrawText( canKill ? "Yes" : "No", new Vector2(canKill ? (float)(x + sizeX / 2) : (float)(x + sizeX / 1.7), (float)sizey), new Vector2(17, 17), enabled ? Color.DarkOrange : Color.DimGray, FontFlags.AntiAlias); } if (!hero.IsVisible || !hero.IsAlive) { return; } if (!Variables.Menu.DrawingsMenu.Item("drawSuicideKills").GetValue<bool>()) { return; } var screenPos = HUDInfo.GetHPbarPosition(hero); if (screenPos.X + 20 > Drawing.Width || screenPos.X - 20 < 0 || screenPos.Y + 100 > Drawing.Height || screenPos.Y - 30 < 0) { return; } var text = canKill ? "Yes" : "No " + Math.Floor(dmg); var size = new Vector2(15, 15); var textSize = Drawing.MeasureText(text, "Arial", size, FontFlags.AntiAlias); var position = new Vector2(screenPos.X - textSize.X - 2, screenPos.Y - 3); Drawing.DrawText( text, position, size, enabled ? (canKill ? Color.LawnGreen : Color.Red) : Color.Gray, FontFlags.AntiAlias); }
public WeaponType GetWeaponType(ClassID ID) { switch (ID) { case ClassID.AK47: case ClassID.WeaponAUG: case ClassID.WeaponAWP: case ClassID.WeaponBizon: case ClassID.WeaponG3SG1: case ClassID.WeaponGalilAR: case ClassID.WeaponM249: case ClassID.WeaponM4A1: case ClassID.WeaponMP7: case ClassID.WeaponMP9: case ClassID.WeaponMag7: case ClassID.WeaponNOVA: case ClassID.WeaponNegev: case ClassID.WeaponSG556: case ClassID.WeaponSSG08: case ClassID.WeaponUMP45: case ClassID.WeaponXM1014: return WeaponType.AssaultRifle; default: return WeaponType.Melee; } }
public uint GetWardsCount(ClassID id) { return id == ClassID.CDOTA_Item_ObserverWard ? ObserversCount : SentryCount; }
public bool DroppedWard(ClassID id) { return ObjectManager.GetEntities<PhysicalItem>().Any(x => x.Item.ClassID == id && x.Distance2D(hero) < 100); }
public uint CountWards(ClassID id) { return id == ClassID.CDOTA_Item_ObserverWard ? CountObservers() : CountSentries(); }
public virtual void Update(long address, long radarAddress, int id) { this.index = id; IntPtr handle = Program.GameImplementation.GameController.Process.Handle; this.address = address; this.radarAddress = radarAddress; byte[] entityData = WinAPI.ReadMemory(handle, address, 6500); int vt = BitConverter.ToInt32(entityData, 0x8); int fn = WinAPI.ReadInt32(handle, vt + 2 * 0x4); int cls = WinAPI.ReadInt32(handle, fn + 0x1); this.classIDInt = WinAPI.ReadInt32(handle, cls + 20); this.classID = (ClassID)this.classIDInt; int namePointer = WinAPI.ReadInt32(handle, cls + 8); byte[] nameData = WinAPI.ReadMemory(handle, namePointer, 32); this.name = WinAPI.ReadString(handle, namePointer, 32, Encoding.ASCII); //Encoding.ASCII.GetString(nameData); if (this.name.Length > 0) { if (this.name[0] == 'C' && this.name != "C4") this.name = this.name.Substring(1, this.name.Length - 1); if (this.name.StartsWith("Weapon")) { this.classID = Enums.ClassID.Weapon; this.name = this.name.Substring(6, this.name.Length - 6); } else if (this.name == "HEGrenade" || this.name == "Incendiary" || this.name == "Flash" || this.name == "Molotov" || this.name == "Decoy") { this.classID = Enums.ClassID.Weapon; } else if (this.classID == Enums.ClassID.AK47 || this.classID == Enums.ClassID.DEagle) { this.classID = Enums.ClassID.Weapon; } } if (!( classID == Enums.ClassID.CSPlayer || classID == Enums.ClassID.Hostage || classID == Enums.ClassID.Chicken || classID == Enums.ClassID.Weapon || classID == Enums.ClassID.C4 || classID == Enums.ClassID.PlantedC4 || classID == Enums.ClassID.SmokeGrenade) ) return; int newHealth = BitConverter.ToInt32(entityData, GameOffsets.CL_ENTITY_HEALTH); if (newHealth != health) HealthChanged(health, newHealth); this.health = newHealth; this.ownerEntity = BitConverter.ToInt16(entityData, GameOffsets.CL_ENTITY_OWNER_ENTITY); this.x = BitConverter.ToSingle(entityData, GameOffsets.CL_ENTITY_X); this.y = BitConverter.ToSingle(entityData, GameOffsets.CL_ENTITY_Y); this.z = BitConverter.ToSingle(entityData, GameOffsets.CL_ENTITY_Z); this.pitch = BitConverter.ToSingle(entityData, GameOffsets.CL_ENTITY_PITCH); this.yaw = BitConverter.ToSingle(entityData, GameOffsets.CL_ENTITY_YAW); this.roll = BitConverter.ToSingle(entityData, GameOffsets.CL_ENTITY_ROLL); this.viewAngle = new Vector3(pitch, yaw, roll); this.team = (Team)BitConverter.ToInt32(entityData, GameOffsets.CL_ENTITY_TEAM);//BitConverter.ToInt32(entityData, GameOffsets.CL_ENTITY_TEAM); this.vector3 = new Vector3(x, y, z); this.vector2 = new Vector2(x, y); this.velx = BitConverter.ToSingle(entityData, GameOffsets.CL_ENTITY_VELOCITY_X); this.vely = BitConverter.ToSingle(entityData, GameOffsets.CL_ENTITY_VELOCITY_Y); this.velz = BitConverter.ToSingle(entityData, GameOffsets.CL_ENTITY_VELOCITY_Z); this.baseVelx = BitConverter.ToSingle(entityData, GameOffsets.CL_ENTITY_BASE_VELOCITY_X); this.baseVely = BitConverter.ToSingle(entityData, GameOffsets.CL_ENTITY_BASE_VELOCITY_Y); this.baseVelz = BitConverter.ToSingle(entityData, GameOffsets.CL_ENTITY_BASE_VELOCITY_Z); this.punchX = BitConverter.ToSingle(entityData, GameOffsets.CL_ENTITY_PUNCHVEC); this.punchY = BitConverter.ToSingle(entityData, GameOffsets.CL_ENTITY_PUNCHVEC + 0x4); this.punchZ = BitConverter.ToSingle(entityData, GameOffsets.CL_ENTITY_PUNCHVEC + 0x8); this.punchVector = new Vector3(punchX, punchY, punchZ); this.state = (PlayerState)entityData[GameOffsets.CL_ENTITY_STATE];//BitConverter.ToInt32(entityData, GameOffsets.CL_ENTITY_STATE); this.spectatorView = (SpectatorView)entityData[GameOffsets.CL_ENTITY_SPECTATOR_VIEW];//BitConverter.ToInt32(entityData, GameOffsets.CL_ENTITY_SPECTATOR_VIEW); this.spectatorTarget = entityData[GameOffsets.CL_ENTITY_SPECTATOR_PLAYER]; this.velocity = new Vector3(velx, vely, velz); this.baseVelocity = new Vector3(baseVelx, baseVely, baseVelz); this.isDormant = entityData[GameOffsets.CL_ENTITY_DORMANT] == 1; this.isSpotted = entityData[GameOffsets.CL_ENTITY_SPOTTED] == 1; this.spottedMask = BitConverter.ToInt32(entityData, GameOffsets.CL_ENTITY_SPOTTED_MASK); this.lifeState = (LifeState)entityData[GameOffsets.CL_ENTITY_LIFESTATE];//BitConverter.ToInt32(entityData, GameOffsets.CL_ENTITY_LIFESTATE); if (this.skeleton == null) this.skeleton = new Skeleton( BitConverter.ToInt32(entityData, GameOffsets.CL_ENTITY_BONEMATRIX), !(this.classID == Enums.ClassID.Chicken || this.classID == Enums.ClassID.Hostage || this.classID == Enums.ClassID.CSPlayer) ); else this.skeleton.Update(BitConverter.ToInt32(entityData, GameOffsets.CL_ENTITY_BONEMATRIX)); }
/// <summary> /// The draw remote mine number. /// </summary> /// <param name="classId"> /// The class id. /// </param> /// <param name="health"> /// The health. /// </param> /// <param name="x"> /// The x. /// </param> /// <param name="sizeX"> /// The size x. /// </param> /// <param name="sizey"> /// The size y. /// </param> /// <param name="enabled"> /// The enabled. /// </param> private static void DrawRemoteMineNumber( ClassID classId, float health, double x, double sizeX, double sizey, bool enabled) { var remoteDmg = Variables.Damage.GetRemoteMineDamage(Variables.RemoteMinesAbility.Level, classId); if (!(remoteDmg > 0)) { return; } var remoteNumber = Math.Ceiling(health / remoteDmg); Drawing.DrawText( remoteNumber.ToString(CultureInfo.InvariantCulture), new Vector2((float)(x + sizeX / 3.6), (float)sizey), new Vector2(17, 17), enabled ? Color.Green : Color.DimGray, FontFlags.AntiAlias); }
private static bool Support(ClassID hero) { if ((hero == ClassID.CDOTA_Unit_Hero_Oracle || hero == ClassID.CDOTA_Unit_Hero_Winter_Wyvern || hero == ClassID.CDOTA_Unit_Hero_KeeperOfTheLight || hero == ClassID.CDOTA_Unit_Hero_Dazzle || hero == ClassID.CDOTA_Unit_Hero_Chen || hero == ClassID.CDOTA_Unit_Hero_Enchantress || hero == ClassID.CDOTA_Unit_Hero_Legion_Commander || hero == ClassID.CDOTA_Unit_Hero_Abaddon || hero == ClassID.CDOTA_Unit_Hero_Omniknight || hero == ClassID.CDOTA_Unit_Hero_Treant || hero == ClassID.CDOTA_Unit_Hero_Wisp || hero == ClassID.CDOTA_Unit_Hero_Centaur || hero == ClassID.CDOTA_Unit_Hero_Undying || hero == ClassID.CDOTA_Unit_Hero_WitchDoctor || hero == ClassID.CDOTA_Unit_Hero_Necrolyte || hero == ClassID.CDOTA_Unit_Hero_Warlock || hero == ClassID.CDOTA_Unit_Hero_Rubick || hero == ClassID.CDOTA_Unit_Hero_Huskar || hero == ClassID.CDOTA_Unit_Hero_Shadow_Demon) && Utils.SleepCheck("checkIfSupport")) { return true; } return false; }
/// <summary> /// The draw land mine number. /// </summary> /// <param name="classId"> /// The class id. /// </param> /// <param name="health"> /// The health. /// </param> /// <param name="x"> /// The x. /// </param> /// <param name="sizey"> /// The size y. /// </param> /// <param name="enabled"> /// The enabled. /// </param> private static void DrawLandMineNumber(ClassID classId, float health, double x, double sizey, bool enabled) { var landMinesDmg = Variables.Damage.GetLandMineDamage(Variables.LandMinesAbility.Level, classId); if (!(landMinesDmg > 0)) { return; } var landNumber = Math.Ceiling(health / landMinesDmg); Drawing.DrawText( landNumber.ToString(CultureInfo.InvariantCulture), new Vector2((float)x, (float)sizey), new Vector2(17, 17), enabled ? Color.Red : Color.DimGray, FontFlags.AntiAlias); }
/// <summary> /// Returns if the target has the given Item /// </summary> /// <param name="unit"> /// The unit. /// </param> /// <param name="classId"> /// The class Id. /// </param> /// <returns> /// The <see cref="bool" />. /// </returns> public static bool HasItem(this Unit unit, ClassID classId) { return unit.Inventory.Items.Any(item => item.ClassID == classId); }
/// <summary> /// The get remote mine damage. /// </summary> /// <param name="level"> /// The level. /// </param> /// <param name="classId"> /// The class id. /// </param> /// <param name="creep"> /// The creep. /// </param> /// <returns> /// The <see cref="float" />. /// </returns> public float GetRemoteMineDamage(uint level, ClassID classId, Unit creep = null) { Dictionary<ClassID, float> dictionary; if (!this.remoteMineDamageDictionary.TryGetValue(level, out dictionary)) { var damage = Variables.Techies.AghanimState() ? Variables.RemoteMinesAbility.GetAbilityData("damage_scepter", level) : Variables.RemoteMinesAbility.GetAbilityData("damage", level); dictionary = Heroes.GetByTeam(Variables.EnemyTeam) .ToDictionary( hero => hero.ClassID, hero => hero.DamageTaken(damage, DamageType.Magical, Variables.Techies)); } if (!dictionary.ContainsKey(classId) && (classId == ClassID.CDOTA_BaseNPC_Creep || classId == ClassID.CDOTA_BaseNPC_Creep_Lane || classId == ClassID.CDOTA_BaseNPC_Creep_Siege)) { dictionary.Add( classId, creep.DamageTaken(this.currentRemoteMineDamage, DamageType.Magical, Variables.Techies)); } return !dictionary.ContainsKey(classId) ? 0 : dictionary[classId]; }
public CounterHelp(ClassID hero, string strKey = "", int intKey = 0, float extraRange = 0, NetworkActivity activity = 0, string modifer = "") : this() { _hero = hero; _modifer = modifer; _activity = activity; _intKey = intKey; _strKey = strKey; _extraRange = extraRange; }
public static bool GlowCheck(ClassID id,CSGOPlayer entity, ref Color clr) { switch (id) { case ClassID.CSPlayer: { //if (entity.m_iTeam == Program.localPlayer.m_iTeam) // clr = Color.Blue; //else if (entity.m_bSpotted && (entity.m_iTeam == 3 || entity.m_iTeam == 3)) // clr = Color.Green; //else // clr = Color.Red; break; } case ClassID.AK47: case ClassID.DEagle: case ClassID.WeaponAUG: case ClassID.WeaponAWP: case ClassID.WeaponBizon: case ClassID.WeaponElite: case ClassID.WeaponFiveSeven: case ClassID.WeaponG3SG1: case ClassID.WeaponGalilAR: case ClassID.WeaponGlock: case ClassID.WeaponHKP2000: case ClassID.WeaponM249: case ClassID.WeaponM249x: case ClassID.WeaponM4A1: case ClassID.WeaponMP7: case ClassID.WeaponMP9: case ClassID.WeaponMag7: case ClassID.WeaponNOVA: case ClassID.WeaponNegev: case ClassID.WeaponP250: case ClassID.WeaponP90: case ClassID.WeaponP90x: case ClassID.WeaponSCAR20: case ClassID.WeaponSG556: case ClassID.WeaponSSG08: case ClassID.WeaponTaser: case ClassID.WeaponTec9: case ClassID.WeaponTec9x: case ClassID.WeaponUMP45: case ClassID.WeaponXM1014: case ClassID.WeaponNova: case ClassID.WeaponM4: case ClassID.WeaponUMP45x: case ClassID.WeaponXM1014x: case ClassID.WeaponMAG: case ClassID.WeaponG3SG1x: case ClassID.WeaponDualBerettas: case ClassID.WeaponPPBizon: case ClassID.WeaponSCAR20x: { clr = Color.Violet; break; } case ClassID.HEGrenade: case ClassID.SmokeGrenade: case ClassID.MolotovGrenade: case ClassID.IncendiaryGrenade: case ClassID.Flashbang: case ClassID.DecoyGrenade: case ClassID.ParticleDecoy: case ClassID.ParticleSmokeGrenade: case ClassID.SmokeStack: case ClassID.ParticleIncendiaryGrenade: case ClassID.ParticleFlash: { clr = Color.Green; break; } case ClassID.Hostage: case ClassID.Chicken: { clr = Color.HotPink; break; } case ClassID.C4: case ClassID.PlantedC4: { clr = Color.DarkViolet; break; } default: break; } return clr == Color.Black; }