private void ObjectMonster(S.ObjectMonster p) { MonsterObject mob; for (int i = MapControl.Objects.Count - 1; i >= 0; i--) { MapObject ob = MapControl.Objects[i]; if (ob.ObjectID == p.ObjectID) { mob = (MonsterObject)ob; mob.Load(p, true); return; } } mob = new MonsterObject(p.ObjectID); mob.Load(p); /* string[] mobs = new string[] { "OmaKing", "DarkDevil", "MinotaurKing" }; if (mobs.Contains(mob.Name)) { ChatDialog.ReceiveChat(string.Format("{0} at {1}", p.Name, p.Location), ChatType.Hint); } */ }
private void ObjectMonster(S.ObjectMonster p) { MonsterObject ob = new MonsterObject(p.ObjectID); ob.Load(p); }
private void ObjectMonster(S.ObjectMonster p) { MonsterObject mob; for (int i = MapControl.Objects.Count - 1; i >= 0; i--) { MapObject ob = MapControl.Objects[i]; if (ob.ObjectID == p.ObjectID) { mob = (MonsterObject)ob; mob.Load(p, true); return; } } mob = new MonsterObject(p.ObjectID); mob.Load(p); }
public virtual void CreateLabel() { NameLabel = null; MonsterObject tmp = null; if (Race == ObjectType.Monster) { tmp = (MonsterObject)this; if (!tmp.IsBoss) { tmp = null; } } bool created = false; for (int i = 0; i < LabelList.Count; i++) { if (tmp != null) { // Elite Boss if (tmp.IsElite) { // Not the same name if (LabelList[i].Text != Name || // Text color is not white LabelList[i].ForeColour != Color.White || // Outline color is not the same as Name color LabelList[i].OutLineColour != NameColour) { // Discontinue continue; } // It's the same (I.E Created) NameLabel = LabelList[i]; } // None Elite Boss else { // Not the same name if (LabelList[i].Text != Name || // Text color is not white LabelList[i].ForeColour != Color.White || // Outline color is not Red LabelList[i].OutLineColour != Color.Red) { // Discontinue continue; } // It's the same (I.E Created) NameLabel = LabelList[i]; } } // It wont be a boss label else { if (LabelList[i].Text != Name || LabelList[i].ForeColour != NameColour) { continue; } // It's the same (I.E Created) NameLabel = LabelList[i]; } if (LabelList[i].Text == Name) { created = true; } } if (created) { return; } // Label isn't null if (NameLabel != null && // Label isn't disposed !NameLabel.IsDisposed) { // Already created, don't need to create any more! return; } // The label is valid now check if it by object type and their values if (tmp != null) { // It is a boss if (tmp.IsBoss && !tmp.IsSub && !tmp.IsPet) { // Elite Boss if (tmp.IsElite) { NameLabel = new MirLabel { AutoSize = true, BackColour = Color.Transparent, ForeColour = Color.White, OutLine = true, OutLineColour = tmp.NameColour, Text = Name, }; } // Boss Non Elite else { NameLabel = new MirLabel { AutoSize = true, BackColour = Color.Transparent, ForeColour = Color.White, OutLine = true, OutLineColour = Color.Red, Text = Name, }; } } // Mob else { NameLabel = new MirLabel { AutoSize = true, BackColour = Color.Transparent, ForeColour = NameColour, OutLine = true, OutLineColour = Color.Black, Text = Name, }; } } // Other else { NameLabel = new MirLabel { AutoSize = true, BackColour = Color.Transparent, ForeColour = NameColour, OutLine = true, OutLineColour = OutLine_Colour, Text = Name, }; } NameLabel.Disposing += (o, e) => LabelList.Remove(NameLabel); LabelList.Add(NameLabel); }