public void Set_FollowRest(string name) { FollowRestName = name; bool found = false; CharInfo player = null; Globals.PlayerLock.EnterReadLock(); try { player = Util.GetChar(name); } finally { Globals.PlayerLock.ExitReadLock(); } if (player != null) { found = true; FollowRestID = player.ID; } if (!found) { //FollowRest = 0; FollowRestID = 0; } }
public static void Set_WarState(uint id, int state, uint combat) { Globals.PlayerLock.EnterReadLock(); try { //check if it is already in the list CharInfo player = Util.GetChar(id); if (player != null) { player.isInCombat = combat; if (player.WarState != state) { player.WarState = state; Globals.l2net_home.timer_players.Start(); } if (Globals.gamedata.nearby_chars.ContainsKey(id)) { Globals.gamedata.nearby_chars.Remove(id); Globals.gamedata.nearby_chars.Add(player.ID, player); } } } catch { //oh well } finally { Globals.PlayerLock.ExitReadLock(); } }
private void listView_players_data_DoubleClick(object sender, EventArgs e) { //double click on a player in the list //normal - follow them //cntrl - attack them if (listView_players_data.SelectedIndices.Count > 0) { //action to this item uint id = Util.GetUInt32(listView_players_data.Items[listView_players_data.SelectedIndices[0]].SubItems[5].Text); if (Globals.PlayerLock.TryEnterReadLock(Globals.THREAD_WAIT_GUI)) { try { CharInfo player = Util.GetChar(id); if (player != null) { ServerPackets.ClickChar(id, Util.Float_Int32(player.X), Util.Float_Int32(player.Y), Util.Float_Int32(player.Z), Globals.gamedata.Control, Globals.gamedata.Shift); } } finally { Globals.PlayerLock.ExitReadLock(); } } } }
//////////Other public void Set_ActiveFollow(string name) { ActiveFollowName = name; bool found = false; CharInfo player = null; Globals.PlayerLock.EnterReadLock(); try { player = Util.GetChar(name); } finally { Globals.PlayerLock.ExitReadLock(); } if (player != null) { found = true; ActiveFollowID = player.ID; } if (!found) { //ActiveFollow = 0; ActiveFollowID = 0; } }
private void button_attack_Click(object sender, EventArgs e) { switch (Globals.gamedata.my_char.CurrentTargetType) { case TargetType.ERROR: case TargetType.NONE: break; case TargetType.SELF: break; case TargetType.MYPET: ServerPackets.Force_Attack(Globals.gamedata.my_char.TargetID, Util.Float_Int32(Globals.gamedata.my_pet.X), Util.Float_Int32(Globals.gamedata.my_pet.Y), Util.Float_Int32(Globals.gamedata.my_pet.Z), false); break; case TargetType.MYPET1: ServerPackets.Force_Attack(Globals.gamedata.my_char.TargetID, Util.Float_Int32(Globals.gamedata.my_pet1.X), Util.Float_Int32(Globals.gamedata.my_pet1.Y), Util.Float_Int32(Globals.gamedata.my_pet1.Z), false); break; case TargetType.MYPET2: ServerPackets.Force_Attack(Globals.gamedata.my_char.TargetID, Util.Float_Int32(Globals.gamedata.my_pet2.X), Util.Float_Int32(Globals.gamedata.my_pet2.Y), Util.Float_Int32(Globals.gamedata.my_pet2.Z), false); break; case TargetType.MYPET3: ServerPackets.Force_Attack(Globals.gamedata.my_char.TargetID, Util.Float_Int32(Globals.gamedata.my_pet3.X), Util.Float_Int32(Globals.gamedata.my_pet3.Y), Util.Float_Int32(Globals.gamedata.my_pet3.Z), false); break; case TargetType.PLAYER: Globals.PlayerLock.EnterReadLock(); try { CharInfo player = Util.GetChar(Globals.gamedata.my_char.TargetID); if (player != null) { ServerPackets.Force_Attack(Globals.gamedata.my_char.TargetID, Util.Float_Int32(player.X), Util.Float_Int32(player.Y), Util.Float_Int32(player.Z), false); } } finally { Globals.PlayerLock.ExitReadLock(); } break; case TargetType.NPC: Globals.NPCLock.EnterReadLock(); try { NPCInfo npc = Util.GetNPC(Globals.gamedata.my_char.TargetID); if (npc != null) { ServerPackets.Force_Attack(Globals.gamedata.my_char.TargetID, Util.Float_Int32(npc.X), Util.Float_Int32(npc.Y), Util.Float_Int32(npc.Z), false); } } finally { Globals.NPCLock.ExitReadLock(); } break; } }
private void listView_players_data_SelectedIndexChanged(object sender, EventArgs e) { string text = ""; if (listView_players_data.SelectedIndices.Count > 0) { //action to this item uint id = Util.GetUInt32(listView_players_data.Items[listView_players_data.SelectedIndices[0]].SubItems[5].Text); CharInfo player = null; if (Globals.PlayerLock.TryEnterReadLock(Globals.THREAD_WAIT_GUI)) { try { player = Util.GetChar(id); } finally { Globals.PlayerLock.ExitReadLock(); } } if (player != null) { text = player.Name + Environment.NewLine + player.Title + Environment.NewLine + (player.Sex == 0 ? "Male " : "Female ") + Util.GetRace(player.Race) + " " + Util.GetClass(player.Class) + Environment.NewLine + "R: " + (player.EnchantAmount == 0 ? "" : "+" + player.EnchantAmount.ToString() + " ") + Util.GetItemName(player.RHand) + Environment.NewLine + "LR: " + Util.GetItemName(player.LRHand) + Environment.NewLine + "L: " + Util.GetItemName(player.LHand) + Environment.NewLine + Util.GetItemName(player.Head) + Environment.NewLine + Util.GetItemName(player.Gloves) + Environment.NewLine + Util.GetItemName(player.Feet) + Environment.NewLine + Util.GetItemName(player.Chest) + Environment.NewLine + Util.GetItemName(player.Legs) + Environment.NewLine + Util.GetItemName(player.Back) + Environment.NewLine + Util.GetItemName(player.Hair) + Environment.NewLine + "PvP Flag: " + player.PvPFlag.ToString() + Environment.NewLine + (player.isAlikeDead == 0x00 ? "Alive" : "Dead") + Environment.NewLine + "Karma: " + player.Karma.ToString() + Environment.NewLine + "Cast Speed: " + player.MatkSpeed.ToString() + Environment.NewLine + "Attack Speed: " + (player.PatkSpeed /* * player.AttackSpeedMult*/).ToString() + Environment.NewLine + "Run Speed: " + (player.RunSpeed * player.MoveSpeedMult).ToString() + Environment.NewLine + "Rec: " + player.RecAmount.ToString() + Environment.NewLine + "X: " + player.X.ToString() + Environment.NewLine + "Y: " + player.Y.ToString() + Environment.NewLine + "Z: " + player.Z.ToString() + Environment.NewLine + "Dist: " + Util.Distance(Globals.gamedata.my_char.X, Globals.gamedata.my_char.Y, Globals.gamedata.my_char.Z, player.X, player.Y, player.Z).ToString() + Environment.NewLine + "Unique ID: " + player.ID + Environment.NewLine + "Name Color: " + player.NameColor.ToString(); } } toolTip1.SetToolTip(listView_players_data, text); }
private void FollowRestInternal() { CharInfo player = null; Globals.PlayerLock.EnterReadLock(); try { player = Util.GetChar(Globals.gamedata.botoptions.FollowRestID); } finally { Globals.PlayerLock.ExitReadLock(); } //Globals.l2net_home.Add_Text("Debug: Follow rest activated on: " + player.Name, Globals.Green, TextType.BOT); try { if (player != null) { if ((player.isSitting == 0) && (Globals.gamedata.my_char.isSitting == 1)) //0 = Player is sitting, 1 = my char is standing { //Globals.l2net_home.Add_Text("Debug: Status changed, " + player.Name + " is sitting", Globals.Green, TextType.BOT); Thread.Sleep(1000); SitStandInternal(); Thread.Sleep(3000); //Give the char time to sit down breaktotop = true; } else if ((player.isSitting == 1) && (Globals.gamedata.my_char.isSitting == 0)) //Stand up again { //Globals.l2net_home.Add_Text("Debug: Status changed, " + player.Name + " is standing up again", Globals.Green, TextType.BOT); Thread.Sleep(1000); //Check again in 1000ms SitStandInternal(); Thread.Sleep(3000); //Give the char time to stand up again breaktotop = true; } else { Thread.Sleep(1000); //Long sleep to keep thread from taking too much system resources } } } catch { Globals.l2net_home.Add_Error("crash: FollowRest"); } }
private bool CheckMobZ(uint mob) { Globals.NPCLock.EnterReadLock(); Globals.PlayerLock.EnterReadLock(); bool isgoodmob = false; try { NPCInfo npc = Util.GetNPC(mob); //Globals.l2net_home.Add_Text("z " + Math.Abs(Z - npc.Z), Globals.Green, TextType.BOT); if (npc != null) { if (Math.Abs(Z - npc.Z) < Globals.PICKUP_Z_Diff) { isgoodmob = true; } } else { CharInfo player = Util.GetChar(mob); if (player != null) { if (Math.Abs(Z - npc.Z) < Globals.PICKUP_Z_Diff) { isgoodmob = true; } } else { //some kind of magical item? XD } } } catch { //meh... } finally { Globals.NPCLock.ExitReadLock(); Globals.PlayerLock.ExitReadLock(); } return(isgoodmob); }
static public uint GetCharID(string str) { str = str.ToUpperInvariant(); //is self? if (System.String.Equals(str, Globals.gamedata.my_char.Name.ToUpperInvariant())) { return(Globals.gamedata.my_char.ID); } //is it a party member? Globals.PartyLock.EnterReadLock(); try { PartyMember pmem = Util.GetCharParty(str); if (pmem != null) { return(pmem.ID); } } finally { Globals.PartyLock.ExitReadLock(); } //is in the list of chars? Globals.PlayerLock.EnterReadLock(); try { CharInfo player = Util.GetChar(str); if (player != null) { return(player.ID); } } finally { Globals.PlayerLock.ExitReadLock(); } return(0); }
public bool CheckCombat() { //if we are in combat, check against player and party if (isInCombat == 0) { return(false); } else { //need to change this... //currently... not in combat if target is targeting us, friendly, or npc //if we are targeting the player return false if (this.TargetID == Globals.gamedata.my_char.ID) { return(false); } if (PriorityTarget()) { return(false); } CharInfo char_target = null; Globals.PlayerLock.EnterReadLock(); try { char_target = Util.GetChar(TargetID); } finally { Globals.PlayerLock.ExitReadLock(); } if (char_target != null) { return(true); } return(false); } }
static public string GetCharName(uint id) { //is self? if (id == Globals.gamedata.my_char.ID) { return(Globals.gamedata.my_char.Name); } //is it a party member? Globals.PartyLock.EnterReadLock(); try { PartyMember pmem = Util.GetCharParty(id); if (pmem != null) { return(pmem.Name); } } finally { Globals.PartyLock.ExitReadLock(); } //is in the list of chars? Globals.PlayerLock.EnterReadLock(); try { CharInfo player = Util.GetChar(id); if (player != null) { return(player.Name); } } finally { Globals.PlayerLock.ExitReadLock(); } return("-nobody-"); }
private void BroadCastStautsUpdate(NetPacket np) { //no need to update with data from ourselves or about ourselves if (np.SenderID == Globals.gamedata.my_char.ID || np.ID == Globals.gamedata.my_char.ID) { } else { Globals.PlayerLock.EnterReadLock(); try { //no need to update people in our immediate party (we will get those updates from the server) //...but //any update we recieve directly from a player in our party is probably going to be more up to date than the packet we recieved from the server //so for now... let's actually use the packet... CharInfo player = Util.GetChar(np.ID); if (player != null) { player.Max_CP = np.MaxCP; player.Cur_CP = np.CurCP; player.Max_HP = np.MaxHP; player.Cur_HP = np.CurHP; player.Max_MP = np.MaxMP; player.Cur_MP = np.CurMP; } }//unlock finally { Globals.PlayerLock.ExitReadLock(); if (np.ID == Globals.gamedata.my_char.TargetID) { AddInfo.Set_Target_HP(); } } }//end of else }
public static void Set_Relation(uint id, uint relation) { Globals.PlayerLock.EnterReadLock(); try { CharInfo player = Util.GetChar(id); if (player != null) { // Globals.l2net_home.Add_Text("AddInfo.cs (set) -> ID:" + id + " Relation: " + relation, Globals.Cyan, TextType.BOT); player.Relation = relation; // Globals.l2net_home.Add_Text("AddInfo.cs (read) -> ID:" + player.ID + " Relation: " + player.Relation, Globals.Cyan, TextType.BOT); } } catch { // oh well } finally { Globals.PlayerLock.ExitReadLock(); } }
private void UpdataHealInfo() { CharInfo player = null; Globals.PlayerLock.EnterReadLock(); try { player = Util.GetChar(ID); }//unlock finally { Globals.PlayerLock.ExitReadLock(); } if (player != null) { player.Cur_HP = Cur_HP; player.Max_HP = Max_HP; player.Cur_MP = Cur_MP; player.Max_MP = Max_MP; player.Cur_CP = Cur_CP; player.Max_CP = Max_CP; } }
private static void AnimateStuff() { bool found = false; float vx, vy, vz; float vxx; float movespeed; float time; ////////////////////////////////Animate self try { if (Globals.gamedata.my_char.Moving == true) { if (Globals.gamedata.OOG && ((System.TimeSpan)(System.DateTime.Now - Globals.gamedata.my_char.lastVerifyTime)).Milliseconds > 1000) { //send the verify pos packet ServerPackets.Send_Verify(); } if (Globals.gamedata.my_char.MoveTarget != 0) { found = false; //need to set the dest switch (Globals.gamedata.my_char.MoveTargetType) { case TargetType.ERROR: case TargetType.NONE: //shouldn't get this ever //Globals.l2net_home.Add_OnlyDebug("MoveToPawn MoveTargetType invalid - char: " + Globals.gamedata.my_char.Name + ":" + Globals.gamedata.my_char.ID.ToString() + "--: " + Globals.gamedata.my_char.MoveTarget.ToString()); break; case TargetType.SELF: //shouldn't get this ever... Globals.gamedata.my_char.Dest_X = Globals.gamedata.my_char.X; Globals.gamedata.my_char.Dest_Y = Globals.gamedata.my_char.Y; Globals.gamedata.my_char.Dest_Z = Globals.gamedata.my_char.Z; found = true; break; case TargetType.MYPET: Globals.gamedata.my_char.Dest_X = Globals.gamedata.my_pet.X; Globals.gamedata.my_char.Dest_Y = Globals.gamedata.my_pet.Y; Globals.gamedata.my_char.Dest_Z = Globals.gamedata.my_pet.Z; found = true; break; case TargetType.MYPET1: Globals.gamedata.my_char.Dest_X = Globals.gamedata.my_pet1.X; Globals.gamedata.my_char.Dest_Y = Globals.gamedata.my_pet1.Y; Globals.gamedata.my_char.Dest_Z = Globals.gamedata.my_pet1.Z; found = true; break; case TargetType.MYPET2: Globals.gamedata.my_char.Dest_X = Globals.gamedata.my_pet2.X; Globals.gamedata.my_char.Dest_Y = Globals.gamedata.my_pet2.Y; Globals.gamedata.my_char.Dest_Z = Globals.gamedata.my_pet2.Z; found = true; break; case TargetType.MYPET3: Globals.gamedata.my_char.Dest_X = Globals.gamedata.my_pet3.X; Globals.gamedata.my_char.Dest_Y = Globals.gamedata.my_pet3.Y; Globals.gamedata.my_char.Dest_Z = Globals.gamedata.my_pet3.Z; found = true; break; case TargetType.PLAYER: CharInfo player_target = null; Globals.PlayerLock.EnterReadLock(); try { player_target = Util.GetChar(Globals.gamedata.my_char.MoveTarget); } finally { Globals.PlayerLock.ExitReadLock(); } if (player_target != null) { Globals.gamedata.my_char.Dest_X = player_target.X; Globals.gamedata.my_char.Dest_Y = player_target.Y; Globals.gamedata.my_char.Dest_Z = player_target.Z; found = true; } break; case TargetType.NPC: NPCInfo npc_target = null; Globals.NPCLock.EnterReadLock(); try { npc_target = Util.GetNPC(Globals.gamedata.my_char.MoveTarget); } finally { Globals.NPCLock.ExitReadLock(); } if (npc_target != null) { Globals.gamedata.my_char.Dest_X = npc_target.X; Globals.gamedata.my_char.Dest_Y = npc_target.Y; Globals.gamedata.my_char.Dest_Z = npc_target.Z; found = true; } break; case TargetType.ITEM: ItemInfo item_target = null; Globals.ItemLock.EnterReadLock(); try { item_target = Util.GetItem(Globals.gamedata.my_char.MoveTarget); } finally { Globals.ItemLock.ExitReadLock(); } if (item_target != null) { Globals.gamedata.my_char.Dest_X = item_target.X; Globals.gamedata.my_char.Dest_Y = item_target.Y; Globals.gamedata.my_char.Dest_Z = item_target.Z; found = true; } break; } if (!found) { Globals.gamedata.my_char.Dest_X = Globals.gamedata.my_char.X; Globals.gamedata.my_char.Dest_Y = Globals.gamedata.my_char.Y; Globals.gamedata.my_char.Dest_Z = Globals.gamedata.my_char.Z; } } //move me towards my target vx = Globals.gamedata.my_char.Dest_X - Globals.gamedata.my_char.X; vy = Globals.gamedata.my_char.Dest_Y - Globals.gamedata.my_char.Y; vz = Globals.gamedata.my_char.Dest_Z - Globals.gamedata.my_char.Z; //movespeed = ((float)my_char.RunSpeed)*ch.MoveSpeedMult; movespeed = Globals.gamedata.my_char.RunSpeed * Globals.gamedata.my_char.MoveSpeedMult; time = System.Convert.ToSingle(((System.TimeSpan)(System.DateTime.Now - Globals.gamedata.my_char.lastMoveTime)).Milliseconds) * Globals.INV_THOUSAND; vxx = System.Convert.ToSingle(Math.Sqrt(vx * vx + vy * vy + vz * vz)); if (vxx != 0) { vxx = Util.Float_Cap((movespeed * time) / vxx); } vx *= vxx; vy *= vxx; vz *= vxx; Globals.gamedata.my_char.X += vx; Globals.gamedata.my_char.Y += vy; Globals.gamedata.my_char.Z += vz; Globals.gamedata.my_char.lastMoveTime = System.DateTime.Now; if ((Globals.gamedata.my_char.MoveTarget == 0) && (Math.Sqrt(Math.Pow(Globals.gamedata.my_char.X - Globals.gamedata.my_char.Dest_X, 2) + Math.Pow(Globals.gamedata.my_char.Y - Globals.gamedata.my_char.Dest_Y, 2) + Math.Pow(Globals.gamedata.my_char.Z - Globals.gamedata.my_char.Dest_Z, 2)) < Globals.THRESHOLD)) { Globals.gamedata.my_char.Moving = false; } } } catch { Globals.l2net_home.Add_Error("crash: Animate self"); } ///////////////////////Animate Pet if (Globals.gamedata.my_pet.ID != 0) { try { if (Globals.gamedata.my_pet.Moving == true) { if (Globals.gamedata.my_pet.MoveTarget != 0) { found = false; //need to set the dest switch (Globals.gamedata.my_pet.MoveTargetType) { case TargetType.ERROR: case TargetType.NONE: //shouldn't get this ever //Globals.l2net_home.Add_OnlyDebug("MoveToPawn MoveTargetType invalid - pet: " + Globals.gamedata.my_pet.Name + ":" + Globals.gamedata.my_pet.ID.ToString() + "--: " + Globals.gamedata.my_pet.MoveTarget.ToString()); break; case TargetType.SELF: Globals.gamedata.my_pet.Dest_X = Globals.gamedata.my_char.X; Globals.gamedata.my_pet.Dest_Y = Globals.gamedata.my_char.Y; Globals.gamedata.my_pet.Dest_Z = Globals.gamedata.my_char.Z; found = true; break; case TargetType.MYPET: //shouldn't get this ever... Globals.gamedata.my_pet.Dest_X = Globals.gamedata.my_pet.X; Globals.gamedata.my_pet.Dest_Y = Globals.gamedata.my_pet.Y; Globals.gamedata.my_pet.Dest_Z = Globals.gamedata.my_pet.Z; found = true; break; case TargetType.MYPET1: //shouldn't get this ever... Globals.gamedata.my_pet1.Dest_X = Globals.gamedata.my_pet1.X; Globals.gamedata.my_pet1.Dest_Y = Globals.gamedata.my_pet1.Y; Globals.gamedata.my_pet1.Dest_Z = Globals.gamedata.my_pet1.Z; found = true; break; case TargetType.MYPET2: //shouldn't get this ever... Globals.gamedata.my_pet2.Dest_X = Globals.gamedata.my_pet2.X; Globals.gamedata.my_pet2.Dest_Y = Globals.gamedata.my_pet2.Y; Globals.gamedata.my_pet2.Dest_Z = Globals.gamedata.my_pet2.Z; found = true; break; case TargetType.MYPET3: //shouldn't get this ever... Globals.gamedata.my_pet3.Dest_X = Globals.gamedata.my_pet3.X; Globals.gamedata.my_pet3.Dest_Y = Globals.gamedata.my_pet3.Y; Globals.gamedata.my_pet3.Dest_Z = Globals.gamedata.my_pet3.Z; found = true; break; case TargetType.PLAYER: CharInfo player_target = null; Globals.PlayerLock.EnterReadLock(); try { player_target = Util.GetChar(Globals.gamedata.my_pet.MoveTarget); } finally { Globals.PlayerLock.ExitReadLock(); } if (player_target != null) { Globals.gamedata.my_pet.Dest_X = player_target.X; Globals.gamedata.my_pet.Dest_Y = player_target.Y; Globals.gamedata.my_pet.Dest_Z = player_target.Z; found = true; } break; case TargetType.NPC: NPCInfo npc_target = null; Globals.NPCLock.EnterReadLock(); try { npc_target = Util.GetNPC(Globals.gamedata.my_pet.MoveTarget); } finally { Globals.NPCLock.ExitReadLock(); } if (npc_target != null) { Globals.gamedata.my_pet.Dest_X = npc_target.X; Globals.gamedata.my_pet.Dest_Y = npc_target.Y; Globals.gamedata.my_pet.Dest_Z = npc_target.Z; found = true; } break; case TargetType.ITEM: ItemInfo item_target = null; Globals.ItemLock.EnterReadLock(); try { item_target = Util.GetItem(Globals.gamedata.my_pet.MoveTarget); } finally { Globals.ItemLock.ExitReadLock(); } if (item_target != null) { Globals.gamedata.my_pet.Dest_X = item_target.X; Globals.gamedata.my_pet.Dest_Y = item_target.Y; Globals.gamedata.my_pet.Dest_Z = item_target.Z; found = true; } break; } if (!found) { Globals.gamedata.my_pet.Dest_X = Globals.gamedata.my_pet.X; Globals.gamedata.my_pet.Dest_Y = Globals.gamedata.my_pet.Y; Globals.gamedata.my_pet.Dest_Z = Globals.gamedata.my_pet.Z; } } //move me towards my target vx = Globals.gamedata.my_pet.Dest_X - Globals.gamedata.my_pet.X; vy = Globals.gamedata.my_pet.Dest_Y - Globals.gamedata.my_pet.Y; vz = Globals.gamedata.my_pet.Dest_Z - Globals.gamedata.my_pet.Z; //movespeed = ((float)my_char.RunSpeed)*ch.MoveSpeedMult; movespeed = Globals.gamedata.my_pet.RunSpeed * Globals.gamedata.my_pet.MoveSpeedMult; time = System.Convert.ToSingle(((System.TimeSpan)(System.DateTime.Now - Globals.gamedata.my_pet.lastMoveTime)).Milliseconds) * Globals.INV_THOUSAND; vxx = System.Convert.ToSingle(Math.Sqrt(vx * vx + vy * vy + vz * vz)); if (vxx != 0) { vxx = Util.Float_Cap((movespeed * time) / vxx); } vx *= vxx; vy *= vxx; vz *= vxx; Globals.gamedata.my_pet.X += vx; Globals.gamedata.my_pet.Y += vy; Globals.gamedata.my_pet.Z += vz; Globals.gamedata.my_pet.lastMoveTime = System.DateTime.Now; if ((Globals.gamedata.my_pet.MoveTarget == 0) && (Math.Sqrt(Math.Pow(Globals.gamedata.my_pet.X - Globals.gamedata.my_pet.Dest_X, 2) + Math.Pow(Globals.gamedata.my_pet.Y - Globals.gamedata.my_pet.Dest_Y, 2) + Math.Pow(Globals.gamedata.my_pet.Z - Globals.gamedata.my_pet.Dest_Z, 2)) < Globals.THRESHOLD)) { Globals.gamedata.my_pet.Moving = false; } } } catch { Globals.l2net_home.Add_Error("crash: Animate pet"); } } ///////////////////////Animate other chars Globals.PlayerLock.EnterReadLock(); try { foreach (CharInfo player in Globals.gamedata.nearby_chars.Values) { if (player.Moving) { if (player.MoveTarget != 0) { found = false; //need to set the dest switch (player.MoveTargetType) { case TargetType.ERROR: case TargetType.NONE: //shouldn't get this ever... //Globals.l2net_home.Add_OnlyDebug("MoveToPawn MoveTargetType invalid - pc: " + player.Name + ":" + player.ID.ToString() + "--: " + player.MoveTarget.ToString()); break; case TargetType.SELF: player.Dest_X = Globals.gamedata.my_char.X; player.Dest_Y = Globals.gamedata.my_char.Y; player.Dest_Z = Globals.gamedata.my_char.Z; found = true; break; case TargetType.MYPET: player.Dest_X = Globals.gamedata.my_pet.X; player.Dest_Y = Globals.gamedata.my_pet.Y; player.Dest_Z = Globals.gamedata.my_pet.Z; found = true; break; case TargetType.MYPET1: player.Dest_X = Globals.gamedata.my_pet1.X; player.Dest_Y = Globals.gamedata.my_pet1.Y; player.Dest_Z = Globals.gamedata.my_pet1.Z; found = true; break; case TargetType.MYPET2: player.Dest_X = Globals.gamedata.my_pet2.X; player.Dest_Y = Globals.gamedata.my_pet2.Y; player.Dest_Z = Globals.gamedata.my_pet2.Z; found = true; break; case TargetType.MYPET3: player.Dest_X = Globals.gamedata.my_pet3.X; player.Dest_Y = Globals.gamedata.my_pet3.Y; player.Dest_Z = Globals.gamedata.my_pet3.Z; found = true; break; case TargetType.PLAYER: CharInfo player_target = null; //no need to lock... we already have a writer lock player_target = Util.GetChar(Globals.gamedata.my_char.MoveTarget); if (player_target != null) { player.Dest_X = player_target.X; player.Dest_Y = player_target.Y; player.Dest_Z = player_target.Z; found = true; } break; case TargetType.NPC: NPCInfo npc_target = null; Globals.NPCLock.EnterReadLock(); try { npc_target = Util.GetNPC(player.MoveTarget); } finally { Globals.NPCLock.ExitReadLock(); } if (npc_target != null) { player.Dest_X = npc_target.X; player.Dest_Y = npc_target.Y; player.Dest_Z = npc_target.Z; found = true; } break; case TargetType.ITEM: ItemInfo item_target = null; Globals.ItemLock.EnterReadLock(); try { item_target = Util.GetItem(player.MoveTarget); } //unlock finally { Globals.ItemLock.ExitReadLock(); } if (item_target != null) { player.Dest_X = item_target.X; player.Dest_Y = item_target.Y; player.Dest_Z = item_target.Z; found = true; } break; } if (!found) { player.Dest_X = player.X; player.Dest_Y = player.Y; player.Dest_Z = player.Z; } } vx = player.Dest_X - player.X; vy = player.Dest_Y - player.Y; vz = player.Dest_Z - player.Z; if (player.isRunning != 0) { movespeed = player.RunSpeed * player.MoveSpeedMult; } else { movespeed = player.WalkSpeed * player.MoveSpeedMult; } time = System.Convert.ToSingle(((System.TimeSpan)(System.DateTime.Now - player.lastMoveTime)).Milliseconds) * Globals.INV_THOUSAND; vxx = System.Convert.ToSingle(Math.Sqrt(vx * vx + vy * vy + vz * vz)); if (vxx != 0) { vxx = Util.Float_Cap((movespeed * time) / vxx); } vx *= vxx; vy *= vxx; vz *= vxx; player.X += Util.Float_Int32(vx); player.Y += Util.Float_Int32(vy); player.Z += Util.Float_Int32(vz); player.lastMoveTime = System.DateTime.Now; if ((player.MoveTarget == 0) && (Math.Sqrt(Math.Pow(player.X - player.Dest_X, 2) + Math.Pow(player.Y - player.Dest_Y, 2) + Math.Pow(player.Z - player.Dest_Z, 2)) < Globals.THRESHOLD)) { player.Moving = false; } } } }//unlock catch { Globals.l2net_home.Add_Error("crash: Animate other players"); } finally { Globals.PlayerLock.ExitReadLock(); } //animate npcs Globals.NPCLock.EnterReadLock(); try { foreach (NPCInfo npc in Globals.gamedata.nearby_npcs.Values) { if (npc.Moving) { if (npc.MoveTarget != 0) { found = false; //need to set the dest switch (npc.MoveTargetType) { case TargetType.ERROR: case TargetType.NONE: //shouldn't get this ever... //Globals.l2net_home.Add_OnlyDebug("MoveToPawn MoveTargetType invalid - npc: " + npc.Name + ":" + npc.ID.ToString() + "--: " + npc.MoveTarget.ToString()); break; case TargetType.SELF: npc.Dest_X = Globals.gamedata.my_char.X; npc.Dest_Y = Globals.gamedata.my_char.Y; npc.Dest_Z = Globals.gamedata.my_char.Z; found = true; break; case TargetType.MYPET: npc.Dest_X = Globals.gamedata.my_pet.X; npc.Dest_Y = Globals.gamedata.my_pet.Y; npc.Dest_Z = Globals.gamedata.my_pet.Z; found = true; break; case TargetType.MYPET1: npc.Dest_X = Globals.gamedata.my_pet1.X; npc.Dest_Y = Globals.gamedata.my_pet1.Y; npc.Dest_Z = Globals.gamedata.my_pet1.Z; found = true; break; case TargetType.MYPET2: npc.Dest_X = Globals.gamedata.my_pet2.X; npc.Dest_Y = Globals.gamedata.my_pet2.Y; npc.Dest_Z = Globals.gamedata.my_pet2.Z; found = true; break; case TargetType.MYPET3: npc.Dest_X = Globals.gamedata.my_pet3.X; npc.Dest_Y = Globals.gamedata.my_pet3.Y; npc.Dest_Z = Globals.gamedata.my_pet3.Z; found = true; break; case TargetType.PLAYER: CharInfo player_target = null; Globals.PlayerLock.EnterReadLock(); try { player_target = Util.GetChar(npc.MoveTarget); } finally { Globals.PlayerLock.ExitReadLock(); } if (player_target != null) { npc.Dest_X = player_target.X; npc.Dest_Y = player_target.Y; npc.Dest_Z = player_target.Z; found = true; } break; case TargetType.NPC: NPCInfo npc_target = null; //no need to lock... we already have a writer lock npc_target = Util.GetNPC(npc.MoveTarget); if (npc_target != null) { npc.Dest_X = npc_target.X; npc.Dest_Y = npc_target.Y; npc.Dest_Z = npc_target.Z; found = true; } break; case TargetType.ITEM: ItemInfo item_target = null; Globals.ItemLock.EnterReadLock(); try { item_target = Util.GetItem(npc.MoveTarget); } finally { Globals.ItemLock.ExitReadLock(); } if (item_target != null) { npc.Dest_X = item_target.X; npc.Dest_Y = item_target.Y; npc.Dest_Z = item_target.Z; found = true; } break; }//end of switch if (!found) { npc.Dest_X = npc.X; npc.Dest_Y = npc.Y; npc.Dest_Z = npc.Z; } } vx = npc.Dest_X - npc.X; vy = npc.Dest_Y - npc.Y; vz = npc.Dest_Z - npc.Z; if (npc.isRunning != 0) { movespeed = npc.RunSpeed * npc.MoveSpeedMult; } else { movespeed = npc.WalkSpeed * npc.MoveSpeedMult; } time = System.Convert.ToSingle(((System.TimeSpan)(System.DateTime.Now - npc.lastMoveTime)).Milliseconds) * Globals.INV_THOUSAND; vxx = System.Convert.ToSingle(Math.Sqrt(vx * vx + vy * vy + vz * vz)); if (vxx != 0) { vxx = Util.Float_Cap((movespeed * time) / vxx); } vx *= vxx; vy *= vxx; vz *= vxx; npc.X += Util.Float_Int32(vx); npc.Y += Util.Float_Int32(vy); npc.Z += Util.Float_Int32(vz); npc.lastMoveTime = System.DateTime.Now; if ((npc.MoveTarget == 0) && (Math.Sqrt(Math.Pow(npc.X - npc.Dest_X, 2) + Math.Pow(npc.Y - npc.Dest_Y, 2) + Math.Pow(npc.Z - npc.Dest_Z, 2)) < Globals.THRESHOLD)) { npc.Moving = false; } } } }//unlock catch { Globals.l2net_home.Add_Error("crash: Animate npcs"); } finally { Globals.NPCLock.ExitReadLock(); } }//end of AnimateStuff
private void ListTargetInfo() { string cp = "0/0"; string hp = "0/0"; string mp = "0/0"; uint target_id = Globals.gamedata.my_char.TargetID; switch (Globals.gamedata.my_char.CurrentTargetType) { case TargetType.SELF: hp = Globals.gamedata.my_char.Cur_HP.ToString() + "/" + Globals.gamedata.my_char.Max_HP.ToString(); mp = Globals.gamedata.my_char.Cur_MP.ToString() + "/" + Globals.gamedata.my_char.Max_MP.ToString(); cp = Globals.gamedata.my_char.Cur_CP.ToString() + "/" + Globals.gamedata.my_char.Max_CP.ToString(); break; case TargetType.MYPET: hp = Globals.gamedata.my_pet.Cur_HP.ToString() + "/" + Globals.gamedata.my_pet.Max_HP.ToString(); mp = Globals.gamedata.my_pet.Cur_MP.ToString() + "/" + Globals.gamedata.my_pet.Max_MP.ToString(); cp = Globals.gamedata.my_pet.Cur_CP.ToString() + "/" + Globals.gamedata.my_pet.Max_CP.ToString(); break; case TargetType.MYPET1: hp = Globals.gamedata.my_pet1.Cur_HP.ToString() + "/" + Globals.gamedata.my_pet1.Max_HP.ToString(); mp = Globals.gamedata.my_pet1.Cur_MP.ToString() + "/" + Globals.gamedata.my_pet1.Max_MP.ToString(); cp = Globals.gamedata.my_pet1.Cur_CP.ToString() + "/" + Globals.gamedata.my_pet1.Max_CP.ToString(); break; case TargetType.MYPET2: hp = Globals.gamedata.my_pet2.Cur_HP.ToString() + "/" + Globals.gamedata.my_pet2.Max_HP.ToString(); mp = Globals.gamedata.my_pet2.Cur_MP.ToString() + "/" + Globals.gamedata.my_pet2.Max_MP.ToString(); cp = Globals.gamedata.my_pet2.Cur_CP.ToString() + "/" + Globals.gamedata.my_pet2.Max_CP.ToString(); break; case TargetType.MYPET3: hp = Globals.gamedata.my_pet3.Cur_HP.ToString() + "/" + Globals.gamedata.my_pet3.Max_HP.ToString(); mp = Globals.gamedata.my_pet3.Cur_MP.ToString() + "/" + Globals.gamedata.my_pet3.Max_MP.ToString(); cp = Globals.gamedata.my_pet3.Cur_CP.ToString() + "/" + Globals.gamedata.my_pet3.Max_CP.ToString(); break; case TargetType.PLAYER: Globals.PlayerLock.EnterReadLock(); try { CharInfo player = Util.GetChar(target_id); if (player != null) { /*if (Globals.gamedata.Chron >= Chronicle.CT2_4 && Globals.gamedata.Official_Server) * { * /* * hp = ("HP: " + player.Cur_HP / 100000).ToString() + "%"; * mp = ("MP: " + player.Cur_MP / 100000).ToString() + "%"; * cp = ("CP: " + player.Cur_CP / 100000).ToString() + "%"; * hp = ("HP: " + (player.Cur_HP / 10000000).ToString("P", System.Globalization.CultureInfo.InvariantCulture)); * mp = ("CP: " + (player.Cur_MP / 10000000).ToString("P", System.Globalization.CultureInfo.InvariantCulture)); * cp = ("MP: " + (player.Cur_CP / 10000000).ToString("P", System.Globalization.CultureInfo.InvariantCulture)); * * } * else * {*/ hp = player.Cur_HP.ToString() + "/" + player.Max_HP.ToString(); mp = player.Cur_MP.ToString() + "/" + player.Max_MP.ToString(); cp = player.Cur_CP.ToString() + "/" + player.Max_CP.ToString(); //} } } //unlock finally { Globals.PlayerLock.ExitReadLock(); } break; case TargetType.NPC: Globals.NPCLock.EnterReadLock(); try { NPCInfo npc = Util.GetNPC(target_id); if (npc != null) { hp = npc.Cur_HP.ToString() + "/" + npc.Max_HP.ToString(); mp = npc.Cur_MP.ToString() + "/" + npc.Max_MP.ToString(); cp = npc.Cur_CP.ToString() + "/" + npc.Max_CP.ToString(); label_targetinfo.Text = "Target Info: " + Environment.NewLine + "ID : " + npc.ID.ToString() + Environment.NewLine + "NPCID: " + npc.NPCID.ToString() + Environment.NewLine + "Attackable: " + npc.isAttackable.ToString() + Environment.NewLine + "X: " + npc.X.ToString() + Environment.NewLine + "Y: " + npc.Y.ToString() + Environment.NewLine + "Z: " + npc.Z.ToString() + Environment.NewLine + "Heading: " + npc.Heading.ToString() + Environment.NewLine + "MAtk Speed: " + npc.MatkSpeed.ToString() + Environment.NewLine + "PAtk Speed: " + npc.PatkSpeed.ToString() + Environment.NewLine + "Run Speed: " + npc.RunSpeed.ToString() + Environment.NewLine + "Walk Speed: " + npc.WalkSpeed.ToString() + Environment.NewLine + "Move Speed Mult: " + npc.MoveSpeedMult.ToString() + Environment.NewLine + "Atk Speed Mult: " + npc.AttackSpeedMult.ToString() + Environment.NewLine + "Collision Rad: " + npc.CollisionRadius.ToString() + Environment.NewLine + "Collision Height: " + npc.CollisionHeight.ToString() + Environment.NewLine + "RHand: " + npc.RHand.ToString() + Environment.NewLine + "LHand: " + npc.LHand.ToString() + Environment.NewLine + "LRHand: " + npc.LRHand.ToString() + Environment.NewLine + "NameShows: " + npc.NameShows.ToString() + Environment.NewLine + "IsRunning: " + npc.isRunning.ToString() + Environment.NewLine + "IsInCombat: " + npc.isInCombat.ToString() + Environment.NewLine + "IsAlikeDead: " + npc.isAlikeDead.ToString() + Environment.NewLine + "IsInvisible: " + npc.isInvisible.ToString() + Environment.NewLine + "IsSitting: " + npc.isSitting.ToString(); } } //unlock finally { Globals.NPCLock.ExitReadLock(); } break; } }
public static string TARGET_STRING(string req) { switch (Globals.gamedata.my_char.CurrentTargetType) { case TargetType.ERROR: case TargetType.NONE: break; case TargetType.SELF: switch (req) { case "NAME": return(Globals.gamedata.my_char.Name); case "TITLE": return(Globals.gamedata.my_char.Title); case "CLAN": return(((Clan_Info)Globals.clanlist[Globals.gamedata.my_char.ClanID]).ClanName); case "ALLY": return(((Clan_Info)Globals.clanlist[Globals.gamedata.my_char.ClanID]).AllyName); default: ScriptEngine.Script_Error("invalid invalid target data(self) request"); break; } break; case TargetType.MYPET: switch (req) { case "NAME": return(Globals.gamedata.my_pet.Name); case "TITLE": return(Globals.gamedata.my_pet.Title); case "CLAN": return(((Clan_Info)Globals.clanlist[Globals.gamedata.my_char.ClanID]).ClanName); case "ALLY": return(((Clan_Info)Globals.clanlist[Globals.gamedata.my_char.ClanID]).AllyName); default: ScriptEngine.Script_Error("invalid invalid target data(my pet) request"); break; } break; case TargetType.MYPET1: switch (req) { case "NAME": return(Globals.gamedata.my_pet1.Name); case "TITLE": return(Globals.gamedata.my_pet1.Title); case "CLAN": return(((Clan_Info)Globals.clanlist[Globals.gamedata.my_char.ClanID]).ClanName); case "ALLY": return(((Clan_Info)Globals.clanlist[Globals.gamedata.my_char.ClanID]).AllyName); default: ScriptEngine.Script_Error("invalid invalid target data(my pet) request"); break; } break; case TargetType.MYPET2: switch (req) { case "NAME": return(Globals.gamedata.my_pet2.Name); case "TITLE": return(Globals.gamedata.my_pet2.Title); case "CLAN": return(((Clan_Info)Globals.clanlist[Globals.gamedata.my_char.ClanID]).ClanName); case "ALLY": return(((Clan_Info)Globals.clanlist[Globals.gamedata.my_char.ClanID]).AllyName); default: ScriptEngine.Script_Error("invalid invalid target data(my pet) request"); break; } break; case TargetType.MYPET3: switch (req) { case "NAME": return(Globals.gamedata.my_pet3.Name); case "TITLE": return(Globals.gamedata.my_pet3.Title); case "CLAN": return(((Clan_Info)Globals.clanlist[Globals.gamedata.my_char.ClanID]).ClanName); case "ALLY": return(((Clan_Info)Globals.clanlist[Globals.gamedata.my_char.ClanID]).AllyName); default: ScriptEngine.Script_Error("invalid invalid target data(my pet) request"); break; } break; case TargetType.PLAYER: Globals.PlayerLock.EnterReadLock(); try { CharInfo player = Util.GetChar(Globals.gamedata.my_char.TargetID); if (player != null) { switch (req) { case "NAME": return(player.Name); case "TITLE": return(player.Title); case "CLAN": return(((Clan_Info)Globals.clanlist[player.ClanID]).ClanName); case "ALLY": return(((Clan_Info)Globals.clanlist[player.ClanID]).AllyName); default: ScriptEngine.Script_Error("invalid invalid target data(player) request"); break; } } } //unlock finally { Globals.PlayerLock.ExitReadLock(); } break; case TargetType.NPC: Globals.NPCLock.EnterReadLock(); try { NPCInfo npc = Util.GetNPC(Globals.gamedata.my_char.TargetID); if (npc != null) { switch (req) { case "NAME": return(Util.GetNPCName(npc.NPCID)); case "TITLE": return(npc.Title); default: ScriptEngine.Script_Error("invalid target data(npc) request"); break; } } } //unlock finally { Globals.NPCLock.ExitReadLock(); } break; } return(""); }
private void UpdatePlayerListInternal() { bool Active = true; float x = Globals.gamedata.my_char.X; float y = Globals.gamedata.my_char.Y; float z = Globals.gamedata.my_char.Z; System.Collections.ArrayList dirty_items = new System.Collections.ArrayList(); for (int i = 0; i < listView_players_data_items.Count; i++) { uint id = Util.GetUInt32(((ListViewItem)listView_players_data_items[i]).SubItems[5].Text); if (Globals.gamedata.nearby_chars.ContainsKey(id)) { CharInfo player = Util.GetChar(id); player.InList = true; //update it ((ListViewItem)listView_players_data_items[i]).SubItems[0].Text = player.WarState.ToString(); //((ListViewItem)listView_players_data_items[i]).SubItems[1].Text = player.Name; if (Active) { ((ListViewItem)listView_players_data_items[i]).SubItems[2].Text = Util.GetClass(player.Class) + (player.isAlikeDead == 0x00 ? " :A: " : " :D: ") + ((int)Util.Distance(x, y, z, player.X, player.Y, player.Z)).ToString("0000"); } else { ((ListViewItem)listView_players_data_items[i]).SubItems[2].Text = Util.GetClass(player.Class); } ((ListViewItem)listView_players_data_items[i]).SubItems[3].Text = player.ClanName; //clan ((ListViewItem)listView_players_data_items[i]).SubItems[4].Text = player.AllyName; //ally //((ListViewItem)listView_players_data_items[i]).SubItems[5].Text = player.ID.ToString();//didnt change ((ListViewItem)listView_players_data_items[i]).ImageIndex = player.ClanCrestIndex; } else { dirty_items.Add(i); } } //need to remove all dirty items now for (int i = dirty_items.Count - 1; i >= 0; i--) { listView_players_data_items.RemoveAt((int)dirty_items[i]); } dirty_items.Clear(); foreach (CharInfo player in Globals.gamedata.nearby_chars.Values) { //find the item in our arraylist... if (!player.InList) { player.InList = true; //add it System.Windows.Forms.ListViewItem ObjListItem; ObjListItem = new ListViewItem(player.WarState.ToString()); //war ObjListItem.SubItems.Add(player.Name); //name if (Active) { ObjListItem.SubItems.Add(Util.GetClass(player.Class) + (player.isAlikeDead == 0x00 ? " :A: " : " :D: ") + ((int)Util.Distance(x, y, z, player.X, player.Y, player.Z)).ToString("0000"));//class } else { ObjListItem.SubItems.Add(Util.GetClass(player.Class)); //class } ObjListItem.SubItems.Add(player.ClanName); //clan ObjListItem.SubItems.Add(player.AllyName); //ally ObjListItem.SubItems.Add(player.ID.ToString()); //ID //UpdateClanInfo(ObjListItem); if (player.ClanCrestIndex != 0) { ObjListItem.ImageIndex = player.ClanCrestIndex; } else { ObjListItem.ImageIndex = -1; } //oop cache if (Globals.gamedata.botoptions.OOPNamesArray.Contains(player.Name.ToUpperInvariant())) { if (!Globals.gamedata.botoptions.OOPIDs.Contains(player.ID)) { Globals.gamedata.botoptions.OOPIDs.Add(player.ID); } } listView_players_data_items.Add(ObjListItem); } } }
static public void GetCharLoc(uint id, ref int x, ref int y, ref int z) { //this is for getting the location of a player, self or otherwise, for the purpose of buffing //dont give 2 shits about buffing mobs/items //is self? if (Globals.gamedata.my_char.ID == id) { x = Util.Float_Int32(Globals.gamedata.my_char.X); y = Util.Float_Int32(Globals.gamedata.my_char.Y); z = Util.Float_Int32(Globals.gamedata.my_char.Z); return; } //is my pet? if (Globals.gamedata.my_pet.ID == id) { x = Util.Float_Int32(Globals.gamedata.my_pet.X); y = Util.Float_Int32(Globals.gamedata.my_pet.Y); z = Util.Float_Int32(Globals.gamedata.my_pet.Z); return; } if (Globals.gamedata.my_pet1.ID == id) { x = Util.Float_Int32(Globals.gamedata.my_pet1.X); y = Util.Float_Int32(Globals.gamedata.my_pet1.Y); z = Util.Float_Int32(Globals.gamedata.my_pet1.Z); return; } if (Globals.gamedata.my_pet2.ID == id) { x = Util.Float_Int32(Globals.gamedata.my_pet2.X); y = Util.Float_Int32(Globals.gamedata.my_pet2.Y); z = Util.Float_Int32(Globals.gamedata.my_pet2.Z); return; } if (Globals.gamedata.my_pet3.ID == id) { x = Util.Float_Int32(Globals.gamedata.my_pet3.X); y = Util.Float_Int32(Globals.gamedata.my_pet3.Y); z = Util.Float_Int32(Globals.gamedata.my_pet3.Z); return; } //is in the list of chars? Globals.PlayerLock.EnterReadLock(); try { CharInfo player = Util.GetChar(id); if (player != null) { x = Util.Float_Int32(player.X); y = Util.Float_Int32(player.Y); z = Util.Float_Int32(player.Z); return; } } finally { Globals.PlayerLock.ExitReadLock(); } //is it a party member? Globals.PartyLock.EnterReadLock(); try { PartyMember pmem = Util.GetCharParty(id); if (pmem != null) { x = pmem.X; y = pmem.Y; z = pmem.Z; return; } } finally { Globals.PartyLock.ExitReadLock(); } }
static public void GetLoc(uint id, ref int x, ref int y, ref int z) { //is self? if (Globals.gamedata.my_char.ID == id) { x = Util.Float_Int32(Globals.gamedata.my_char.X); y = Util.Float_Int32(Globals.gamedata.my_char.Y); z = Util.Float_Int32(Globals.gamedata.my_char.Z); return; } //is my pet? if (Globals.gamedata.my_pet.ID == id) { x = Util.Float_Int32(Globals.gamedata.my_pet.X); y = Util.Float_Int32(Globals.gamedata.my_pet.Y); z = Util.Float_Int32(Globals.gamedata.my_pet.Z); return; } if (Globals.gamedata.my_pet1.ID == id) { x = Util.Float_Int32(Globals.gamedata.my_pet1.X); y = Util.Float_Int32(Globals.gamedata.my_pet1.Y); z = Util.Float_Int32(Globals.gamedata.my_pet1.Z); return; } if (Globals.gamedata.my_pet2.ID == id) { x = Util.Float_Int32(Globals.gamedata.my_pet2.X); y = Util.Float_Int32(Globals.gamedata.my_pet2.Y); z = Util.Float_Int32(Globals.gamedata.my_pet2.Z); return; } if (Globals.gamedata.my_pet3.ID == id) { x = Util.Float_Int32(Globals.gamedata.my_pet3.X); y = Util.Float_Int32(Globals.gamedata.my_pet3.Y); z = Util.Float_Int32(Globals.gamedata.my_pet3.Z); return; } //is in the list of chars? Globals.PlayerLock.EnterReadLock(); try { CharInfo player = Util.GetChar(id); if (player != null) { x = Util.Float_Int32(player.X); y = Util.Float_Int32(player.Y); z = Util.Float_Int32(player.Z); return; } } finally { Globals.PlayerLock.ExitReadLock(); } //is it a party member? Globals.PartyLock.EnterReadLock(); try { PartyMember pmem = Util.GetCharParty(id); if (pmem != null) { x = pmem.X; y = pmem.Y; z = pmem.Z; return; } } finally { Globals.PartyLock.ExitReadLock(); } Globals.NPCLock.EnterReadLock(); try { NPCInfo npc = Util.GetNPC(id); if (npc != null) { x = Util.Float_Int32(npc.X); y = Util.Float_Int32(npc.Y); z = Util.Float_Int32(npc.Z); return; } } finally { Globals.NPCLock.ExitReadLock(); } }
public static long TARGET_INT(string req) { switch (Globals.gamedata.my_char.CurrentTargetType) { case TargetType.ERROR: case TargetType.NONE: break; case TargetType.SELF: switch (req) { case "KARMA": return((long)Globals.gamedata.my_char.Karma); case "TARGETID": return((long)Globals.gamedata.my_char.TargetID); case "ID": return((long)Globals.gamedata.my_char.ID); case "TYPEID": return((long)0); case "X": return((long)Globals.gamedata.my_char.X); case "Y": return((long)Globals.gamedata.my_char.Y); case "Z": return((long)Globals.gamedata.my_char.Z); case "DESTX": return((long)Globals.gamedata.my_char.Dest_X); case "DESTY": return((long)Globals.gamedata.my_char.Dest_Y); case "DESTZ": return((long)Globals.gamedata.my_char.Dest_Z); case "IS_MOVING": return(Globals.gamedata.my_char.Moving ? 1L : 0L); case "MAX_HP": return((long)Globals.gamedata.my_char.Max_HP); case "MAX_MP": return((long)Globals.gamedata.my_char.Max_MP); case "MAX_CP": return((long)Globals.gamedata.my_char.Max_CP); case "CUR_HP": return((long)Globals.gamedata.my_char.Cur_HP); case "CUR_MP": return((long)Globals.gamedata.my_char.Cur_MP); case "CUR_CP": return((long)Globals.gamedata.my_char.Cur_CP); case "PER_HP": return((long)(100.0 * (Globals.gamedata.my_char.Cur_HP / Globals.gamedata.my_char.Max_HP))); case "PER_MP": return((long)(100.0 * (Globals.gamedata.my_char.Cur_MP / Globals.gamedata.my_char.Max_MP))); case "PER_CP": return((long)(100.0 * (Globals.gamedata.my_char.Cur_CP / Globals.gamedata.my_char.Max_CP))); case "RUN_SPEED": return((long)(Globals.gamedata.my_char.RunSpeed * Globals.gamedata.my_char.MoveSpeedMult)); case "WALK_SPEED": return((long)(Globals.gamedata.my_char.WalkSpeed * Globals.gamedata.my_char.MoveSpeedMult)); case "ATTACK_SPEED": return((long)Globals.gamedata.my_char.AttackSpeedMult); case "CAST_SPEED": return((long)Globals.gamedata.my_char.MatkSpeed); case "EVAL": return((long)Globals.gamedata.my_char.RecAmount); case "RUNNING": return((long)Globals.gamedata.my_char.isRunning); case "SITTING": return((long)Globals.gamedata.my_char.isSitting); case "LOOKS_DEAD": return((long)Globals.gamedata.my_char.isAlikeDead); default: ScriptEngine.Script_Error("invalid target data(self) request"); break; } break; case TargetType.MYPET: switch (req) { case "KARMA": return((long)Globals.gamedata.my_pet.Karma); case "TARGETID": return((long)Globals.gamedata.my_pet.TargetID); case "ID": return((long)Globals.gamedata.my_pet.ID); case "TYPEID": return((long)Globals.gamedata.my_pet.NPCID); case "X": return((long)Globals.gamedata.my_pet.X); case "Y": return((long)Globals.gamedata.my_pet.Y); case "Z": return((long)Globals.gamedata.my_pet.Z); case "DESTX": return((long)Globals.gamedata.my_pet.Dest_X); case "DESTY": return((long)Globals.gamedata.my_pet.Dest_Y); case "DESTZ": return((long)Globals.gamedata.my_pet.Dest_Z); case "IS_MOVING": return(Globals.gamedata.my_pet.Moving ? 1L : 0L); case "MAX_HP": return((long)Globals.gamedata.my_pet.Max_HP); case "MAX_MP": return((long)Globals.gamedata.my_pet.Max_MP); case "MAX_CP": return((long)Globals.gamedata.my_pet.Max_CP); case "CUR_HP": return((long)Globals.gamedata.my_pet.Cur_HP); case "CUR_MP": return((long)Globals.gamedata.my_pet.Cur_MP); case "CUR_CP": return((long)Globals.gamedata.my_pet.Cur_CP); case "PER_HP": return((long)(100.0 * (Globals.gamedata.my_pet.Cur_HP / Globals.gamedata.my_pet.Max_HP))); case "PER_MP": return((long)(100.0 * (Globals.gamedata.my_pet.Cur_MP / Globals.gamedata.my_pet.Max_MP))); case "PER_CP": return((long)(100.0 * (Globals.gamedata.my_pet.Cur_CP / Globals.gamedata.my_pet.Max_CP))); case "RUN_SPEED": return((long)(Globals.gamedata.my_pet.RunSpeed * Globals.gamedata.my_pet.MoveSpeedMult)); case "WALK_SPEED": return((long)(Globals.gamedata.my_pet.WalkSpeed * Globals.gamedata.my_pet.MoveSpeedMult)); case "ATTACK_SPEED": return((long)Globals.gamedata.my_pet.AttackSpeedMult); case "CAST_SPEED": return((long)Globals.gamedata.my_pet.MatkSpeed); case "EVAL": return((long)0); case "RUNNING": return((long)Globals.gamedata.my_pet.isRunning); case "SITTING": return((long)0); case "LOOKS_DEAD": return((long)Globals.gamedata.my_pet.isAlikeDead); default: ScriptEngine.Script_Error("invalid target data(self) request"); break; } break; case TargetType.MYPET1: switch (req) { case "KARMA": return((long)Globals.gamedata.my_pet1.Karma); case "TARGETID": return((long)Globals.gamedata.my_pet1.TargetID); case "ID": return((long)Globals.gamedata.my_pet1.ID); case "TYPEID": return((long)Globals.gamedata.my_pet1.NPCID); case "X": return((long)Globals.gamedata.my_pet1.X); case "Y": return((long)Globals.gamedata.my_pet1.Y); case "Z": return((long)Globals.gamedata.my_pet1.Z); case "DESTX": return((long)Globals.gamedata.my_pet1.Dest_X); case "DESTY": return((long)Globals.gamedata.my_pet1.Dest_Y); case "DESTZ": return((long)Globals.gamedata.my_pet1.Dest_Z); case "IS_MOVING": return(Globals.gamedata.my_pet1.Moving ? 1L : 0L); case "MAX_HP": return((long)Globals.gamedata.my_pet1.Max_HP); case "MAX_MP": return((long)Globals.gamedata.my_pet1.Max_MP); case "MAX_CP": return((long)Globals.gamedata.my_pet1.Max_CP); case "CUR_HP": return((long)Globals.gamedata.my_pet1.Cur_HP); case "CUR_MP": return((long)Globals.gamedata.my_pet1.Cur_MP); case "CUR_CP": return((long)Globals.gamedata.my_pet1.Cur_CP); case "PER_HP": return((long)(100.0 * (Globals.gamedata.my_pet1.Cur_HP / Globals.gamedata.my_pet1.Max_HP))); case "PER_MP": return((long)(100.0 * (Globals.gamedata.my_pet1.Cur_MP / Globals.gamedata.my_pet1.Max_MP))); case "PER_CP": return((long)(100.0 * (Globals.gamedata.my_pet1.Cur_CP / Globals.gamedata.my_pet1.Max_CP))); case "RUN_SPEED": return((long)(Globals.gamedata.my_pet1.RunSpeed * Globals.gamedata.my_pet1.MoveSpeedMult)); case "WALK_SPEED": return((long)(Globals.gamedata.my_pet1.WalkSpeed * Globals.gamedata.my_pet1.MoveSpeedMult)); case "ATTACK_SPEED": return((long)Globals.gamedata.my_pet1.AttackSpeedMult); case "CAST_SPEED": return((long)Globals.gamedata.my_pet1.MatkSpeed); case "EVAL": return((long)0); case "RUNNING": return((long)Globals.gamedata.my_pet1.isRunning); case "SITTING": return((long)0); case "LOOKS_DEAD": return((long)Globals.gamedata.my_pet1.isAlikeDead); default: ScriptEngine.Script_Error("invalid target data(self) request"); break; } break; case TargetType.MYPET2: switch (req) { case "KARMA": return((long)Globals.gamedata.my_pet2.Karma); case "TARGETID": return((long)Globals.gamedata.my_pet2.TargetID); case "ID": return((long)Globals.gamedata.my_pet2.ID); case "TYPEID": return((long)Globals.gamedata.my_pet2.NPCID); case "X": return((long)Globals.gamedata.my_pet2.X); case "Y": return((long)Globals.gamedata.my_pet2.Y); case "Z": return((long)Globals.gamedata.my_pet2.Z); case "DESTX": return((long)Globals.gamedata.my_pet2.Dest_X); case "DESTY": return((long)Globals.gamedata.my_pet2.Dest_Y); case "DESTZ": return((long)Globals.gamedata.my_pet2.Dest_Z); case "IS_MOVING": return(Globals.gamedata.my_pet2.Moving ? 1L : 0L); case "MAX_HP": return((long)Globals.gamedata.my_pet2.Max_HP); case "MAX_MP": return((long)Globals.gamedata.my_pet2.Max_MP); case "MAX_CP": return((long)Globals.gamedata.my_pet2.Max_CP); case "CUR_HP": return((long)Globals.gamedata.my_pet2.Cur_HP); case "CUR_MP": return((long)Globals.gamedata.my_pet2.Cur_MP); case "CUR_CP": return((long)Globals.gamedata.my_pet2.Cur_CP); case "PER_HP": return((long)(100.0 * (Globals.gamedata.my_pet2.Cur_HP / Globals.gamedata.my_pet2.Max_HP))); case "PER_MP": return((long)(100.0 * (Globals.gamedata.my_pet2.Cur_MP / Globals.gamedata.my_pet2.Max_MP))); case "PER_CP": return((long)(100.0 * (Globals.gamedata.my_pet2.Cur_CP / Globals.gamedata.my_pet2.Max_CP))); case "RUN_SPEED": return((long)(Globals.gamedata.my_pet2.RunSpeed * Globals.gamedata.my_pet2.MoveSpeedMult)); case "WALK_SPEED": return((long)(Globals.gamedata.my_pet2.WalkSpeed * Globals.gamedata.my_pet2.MoveSpeedMult)); case "ATTACK_SPEED": return((long)Globals.gamedata.my_pet2.AttackSpeedMult); case "CAST_SPEED": return((long)Globals.gamedata.my_pet2.MatkSpeed); case "EVAL": return((long)0); case "RUNNING": return((long)Globals.gamedata.my_pet2.isRunning); case "SITTING": return((long)0); case "LOOKS_DEAD": return((long)Globals.gamedata.my_pet2.isAlikeDead); default: ScriptEngine.Script_Error("invalid target data(self) request"); break; } break; case TargetType.MYPET3: switch (req) { case "KARMA": return((long)Globals.gamedata.my_pet3.Karma); case "TARGETID": return((long)Globals.gamedata.my_pet3.TargetID); case "ID": return((long)Globals.gamedata.my_pet3.ID); case "TYPEID": return((long)Globals.gamedata.my_pet3.NPCID); case "X": return((long)Globals.gamedata.my_pet3.X); case "Y": return((long)Globals.gamedata.my_pet3.Y); case "Z": return((long)Globals.gamedata.my_pet3.Z); case "DESTX": return((long)Globals.gamedata.my_pet3.Dest_X); case "DESTY": return((long)Globals.gamedata.my_pet3.Dest_Y); case "DESTZ": return((long)Globals.gamedata.my_pet3.Dest_Z); case "IS_MOVING": return(Globals.gamedata.my_pet3.Moving ? 1L : 0L); case "MAX_HP": return((long)Globals.gamedata.my_pet3.Max_HP); case "MAX_MP": return((long)Globals.gamedata.my_pet3.Max_MP); case "MAX_CP": return((long)Globals.gamedata.my_pet3.Max_CP); case "CUR_HP": return((long)Globals.gamedata.my_pet3.Cur_HP); case "CUR_MP": return((long)Globals.gamedata.my_pet3.Cur_MP); case "CUR_CP": return((long)Globals.gamedata.my_pet3.Cur_CP); case "PER_HP": return((long)(100.0 * (Globals.gamedata.my_pet3.Cur_HP / Globals.gamedata.my_pet3.Max_HP))); case "PER_MP": return((long)(100.0 * (Globals.gamedata.my_pet3.Cur_MP / Globals.gamedata.my_pet3.Max_MP))); case "PER_CP": return((long)(100.0 * (Globals.gamedata.my_pet3.Cur_CP / Globals.gamedata.my_pet3.Max_CP))); case "RUN_SPEED": return((long)(Globals.gamedata.my_pet3.RunSpeed * Globals.gamedata.my_pet3.MoveSpeedMult)); case "WALK_SPEED": return((long)(Globals.gamedata.my_pet3.WalkSpeed * Globals.gamedata.my_pet3.MoveSpeedMult)); case "ATTACK_SPEED": return((long)Globals.gamedata.my_pet3.AttackSpeedMult); case "CAST_SPEED": return((long)Globals.gamedata.my_pet3.MatkSpeed); case "EVAL": return((long)0); case "RUNNING": return((long)Globals.gamedata.my_pet3.isRunning); case "SITTING": return((long)0); case "LOOKS_DEAD": return((long)Globals.gamedata.my_pet3.isAlikeDead); default: ScriptEngine.Script_Error("invalid target data(self) request"); break; } break; case TargetType.PLAYER: Globals.PlayerLock.EnterReadLock(); try { CharInfo player = Util.GetChar(Globals.gamedata.my_char.TargetID); if (player != null) { switch (req) { case "KARMA": return((long)player.Karma); case "TARGETID": return((long)player.TargetID); case "ID": return((long)player.ID); case "TYPEID": return((long)0); case "X": return((long)player.X); case "Y": return((long)player.Y); case "Z": return((long)player.Z); case "DESTX": return((long)player.Dest_X); case "DESTY": return((long)player.Dest_Y); case "DESTZ": return((long)player.Dest_Z); case "IS_MOVING": return(player.Moving ? 1L : 0L); case "MAX_HP": return((long)player.Max_HP); case "MAX_MP": return((long)player.Max_MP); case "MAX_CP": return((long)player.Max_CP); case "CUR_HP": return((long)player.Cur_HP); case "CUR_MP": return((long)player.Cur_MP); case "CUR_CP": return((long)player.Cur_CP); case "PER_HP": return((long)(100.0 * (player.Cur_HP / player.Max_HP))); case "PER_MP": return((long)(100.0 * (player.Cur_MP / player.Max_MP))); case "PER_CP": return((long)(100.0 * (player.Cur_CP / player.Max_CP))); case "RUN_SPEED": return((long)(player.RunSpeed * Globals.gamedata.my_char.MoveSpeedMult)); case "WALK_SPEED": return((long)(player.WalkSpeed * Globals.gamedata.my_char.MoveSpeedMult)); case "ATTACK_SPEED": return((long)player.AttackSpeedMult); case "CAST_SPEED": return((long)player.MatkSpeed); case "EVAL": return((long)player.RecAmount); case "RUNNING": return((long)player.isRunning); case "SITTING": return((long)player.isSitting); case "LOOKS_DEAD": return((long)player.isAlikeDead); default: ScriptEngine.Script_Error("invalid target data(player) request"); break; } } } //unlock finally { Globals.PlayerLock.ExitReadLock(); } break; case TargetType.NPC: Globals.NPCLock.EnterReadLock(); try { NPCInfo npc = Util.GetNPC(Globals.gamedata.my_char.TargetID); if (npc != null) { switch (req) { case "KARMA": return((long)npc.Karma); case "TARGETID": return((long)npc.TargetID); case "ID": return((long)npc.ID); case "TYPEID": return((long)npc.NPCID); case "X": return((long)npc.X); case "Y": return((long)npc.Y); case "Z": return((long)npc.Z); case "DESTX": return((long)npc.Dest_X); case "DESTY": return((long)npc.Dest_Y); case "DESTZ": return((long)npc.Dest_Z); case "IS_MOVING": return(npc.Moving ? 1L : 0L); case "MAX_HP": return((long)npc.Max_HP); case "MAX_MP": return((long)npc.Max_MP); case "MAX_CP": return((long)npc.Max_CP); case "CUR_HP": return((long)npc.Cur_HP); case "CUR_MP": return((long)npc.Cur_MP); case "CUR_CP": return((long)npc.Cur_CP); case "PER_HP": return((long)(100.0 * (npc.Cur_HP / npc.Max_HP))); case "PER_MP": return((long)(100.0 * (npc.Cur_MP / npc.Max_MP))); case "PER_CP": return((long)(100.0 * (npc.Cur_CP / npc.Max_CP))); case "RUN_SPEED": return((long)(npc.RunSpeed * Globals.gamedata.my_char.MoveSpeedMult)); case "WALK_SPEED": return((long)(npc.WalkSpeed * Globals.gamedata.my_char.MoveSpeedMult)); case "ATTACK_SPEED": return((long)npc.AttackSpeedMult); case "CAST_SPEED": return((long)npc.MatkSpeed); case "SPOILED": if (Globals.gamedata.my_char.TargetSpoiled) { return((long)(1)); } else { return((long)(0)); } case "RUNNING": return((long)npc.isRunning); case "SITTING": return((long)npc.isSitting); case "LOOKS_DEAD": return((long)npc.isAlikeDead); default: ScriptEngine.Script_Error("invalid target data(npc) request"); break; } } } //unlock finally { Globals.NPCLock.ExitReadLock(); } break; } return((long)0); }
public static void Set_Target_HP() { string cp = "0/0"; string hp = "0/0"; string mp = "0/0"; uint target_id = Globals.gamedata.my_char.TargetID; switch (Globals.gamedata.my_char.CurrentTargetType) { case TargetType.SELF: hp = Globals.gamedata.my_char.Cur_HP.ToString() + "/" + Globals.gamedata.my_char.Max_HP.ToString(); mp = Globals.gamedata.my_char.Cur_MP.ToString() + "/" + Globals.gamedata.my_char.Max_MP.ToString(); cp = Globals.gamedata.my_char.Cur_CP.ToString() + "/" + Globals.gamedata.my_char.Max_CP.ToString(); break; case TargetType.MYPET: hp = Globals.gamedata.my_pet.Cur_HP.ToString() + "/" + Globals.gamedata.my_pet.Max_HP.ToString(); mp = Globals.gamedata.my_pet.Cur_MP.ToString() + "/" + Globals.gamedata.my_pet.Max_MP.ToString(); cp = Globals.gamedata.my_pet.Cur_CP.ToString() + "/" + Globals.gamedata.my_pet.Max_CP.ToString(); break; case TargetType.MYPET1: hp = Globals.gamedata.my_pet1.Cur_HP.ToString() + "/" + Globals.gamedata.my_pet1.Max_HP.ToString(); mp = Globals.gamedata.my_pet1.Cur_MP.ToString() + "/" + Globals.gamedata.my_pet1.Max_MP.ToString(); cp = Globals.gamedata.my_pet1.Cur_CP.ToString() + "/" + Globals.gamedata.my_pet1.Max_CP.ToString(); break; case TargetType.MYPET2: hp = Globals.gamedata.my_pet2.Cur_HP.ToString() + "/" + Globals.gamedata.my_pet2.Max_HP.ToString(); mp = Globals.gamedata.my_pet2.Cur_MP.ToString() + "/" + Globals.gamedata.my_pet2.Max_MP.ToString(); cp = Globals.gamedata.my_pet2.Cur_CP.ToString() + "/" + Globals.gamedata.my_pet2.Max_CP.ToString(); break; case TargetType.MYPET3: hp = Globals.gamedata.my_pet3.Cur_HP.ToString() + "/" + Globals.gamedata.my_pet3.Max_HP.ToString(); mp = Globals.gamedata.my_pet3.Cur_MP.ToString() + "/" + Globals.gamedata.my_pet3.Max_MP.ToString(); cp = Globals.gamedata.my_pet3.Cur_CP.ToString() + "/" + Globals.gamedata.my_pet3.Max_CP.ToString(); break; case TargetType.PLAYER: Globals.PlayerLock.EnterReadLock(); try { CharInfo player = Util.GetChar(target_id); if (player != null) { /*if (Globals.gamedata.Chron >= Chronicle.CT2_4 && Globals.gamedata.Official_Server) { /* hp = ("HP: " + player.Cur_HP / 100000).ToString() + "%"; mp = ("MP: " + player.Cur_MP / 100000).ToString() + "%"; cp = ("CP: " + player.Cur_CP / 100000).ToString() + "%"; hp = ("HP: " + (player.Cur_HP / 10000000).ToString("P", System.Globalization.CultureInfo.InvariantCulture)); mp = ("CP: " + (player.Cur_MP / 10000000).ToString("P", System.Globalization.CultureInfo.InvariantCulture)); cp = ("MP: " + (player.Cur_CP / 10000000).ToString("P", System.Globalization.CultureInfo.InvariantCulture)); } else {*/ hp = player.Cur_HP.ToString() + "/" + player.Max_HP.ToString(); mp = player.Cur_MP.ToString() + "/" + player.Max_MP.ToString(); cp = player.Cur_CP.ToString() + "/" + player.Max_CP.ToString(); //} } }//unlock finally { Globals.PlayerLock.ExitReadLock(); } break; case TargetType.NPC: Globals.NPCLock.EnterReadLock(); try { NPCInfo npc = Util.GetNPC(target_id); if (npc != null) { hp = npc.Cur_HP.ToString() + "/" + npc.Max_HP.ToString(); mp = npc.Cur_MP.ToString() + "/" + npc.Max_MP.ToString(); cp = npc.Cur_CP.ToString() + "/" + npc.Max_CP.ToString(); } }//unlock finally { Globals.NPCLock.ExitReadLock(); } break; } Globals.l2net_home.Set_Target_CP(cp); Globals.l2net_home.Set_Target_HP(hp); Globals.l2net_home.Set_Target_MP(mp); //Globals.l2net_home.panel_target.Refresh(); if (Globals.l2net_home.menuItem_cmd_overlay.Checked && Globals.overlaywindow != null) { Globals.overlaywindow.Set_Target_CP(cp); Globals.overlaywindow.Set_Target_HP(hp); Globals.overlaywindow.Set_Target_MP(mp); //L2NET.overlaywindow.Refresh(); } }
public static void Add_ItemInfo(ItemInfo itm_inf) { Globals.ItemLock.EnterWriteLock(); try { if (Globals.gamedata.nearby_items.ContainsKey(itm_inf.ID)) { //already in the array Globals.gamedata.nearby_items[itm_inf.ID] = itm_inf; } else { if (itm_inf.DroppedBy == Globals.gamedata.my_char.TargetID) { //do nothing //itm_inf.IsMine = true; //Globals.l2net_home.Add_Text("My target with objid: " + itm_inf.DroppedBy + " dropped an item. IsMine = true", Globals.Green, TextType.BOT); } else { //bool is_party_target = false; Globals.PartyLock.EnterReadLock(); try { foreach (PartyMember pl in Globals.gamedata.PartyMembers.Values) { CharInfo ch; Globals.PlayerLock.EnterReadLock(); try { ch = Util.GetChar(pl.ID); } finally { Globals.PlayerLock.ExitReadLock(); } /* if (itm_inf.DroppedBy == ch.TargetID) { is_party_target = true; break; } */ } } finally { Globals.PartyLock.ExitReadLock(); } /*if (!is_party_target) { itm_inf.IsMine = false; } else { itm_inf.IsMine = true; } //Globals.l2net_home.Add_Text("My target with objid: " + itm_inf.DroppedBy + " dropped an item. IsMine = false", Globals.Green, TextType.BOT); */ } Globals.gamedata.nearby_items.Add(itm_inf.ID, itm_inf); } } catch { //oh well } finally { Globals.ItemLock.ExitWriteLock(); } Globals.l2net_home.timer_items.Start(); }