public static void ZoneCheck(ClientInfo _cInfo, EntityPlayer _player) { if (_cInfo != null) { if (Box.Count > 0) { bool Found = false; int _flagCount = 0; int _X = (int)_player.position.x; int _Y = (int)_player.position.y; int _Z = (int)_player.position.z; for (int i = 0; i < Box.Count; i++) { string[] _box = Box[i]; if (A(_box, _X, _Y, _Z)) { if (!ZoneExit.ContainsKey(_player.entityId)) { bool _result; for (int j = 0; j < Box.Count; j++) { string[] _box2 = Box[j]; if (A(_box2, _X, _Y, _Z)) { if (!Found) { ZoneExit.Add(_player.entityId, _box2[3]); if (bool.TryParse(_box2[5], out _result)) { if (_result) { ZonePvE.Add(_player.entityId); } } if (Zones.Zone_Message) { _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _box2[2]), Config.Server_Response_Name, false, "ServerTools", false)); } if (_box2[4] != "") { Zones.Response(_cInfo, _box2[4]); } return; } } } } else { string _exitMsg; if (ZoneExit.TryGetValue(_player.entityId, out _exitMsg)) { if (_exitMsg != _box[3]) { bool _result; for (int j = 0; j < Box.Count; j++) { string[] _box2 = Box[j]; if (A(_box2, _X, _Y, _Z)) { ZoneExit[_player.entityId] = _box2[3]; if (bool.TryParse(_box2[5], out _result)) { if (_result) { if (!ZonePvE.Contains(_player.entityId)) { ZonePvE.Add(_player.entityId); } } else if (ZonePvE.Contains(_player.entityId)) { ZonePvE.Remove(_player.entityId); } } if (Zones.Zone_Message) { _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _box2[2]), Config.Server_Response_Name, false, "ServerTools", false)); } if (_box2[4] != "") { Zones.Response(_cInfo, _box2[4]); } return; } } } else { return; } } } } else if (ZoneExit.ContainsKey(_player.entityId)) { _flagCount++; if (_flagCount == Box.Count) { if (Zones.Zone_Message) { string _msg; if (ZoneExit.TryGetValue(_player.entityId, out _msg)) { _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _msg), Config.Server_Response_Name, false, "ServerTools", false)); } } ZoneExit.Remove(_player.entityId); ZonePvE.Remove(_player.entityId); } } } } } }
public static void ZoneCheck(ClientInfo _cInfo, EntityPlayer _player) { if (Zones.Box1.Count > 0) { int _flagCount = 0; int _X = (int)_player.position.x; int _Y = (int)_player.position.y; int _Z = (int)_player.position.z; for (int i = 0; i < Zones.Box1.Count; i++) { string[] _box = Zones.Box1[i]; bool[] _box2 = Zones.Box2[i]; if (Zones.BoxCheck(_box, _X, _Y, _Z, _box2)) { if (!Zones.ZoneExit.ContainsKey(_player.entityId)) { for (int j = 0; j < Zones.Box1.Count; j++) { string[] _box3 = Zones.Box1[j]; bool[] _box4 = Zones.Box2[j]; if (Zones.BoxCheck(_box3, _X, _Y, _Z, _box4)) { Zones.ZoneExit.Add(_player.entityId, _box3[3]); if (_box4[1]) { ZonePvE.Add(_player.entityId); } if (Zones.Zone_Message) { ChatHook.ChatMessage(_cInfo, LoadConfig.Chat_Response_Color + _box3[2] + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null); } if (_box3[4] != "") { Zones.Response(_cInfo, _box3[4]); } Zones.reminder.Add(_player.entityId, DateTime.Now); Zones.reminderMsg.Add(_player.entityId, _box3[5]); return; } } } else { string _exitMsg; if (Zones.ZoneExit.TryGetValue(_player.entityId, out _exitMsg)) { if (_exitMsg != _box[3]) { for (int j = 0; j < Zones.Box1.Count; j++) { string[] _box3 = Zones.Box1[j]; bool[] _box4 = Zones.Box2[j]; if (Zones.BoxCheck(_box3, _X, _Y, _Z, _box4)) { Zones.ZoneExit[_player.entityId] = _box3[3]; if (_box4[1]) { if (!ZonePvE.Contains(_player.entityId)) { ZonePvE.Add(_player.entityId); } } else { if (ZonePvE.Contains(_player.entityId)) { ZonePvE.Remove(_player.entityId); } } if (Zones.Zone_Message) { ChatHook.ChatMessage(_cInfo, LoadConfig.Chat_Response_Color + _box3[2] + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null); } if (_box3[4] != "") { Zones.Response(_cInfo, _box3[4]); } Zones.reminder[_player.entityId] = DateTime.Now; Zones.reminderMsg[_player.entityId] = _box3[5]; return; } } } else { return; } } } } else { _flagCount++; if (_flagCount == Zones.Box1.Count && Zones.ZoneExit.ContainsKey(_player.entityId)) { if (Zones.Zone_Message) { string _msg; if (Zones.ZoneExit.TryGetValue(_player.entityId, out _msg)) { if (_msg != "") { ChatHook.ChatMessage(_cInfo, LoadConfig.Chat_Response_Color + _msg + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null); } } } Zones.ZoneExit.Remove(_player.entityId); if (ZonePvE.Contains(_player.entityId)) { ZonePvE.Remove(_player.entityId); } Zones.reminder.Remove(_player.entityId); Zones.reminderMsg.Remove(_player.entityId); } } } } }