private void onMyTargetSelected(L2Packet packet) { packet.Data.SetIndex(3); int objId = packet.Data.ReadInt32(); if (this.lastTarget != objId) { this.labelClan.Text = ""; if (this.knownNpcs.ContainsKey(objId)) { int npcId = this.knownNpcs[objId]; this.labelName.Text = NpcNames.GetInstance().GetName(npcId); this.labelName.ForeColor = Color.LightGray; this.labelTitle.Text = NpcNames.GetInstance().GetTitle(npcId); this.labelTitle.ForeColor = NpcNames.GetInstance().GetColor(npcId); this.lastNpcId = npcId; } else if (this.knownPcs.ContainsKey(objId)) { L2Pc pc = this.knownPcs[objId]; this.labelName.Text = pc.VisibleName; this.labelTitle.Text = pc.Title; this.labelTitle.ForeColor = Color.LightGray; // Karma/PvP this.labelName.ForeColor = Color.LightGray; if (pc.PvpFlag) { this.labelName.ForeColor = Color.Pink; } if (pc.Karma > 0) { this.labelName.ForeColor = Color.Red; } // Clan if (this.knownPlegdes.ContainsKey(pc.ClanId)) { this.labelClan.Text = "Clan: " + this.knownPlegdes[pc.ClanId].ClanName; } } else if (this.myCharObjId == objId) // myself { this.labelName.Text = this.myCharName; this.labelTitle.Text = ""; this.labelTitle.ForeColor = Color.LightGray; } else { this.labelName.Text = "id:" + objId; this.labelName.ForeColor = Color.LightGray; this.labelTitle.Text = ""; } this.lastTarget = objId; } }
static void Main() { #if DEBUG debugStream.AutoFlush = true; debugStream.WriteLine("Starting new Session " + System.DateTime.Now); #endif // read Data NpcNames.GetInstance(); ItemNames.GetInstance(); DropData.GetInstance().OpenDb(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); OptionsForm.Instance.ReadIniFile(); Application.Run(new Form1()); }
public void Show(int mobId) { this.activeList = DropData.GetInstance().GetDrops(mobId); if (this.activeList.Count == 0) { this.myClose(); return; } this.dataGridView1.DataSource = this.activeList; this.Size = calcNewSize(); this.Text = NpcNames.GetInstance().GetName(mobId); // Show the Form if (!this.isShown) { this.isShown = true; this.Show(); } }