static void fixGoblinShaman() { var cleric_fighter = Profiles.ProfileManager.getProfile("ClericMelee"); var goblin_shaman = library.Get <BlueprintUnit>("8421b6137d7765947958973526b5249b"); goblin_shaman.Brain.Actions = cleric_fighter.brain.Actions; var shaman_selections1 = new SelectionEntry[] { Profiles.ProfileManager.createFeatureSelection(Profiles.ProfileManager.FeatSelections.deity_selection, CallOfTheWild.Deities.lamashtu), Profiles.ProfileManager.createFeatureSelection(Profiles.ProfileManager.FeatSelections.domain_selection, Profiles.ProfileManager.Domains.strength), Profiles.ProfileManager.createFeatureSelection(Profiles.ProfileManager.FeatSelections.domain_selection2, Profiles.ProfileManager.Domains.chaos2), }; goblin_shaman.Body.Armor = library.Get <BlueprintItemArmor>("fb2664f7d8534dc40aeb23392dc58c0c"); //mithral chainshirt +3 to make use of high dex goblin_shaman.Strength = 16; goblin_shaman.Constitution = 16; var old_acl = goblin_shaman.GetComponent <AddClassLevels>(); Profiles.ProfileManager.replaceAcl(old_acl, cleric_fighter.getAcl(old_acl.Levels, shaman_selections1)); goblin_shaman.RemoveComponents <AddFacts>(); goblin_shaman.AddFacts = goblin_shaman.AddFacts.AddToArray(cleric_fighter.getFeatures(old_acl.Levels)); goblin_shaman.Body.Neck = library.Get <BlueprintItemEquipmentNeck>("081a2ffe763320a469de20f1e9b1cd71"); //amulet of natural armor +3 goblin_shaman.Body.Shoulders = library.Get <BlueprintItemEquipmentShoulders>("9f3c56d5247154e47b5ca9500f4d86ce"); //cloak of resistance +3 }
static void fixMeleeClerics() { var cleric_melee = Profiles.ProfileManager.getProfile("ClericMelee"); var cyclops = library.GetAllBlueprints().OfType <BlueprintUnit>().OfType <BlueprintUnit>().Where(f => f.name.Contains("CyclopCleric")).ToArray(); var brain = library.Get <BlueprintBrain>("57e33f7b6b629454ba8144b600816379"); brain.Actions = cleric_melee.brain.Actions; var cleric_selections1 = new SelectionEntry[] { Profiles.ProfileManager.createFeatureSelection(Profiles.ProfileManager.FeatSelections.deity_selection, Profiles.ProfileManager.Deities.gorum), Profiles.ProfileManager.createFeatureSelection(Profiles.ProfileManager.FeatSelections.domain_selection, Profiles.ProfileManager.Domains.war), Profiles.ProfileManager.createFeatureSelection(Profiles.ProfileManager.FeatSelections.domain_selection2, Profiles.ProfileManager.Domains.strength2), }; foreach (var u in cyclops) { var old_acl = u.GetComponents <AddClassLevels>().Where(a => a.CharacterClass == library.Get <BlueprintCharacterClass>("67819271767a9dd4fbfd4ae700befea0")).FirstOrDefault(); if (old_acl == null) { continue; } Profiles.ProfileManager.replaceAcl(old_acl, cleric_melee.getAcl(old_acl.Levels, cleric_selections1)); u.AddFacts = u.AddFacts.AddToArray(cleric_melee.getFeatures(old_acl.Levels)); } }
static void addDeityToCompanion(AddClassLevels add_classLevels, BlueprintFeature deity) { var deity_selection = new SelectionEntry(); deity_selection.Selection = ResourcesLibrary.TryGetBlueprint <BlueprintFeatureSelection>("59e7a76987fe3b547b9cce045f4db3e4"); deity_selection.Features = new BlueprintFeature[] { deity }; add_classLevels.Selections = add_classLevels.Selections.AddToArray(deity_selection); }
public void addParametrizedFeatureSelection(BlueprintParametrizedFeature feature, SpellSchool school) { var spell_focus = new SelectionEntry(); spell_focus.IsParametrizedFeature = true; spell_focus.ParametrizedFeature = feature; spell_focus.ParamSpellSchool = school; acl.Selections = acl.Selections.AddToArray(spell_focus); }
static void fixClericCasters() { var cleric_caster = Profiles.ProfileManager.getProfile("ClericCasterPositive"); var cleric_caster_negative = Profiles.ProfileManager.getProfile("ClericCasterNegative"); var features = library.GetAllBlueprints().OfType <BlueprintFeature>().Where <BlueprintScriptableObject>(f => f.name.Contains("BanditPositiveClericFeatureListLevel")).ToArray(); var brain = library.Get <BlueprintBrain>("a19c889be3392b24a9890ffe5a196f0e"); brain.Actions = cleric_caster.brain.Actions; var cleric_selections1 = new SelectionEntry[] { Profiles.ProfileManager.createFeatureSelection(Profiles.ProfileManager.FeatSelections.deity_selection, Profiles.ProfileManager.Deities.gorum), Profiles.ProfileManager.createFeatureSelection(Profiles.ProfileManager.FeatSelections.domain_selection, Profiles.ProfileManager.Domains.glory), Profiles.ProfileManager.createFeatureSelection(Profiles.ProfileManager.FeatSelections.domain_selection2, Profiles.ProfileManager.Domains.chaos2), }; foreach (var f in features) { var old_acl = f.GetComponent <AddClassLevels>(); Profiles.ProfileManager.replaceAcl(old_acl, cleric_caster.getAcl(old_acl.Levels, cleric_selections1)); f.RemoveComponents <AddFacts>(); f.AddComponent(Helpers.CreateAddFacts(cleric_caster.getFeatures(old_acl.Levels))); } //tsanna { var cunning_initiative = library.Get <BlueprintFeature>("6be8b4031d8b9fc4f879b72b5428f1e0"); var tsanna_units = new BlueprintUnit[] { library.Get <BlueprintUnit>("7c3e0ecea7956be46ad5d74e9b3fd4fb"), library.Get <BlueprintUnit>("07e607f30d7de6c49a002339211d074f"), library.Get <BlueprintUnit>("bd4bace18805d9f4e89821e7a4f0b173"), library.Get <BlueprintUnit>("cf68a7bc6251d754d8ccd27f4dc59be8"), library.Get <BlueprintUnit>("61bc44f3224a0c7449dc8e28c7cf3b9b"), library.Get <BlueprintUnit>("546e1f3739476cd43aeb160cb2344320") }; var tsanna_brain = tsanna_units[0].Brain; tsanna_brain.Actions = cleric_caster_negative.brain.Actions; var tsanna_selections1 = new SelectionEntry[] { Profiles.ProfileManager.createFeatureSelection(Profiles.ProfileManager.FeatSelections.deity_selection, CallOfTheWild.Deities.lamashtu), Profiles.ProfileManager.createFeatureSelection(Profiles.ProfileManager.FeatSelections.domain_selection, Profiles.ProfileManager.Domains.evil), Profiles.ProfileManager.createFeatureSelection(Profiles.ProfileManager.FeatSelections.domain_selection2, Profiles.ProfileManager.Domains.chaos2), }; foreach (var u in tsanna_units) { var old_acl = u.GetComponent <AddClassLevels>(); Profiles.ProfileManager.replaceAcl(old_acl, cleric_caster_negative.getAcl(old_acl.Levels, tsanna_selections1)); u.RemoveComponents <AddFacts>(); u.AddFacts = u.AddFacts.AddToArray(cleric_caster_negative.getFeatures(old_acl.Levels)); u.AddFacts = u.AddFacts.AddToArray(cunning_initiative); u.Body.Armor = library.Get <BlueprintItemArmor>("ef5ee1c481c0139438a7097868685a88"); //replace her standard breastpalte with mithral brestplate +3 u.Body.Neck = library.Get <BlueprintItemEquipmentNeck>("081a2ffe763320a469de20f1e9b1cd71"); //amulet of natural armor +3 u.Body.Shoulders = library.Get <BlueprintItemEquipmentShoulders>("9f3c56d5247154e47b5ca9500f4d86ce"); //cloak of resistance +3 } } }
static public SelectionEntry createFeatureSelection(BlueprintFeatureSelection selection, params BlueprintFeature[] features) { var selection_entry = new SelectionEntry(); selection_entry.Selection = selection; selection_entry.Features = features; return(selection_entry); }
public void addParametrizedFeatureSelection(BlueprintParametrizedFeature feature, WeaponCategory weapon_category) { var weapon_focus = new SelectionEntry(); weapon_focus.IsParametrizedFeature = true; weapon_focus.ParametrizedFeature = feature; weapon_focus.ParamWeaponCategory = weapon_category; acl.Selections = acl.Selections.AddToArray(weapon_focus); }
IEnumerator InsertFeatureToDataSet(SelectionEntry entry) { Feature newFeature = entry.feature; if (!newFeature.Properties.ContainsKey("district")) { newFeature.Properties.Add("district", newFeature.Context[0]["text"]); newFeature.Properties.Add("name", newFeature.Text); } //string tilesetId = "cjjxgjqlw015wksmet7qq0ip1-8ngzu"; string myId = "amykhoover"; string datasetId = "cjl5mxavj0vfm2qmxdngdsie0"; string feature = Mapbox.Json.JsonConvert.SerializeObject(newFeature); //"https://api.mapbox.com/datasets/v1/[myID]/[myDatasetID]/features/[myFeatureID]?access_token=[myAccessToken]"; string postURL = string.Format( "https://api.mapbox.com/datasets/v1/{0}/{1}/features/{2}?{3}" , myId , datasetId , entry.feature.Id , writeToken ); //string postURL = "https://api.mapbox.com/datasets/v1/"; //byte[] bytes = System.Text.Encoding.UTF8.GetBytes(feature); // initialize as PUT UnityWebRequest www = UnityWebRequest.Put(postURL, feature); www.SetRequestHeader("Content-Type", "application/json"); // HACK!!! override method and convert to POST www.method = "PUT"; yield return(www.SendWebRequest()); if (www.isNetworkError || www.isHttpError) { Debug.Log("ApplyDatasetToTileset www error: " + www.error); } else { Debug.Log("ApplyDatasetToTileset www = " + www.downloadHandler.text); StartCoroutine(ApplyDatasetToTileset()); } addFeatureCallback(entry.feature.Properties["name"].ToString(), newFeature.Geometry.Coordinates); yield return(null); }
public void Run() { nexCheck = DateTime.Now + TimeSpan.FromMinutes((Utility.RandomDouble() * 5) + 5); //5 - 10 Minutes; List <SelectionEntry> selection = new List <SelectionEntry>(ApproxPlayers); foreach (NetState ns in NetState.Instances) { Account a = ns.Account as Account; PlayerMobile m = ns.Mobile as PlayerMobile; if (a == null || m == null || a.AccessLevel > AccessLevel.Player || a.GetTag("AFKTag-Excempt") != null || a.GetTag("AFKTag-Selected") != null || a.GetTag("AFKTag-FailedTime") != null) { continue; } SelectionEntry n = new SelectionEntry(m, AFKScore(m)); selection.Add(n); //Add all logged in characters. } selection.Sort(); int count = Math.Max((Utility.RandomMinMax(MinChecks, MaxChecks) * selection.Count) / 1000, 5); while (count > 0 && selection.Count > 0) { SelectionEntry e = selection[selection.Count - 1]; //Get highest score if (e.score < 0) { break; } PlayerMobile pm = e.m; selection.RemoveAt(selection.Count - 1); if (pm == null || pm.Deleted || pm.Map == Map.Internal || pm.NetState == null) { continue; } count--; Account a = pm.Account as Account; checks.Add(pm, new CheckEntry(pm)); if (a != null) { a.AddTag("AFKTag-Selected", "true"); } } }
public void addFeatureSelection(BlueprintFeatureSelection feature_selection, BlueprintFeature feature) { var selections = acl.Selections; var existing_selction = selections.FirstOrDefault(s => s.Selection == feature_selection); if (existing_selction == null) { existing_selction = new SelectionEntry(); existing_selction.Selection = feature_selection; existing_selction.Features = new BlueprintFeature[0]; acl.Selections = acl.Selections.AddToArray(existing_selction); } existing_selction.Features = existing_selction.Features.AddToArray(feature); }
IEnumerator QueryPoints(Vector3 point) { Vector2d vecLatLong = map.WorldToGeoPosition(point); string latLong = vecLatLong.y + "," + vecLatLong.x + ".json?"; Debug.Log("lat long " + vecLatLong); //string parameters = "types=poi&limit=5&"; string parameters = "types=poi&limit=5"; string postURL = "https://api.mapbox.com/geocoding/v5/mapbox.places/" + latLong + parameters + "&" + accessToken; WWW www = new WWW(postURL); yield return(www); if (www.error != null) { Debug.Log("QueryAdd www error: " + www.error); } else { var response = MapboxAccess.Instance.Geocoder.Deserialize <ForwardGeocodeResponse>(www.text); foreach (Feature feature in response.Features) { Vector3 spawnPoint = map.GeoToWorldPosition(feature.Center); spawnPoint.y += prefab.GetComponent <BoxCollider>().size.y *prefab.transform.localScale.y * .5f; var selectGO = Instantiate(prefab, spawnPoint, Quaternion.Euler(90.0f, 0, 0)); string name = feature.PlaceName.Split(',')[0]; var label = selectGO.GetComponent <CustomLabelTextSetter>(); label.SetName(name); var entry = new SelectionEntry(selectGO, feature); selectionList.Add(entry); } } }
private void PerformSelections(LevelUpController controller, Dictionary <SelectionEntry, HashSet <int> > selectionsHistory, LevelUpActionPriority?maxPriority = null) { SelectionEntry[] selections = instance.Selections; int i = 0; while (i < selections.Length) { SelectionEntry selectionEntry = selections[i]; if (maxPriority == null) { goto IL_66; } if (selectionEntry.IsParametrizedFeature) { if (SelectFeature.CalculatePriority(selectionEntry.ParametrizedFeature) <= maxPriority.Value) { goto IL_66; } } else if (SelectFeature.CalculatePriority(selectionEntry.Selection) <= maxPriority.Value) { goto IL_66; } IL_253: i++; continue; IL_66: HashSet <int> hashSet; if (!selectionsHistory.TryGetValue(selectionEntry, out hashSet)) { hashSet = new HashSet <int>(); selectionsHistory[selectionEntry] = hashSet; } if (selectionEntry.IsParametrizedFeature) { FeatureSelectionState featureSelectionState = controller.State.FindSelection(selectionEntry.ParametrizedFeature, false); if (featureSelectionState != null) { FeatureUIData item; switch (selectionEntry.ParametrizedFeature.ParameterType) { case FeatureParameterType.Custom: case FeatureParameterType.SpellSpecialization: item = new FeatureUIData(selectionEntry.ParametrizedFeature, selectionEntry.ParamObject, string.Empty, string.Empty, null, selectionEntry.ParamObject.ToString()); break; case FeatureParameterType.WeaponCategory: item = new FeatureUIData(selectionEntry.ParametrizedFeature, selectionEntry.ParamWeaponCategory, string.Empty, string.Empty, null, selectionEntry.ParamWeaponCategory.ToString()); break; case FeatureParameterType.SpellSchool: item = new FeatureUIData(selectionEntry.ParametrizedFeature, selectionEntry.ParamSpellSchool, string.Empty, string.Empty, null, selectionEntry.ParamSpellSchool.ToString()); break; case FeatureParameterType.LearnSpell: goto IL_1BD; case FeatureParameterType.Skill: item = new FeatureUIData(selectionEntry.ParametrizedFeature, selectionEntry.Stat, string.Empty, string.Empty, null, selectionEntry.Stat.ToString()); break; default: goto IL_1BD; } controller.SelectFeature(featureSelectionState, item); goto IL_1CE; IL_1BD: throw new ArgumentOutOfRangeException(); } IL_1CE: goto IL_253; } for (int j = 0; j < selectionEntry.Features.Length; j++) { if (!hashSet.Contains(j)) { BlueprintFeature blueprintFeature = selectionEntry.Features[j]; FeatureSelectionState featureSelectionState2 = controller.State.FindSelection(selectionEntry.Selection, false); if (featureSelectionState2 != null && blueprintFeature != null && controller.SelectFeature(featureSelectionState2, blueprintFeature)) { hashSet.Add(j); } } } goto IL_253; } }