public bool HasMatch(SpawnPoint spawn) { if (spawn == null || spawn.SpawnObjects == null) { return(false); } bool flag1 = true; if (this.cmbSpawnerMap.SelectedIndex == 0 && (WorldMap)this._Editor.cbxMap.SelectedIndex != spawn.Map) { flag1 = false; } if (flag1 && this.txtSpawnerName.Text != null && this.txtSpawnerName.Text.Length > 0) { bool flag2 = false; if (this.chkNameCase.Checked) { if (spawn.SpawnName.IndexOf(this.txtSpawnerName.Text) >= 0) { flag2 = true; } } else if (spawn.SpawnName.ToLower().IndexOf(this.txtSpawnerName.Text.ToLower()) >= 0) { flag2 = true; } if (this.cmbNameHas.SelectedIndex == 0) { if (!flag2) { flag1 = false; } } else if (flag2) { flag1 = false; } } if (flag1 && this.txtSpawnerEntry.Text != null && this.txtSpawnerEntry.Text.Length > 0) { bool flag2 = false; if (spawn.SpawnObjects != null) { foreach (SpawnObject spawnObject in spawn.SpawnObjects) { if (this.chkEntryCase.Checked) { if (spawnObject.TypeName != null && spawnObject.TypeName.IndexOf(this.txtSpawnerEntry.Text) >= 0) { flag2 = true; break; } } else if (spawnObject.TypeName != null && spawnObject.TypeName.ToLower().IndexOf(this.txtSpawnerEntry.Text.ToLower()) >= 0) { flag2 = true; break; } } } if (this.cmbEntryHas.SelectedIndex == 0) { if (!flag2) { flag1 = false; } } else if (flag2) { flag1 = false; } } if (flag1 && this.txtSpawnerEntry2.Text != null && this.txtSpawnerEntry2.Text.Length > 0) { bool flag2 = false; if (spawn.SpawnObjects != null) { foreach (SpawnObject spawnObject in spawn.SpawnObjects) { if (this.chkEntryCase2.Checked) { if (spawnObject.TypeName != null && spawnObject.TypeName.IndexOf(this.txtSpawnerEntry2.Text) >= 0) { flag2 = true; break; } } else if (spawnObject.TypeName != null && spawnObject.TypeName.ToLower().IndexOf(this.txtSpawnerEntry2.Text.ToLower()) >= 0) { flag2 = true; break; } } } if (this.cmbEntryHas2.SelectedIndex == 0) { if (!flag2) { flag1 = false; } } else if (flag2) { flag1 = false; } } if (flag1 && this.txtSpawnerEntryType.Text != null && this.txtSpawnerEntryType.Text.Length > 0) { bool flag2 = false; Type runUoType = SpawnEditor.FindRunUOType(this.txtSpawnerEntryType.Text.ToLower()); if (spawn.SpawnObjects != null && runUoType != null) { foreach (SpawnObject spawnObject in spawn.SpawnObjects) { Type type = (Type)null; if (spawnObject.TypeName != null) { string[] strArray = spawnObject.TypeName.Split('/'); string name = (string)null; if (strArray != null && strArray.Length > 0) { name = strArray[0]; } type = SpawnEditor.FindRunUOType(name); } if (type != null && (type == runUoType || type.IsSubclassOf(runUoType))) { flag2 = true; break; } } } if (this.cmbEntryTypeHas.SelectedIndex == 0) { if (!flag2) { flag1 = false; } } else if (flag2) { flag1 = false; } } if (flag1 && this.txtSpawnerEntryType2.Text != null && this.txtSpawnerEntryType2.Text.Length > 0) { bool flag2 = false; Type runUoType = SpawnEditor.FindRunUOType(this.txtSpawnerEntryType2.Text.ToLower()); if (spawn.SpawnObjects != null && runUoType != null) { foreach (SpawnObject spawnObject in spawn.SpawnObjects) { Type type = (Type)null; if (spawnObject.TypeName != null) { string[] strArray = spawnObject.TypeName.Split('/'); string name = (string)null; if (strArray != null && strArray.Length > 0) { name = strArray[0]; } type = SpawnEditor.FindRunUOType(name); } if (type != null && (type == runUoType || type.IsSubclassOf(runUoType))) { flag2 = true; break; } } } if (this.cmbEntryTypeHas2.SelectedIndex == 0) { if (!flag2) { flag1 = false; } } else if (flag2) { flag1 = false; } } if (flag1 && this.cmbInContainers.SelectedIndex > 0) { if (this.cmbInContainers.SelectedIndex == 1 && !spawn.SpawnInContainer) { flag1 = false; } else if (this.cmbInContainers.SelectedIndex == 2 && spawn.SpawnInContainer) { flag1 = false; } } if (flag1 && this.cmbSequential.SelectedIndex > 0) { if (this.cmbSequential.SelectedIndex == 1 && spawn.SpawnSequentialSpawn < 0) { flag1 = false; } else if (this.cmbSequential.SelectedIndex == 2 && spawn.SpawnSequentialSpawn >= 0) { flag1 = false; } } if (flag1 && this.cmbSmartSpawning.SelectedIndex > 0) { if (this.cmbSmartSpawning.SelectedIndex == 1 && !spawn.SpawnSmartSpawning) { flag1 = false; } else if (this.cmbSmartSpawning.SelectedIndex == 2 && spawn.SpawnSmartSpawning) { flag1 = false; } } if (flag1 && this.cmbProximity.SelectedIndex > 0) { if (this.cmbProximity.SelectedIndex == 1 && spawn.SpawnProximityRange < 0) { flag1 = false; } else if (this.cmbProximity.SelectedIndex == 2 && spawn.SpawnProximityRange >= 0) { flag1 = false; } } if (flag1 && this.cmbRunning.SelectedIndex > 0) { if (this.cmbRunning.SelectedIndex == 1 && !spawn.SpawnIsRunning) { flag1 = false; } else if (this.cmbRunning.SelectedIndex == 2 && spawn.SpawnIsRunning) { flag1 = false; } } if (flag1 && this.chkAvgSpawnTime.Checked) { double num = (spawn.SpawnMinDelay + spawn.SpawnMaxDelay) / 2.0; if (this.cmbAvgSpawnTime.SelectedIndex == 0 && num >= (double)this.numAvgSpawnTime.Value) { flag1 = false; } else if (this.cmbAvgSpawnTime.SelectedIndex == 1 && num <= (double)this.numAvgSpawnTime.Value) { flag1 = false; } } string status_str; if (flag1 && this.txtPropertyTest.Text != null && (this.txtPropertyTest.Text.Trim().Length > 0 && !PropertyTest.CheckPropertyString((object)spawn, this.txtPropertyTest.Text, out status_str))) { flag1 = false; } if (flag1 && this.txtNotes.Text != null && this.txtNotes.Text.Trim().Length > 0) { bool flag2 = false; if (spawn.SpawnNotes != null && spawn.SpawnNotes.Length > 0 && spawn.SpawnNotes.ToLower().IndexOf(this.txtNotes.Text.ToLower()) >= 0) { flag2 = true; } if (this.cmbNotes.SelectedIndex == 0) { if (!flag2) { flag1 = false; } } else if (flag2) { flag1 = false; } } return(flag1); }
public bool HasMatch(SpawnPoint spawn) { string str; char[] chrArray; if (spawn == null || spawn.SpawnObjects == null) { return(false); } bool flag = true; if (this.cmbSpawnerMap.SelectedIndex == 0 && this._Editor.cbxMap.SelectedIndex != (int)spawn.Map) { flag = false; } if (flag && this.txtSpawnerName.Text != null && this.txtSpawnerName.Text.Length > 0) { bool flag1 = false; if (this.chkNameCase.Checked) { if (spawn.SpawnName.IndexOf(this.txtSpawnerName.Text) >= 0) { flag1 = true; } } else if (spawn.SpawnName.ToLower().IndexOf(this.txtSpawnerName.Text.ToLower()) >= 0) { flag1 = true; } if (this.cmbNameHas.SelectedIndex == 0) { if (!flag1) { flag = false; } } else if (flag1) { flag = false; } } if (flag && this.txtSpawnerEntry.Text != null && this.txtSpawnerEntry.Text.Length > 0) { bool flag2 = false; if (spawn.SpawnObjects != null) { foreach (SpawnObject spawnObject in spawn.SpawnObjects) { if (!this.chkEntryCase.Checked) { if (spawnObject.TypeName == null || spawnObject.TypeName.ToLower().IndexOf(this.txtSpawnerEntry.Text.ToLower()) < 0) { continue; } flag2 = true; break; } else { if (spawnObject.TypeName == null || spawnObject.TypeName.IndexOf(this.txtSpawnerEntry.Text) < 0) { continue; } flag2 = true; break; } } } if (this.cmbEntryHas.SelectedIndex == 0) { if (!flag2) { flag = false; } } else if (flag2) { flag = false; } } if (flag && this.txtSpawnerEntry2.Text != null && this.txtSpawnerEntry2.Text.Length > 0) { bool flag3 = false; if (spawn.SpawnObjects != null) { foreach (SpawnObject spawnObject1 in spawn.SpawnObjects) { if (!this.chkEntryCase2.Checked) { if (spawnObject1.TypeName == null || spawnObject1.TypeName.ToLower().IndexOf(this.txtSpawnerEntry2.Text.ToLower()) < 0) { continue; } flag3 = true; break; } else { if (spawnObject1.TypeName == null || spawnObject1.TypeName.IndexOf(this.txtSpawnerEntry2.Text) < 0) { continue; } flag3 = true; break; } } } if (this.cmbEntryHas2.SelectedIndex == 0) { if (!flag3) { flag = false; } } else if (flag3) { flag = false; } } if (flag && this.txtSpawnerEntryType.Text != null && this.txtSpawnerEntryType.Text.Length > 0) { bool flag4 = false; Type type = SpawnEditor.FindRunUOType(this.txtSpawnerEntryType.Text.ToLower()); if (spawn.SpawnObjects != null && type != null) { foreach (SpawnObject spawnObject2 in spawn.SpawnObjects) { Type type1 = null; if (spawnObject2.TypeName != null) { string typeName = spawnObject2.TypeName; chrArray = new char[] { '/' }; string[] strArrays = typeName.Split(chrArray); string str1 = null; if (strArrays != null && (int)strArrays.Length > 0) { str1 = strArrays[0]; } type1 = SpawnEditor.FindRunUOType(str1); } if (type1 == null || type1 != type && !type1.IsSubclassOf(type)) { continue; } flag4 = true; break; } } if (this.cmbEntryTypeHas.SelectedIndex == 0) { if (!flag4) { flag = false; } } else if (flag4) { flag = false; } } if (flag && this.txtSpawnerEntryType2.Text != null && this.txtSpawnerEntryType2.Text.Length > 0) { bool flag5 = false; Type type2 = SpawnEditor.FindRunUOType(this.txtSpawnerEntryType2.Text.ToLower()); if (spawn.SpawnObjects != null && type2 != null) { foreach (SpawnObject spawnObject3 in spawn.SpawnObjects) { Type type3 = null; if (spawnObject3.TypeName != null) { string typeName1 = spawnObject3.TypeName; chrArray = new char[] { '/' }; string[] strArrays1 = typeName1.Split(chrArray); string str2 = null; if (strArrays1 != null && (int)strArrays1.Length > 0) { str2 = strArrays1[0]; } type3 = SpawnEditor.FindRunUOType(str2); } if (type3 == null || type3 != type2 && !type3.IsSubclassOf(type2)) { continue; } flag5 = true; break; } } if (this.cmbEntryTypeHas2.SelectedIndex == 0) { if (!flag5) { flag = false; } } else if (flag5) { flag = false; } } if (flag && this.cmbInContainers.SelectedIndex > 0) { if (this.cmbInContainers.SelectedIndex == 1 && !spawn.SpawnInContainer) { flag = false; } else if (this.cmbInContainers.SelectedIndex == 2 && spawn.SpawnInContainer) { flag = false; } } if (flag && this.cmbSequential.SelectedIndex > 0) { if (this.cmbSequential.SelectedIndex == 1 && spawn.SpawnSequentialSpawn < 0) { flag = false; } else if (this.cmbSequential.SelectedIndex == 2 && spawn.SpawnSequentialSpawn >= 0) { flag = false; } } if (flag && this.cmbSmartSpawning.SelectedIndex > 0) { if (this.cmbSmartSpawning.SelectedIndex == 1 && !spawn.SpawnSmartSpawning) { flag = false; } else if (this.cmbSmartSpawning.SelectedIndex == 2 && spawn.SpawnSmartSpawning) { flag = false; } } if (flag && this.cmbProximity.SelectedIndex > 0) { if (this.cmbProximity.SelectedIndex == 1 && spawn.SpawnProximityRange < 0) { flag = false; } else if (this.cmbProximity.SelectedIndex == 2 && spawn.SpawnProximityRange >= 0) { flag = false; } } if (flag && this.cmbRunning.SelectedIndex > 0) { if (this.cmbRunning.SelectedIndex == 1 && !spawn.SpawnIsRunning) { flag = false; } else if (this.cmbRunning.SelectedIndex == 2 && spawn.SpawnIsRunning) { flag = false; } } if (flag && this.chkAvgSpawnTime.Checked) { double spawnMinDelay = (spawn.SpawnMinDelay + spawn.SpawnMaxDelay) / 2; if (this.cmbAvgSpawnTime.SelectedIndex == 0 && spawnMinDelay >= (double)((double)this.numAvgSpawnTime.Value)) { flag = false; } else if (this.cmbAvgSpawnTime.SelectedIndex == 1 && spawnMinDelay <= (double)((double)this.numAvgSpawnTime.Value)) { flag = false; } } if (flag && this.txtPropertyTest.Text != null && this.txtPropertyTest.Text.Trim().Length > 0 && !PropertyTest.CheckPropertyString(spawn, this.txtPropertyTest.Text, out str)) { flag = false; } if (flag && this.txtNotes.Text != null && this.txtNotes.Text.Trim().Length > 0) { bool flag6 = false; if (spawn.SpawnNotes != null && spawn.SpawnNotes.Length > 0 && spawn.SpawnNotes.ToLower().IndexOf(this.txtNotes.Text.ToLower()) >= 0) { flag6 = true; } if (this.cmbNotes.SelectedIndex == 0) { if (!flag6) { flag = false; } } else if (flag6) { flag = false; } } return(flag); }