private static float HeatGeneration(List <object> effectIds) { if (effectIds == null) { return(0); } foreach (ulong effId in effectIds) { var eff = DataObjectModel.GetObject(effId); if (!String.Equals(eff.Data.ValueOrDefault <ScriptEnum>("effSlotType", null).ToString(), "conSlotEffectOther")) { continue; } // GenerateHeat function only appears in this type of effect var subEffects = eff.Data.ValueOrDefault <List <object> >("effSubEffects", null); foreach (GomObjectData subEff in subEffects) { var effActions = subEff.ValueOrDefault <List <object> >("effActions", null); foreach (GomObjectData effAction in effActions) { if (effAction.ValueOrDefault <ScriptEnum>("effActionName", null).ToString() == "effAction_GenerateHeat") { // Heat = effAction.effFloatParams[effParam_Amount] return((float)((IDictionary <object, object>)effAction.ValueOrDefault <Dictionary <object, object> >("effFloatParams", null)).First(kvp => ((ScriptEnum)kvp.Key).ToString() == "effParam_Amount").Value); } } } } return(0); }
private static void LoadData() { GomObject table = DataObjectModel.GetObject(itmModifierPackageTablePrototypePath); Dictionary <object, object> tableData = table.Data.Get <Dictionary <object, object> >("itmModifierPackages"); item_modpkgprototype_data = new Dictionary <long, Dictionary <string, object> >(); foreach (var kvp in tableData) { long modId = (long)kvp.Key; Dictionary <string, object> map = (Dictionary <string, object>)((GomLib.GomObjectData)kvp.Value).Dictionary; item_modpkgprototype_data[modId] = map; //List<List<int>> qData = new List<List<int>>(); /*foreach (List<object> stats in qlist) * { * var lvlData = new List<int>(); * foreach (long stat in stats) * { * lvlData.Add((int)stat); * } * qData.Add(lvlData); * }*/ //item_modpkgprototype_data.Add((int)quality, qData); } }
/// <summary>Retrieve the ID for the Map this map note should link to</summary> /// <param name="mpn">The map note that links to a map</param> /// <param name="areaId">Area ID of the linked map</param> /// <param name="sId">SId of the linked map</param> private static void GetLinkedMapId(MapNote mpn, ulong areaId, long sId) { switch (areaId) { case 4611686055156531852: case 4611686048166971304: case 4611686048166971255: case 4611686038902870211: { Console.WriteLine("{0} links to map not in mapAreasProto", mpn.Fqn); return; } } string mapDataPath = String.Format("world.areas.{0}.mapdata", areaId); var mapDataObj = DataObjectModel.GetObject(mapDataPath); if (mapDataObj != null) { List <object> mapPages = (List <object>)mapDataObj.Data.ValueOrDefault <List <object> >("mapDataContainerMapDataList", null); if (mapPages != null) { foreach (GomObjectData mapPage in mapPages) { if (sId == mapPage.ValueOrDefault <long>("mapNameSId", 0)) { var guid = mapPage.ValueOrDefault <long>("mapPageGUID", 0); mpn.LinkedMapId = (int)(guid & 0x7FFFFFFF); return; } } } } }
public static Models.ClassSpec Load(string fqn) { Models.ClassSpec result; if (nameMap.TryGetValue(fqn, out result)) { return(result); } var obj = DataObjectModel.GetObject(fqn); return(Load(obj)); }
public static Models.AbilityPackage Load(string fqn) { Models.AbilityPackage pkg = null; if (nameMap.TryGetValue(fqn, out pkg)) { return(pkg); } var obj = DataObjectModel.GetObject(fqn); return(Load(obj)); }
public static Models.AbilityPackage Load(ulong nodeId) { Models.AbilityPackage pkg = null; if (idMap.TryGetValue(nodeId, out pkg)) { return(pkg); } var obj = DataObjectModel.GetObject(nodeId); return(Load(obj)); }
public static Models.MapNote Load(string fqn) { Models.MapNote result; if (nameMap.TryGetValue(fqn, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(fqn); Models.MapNote mpn = new Models.MapNote(); return(Load(mpn, obj)); }
public static Models.MapNote Load(ulong nodeId) { Models.MapNote result; if (idMap.TryGetValue(nodeId, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(nodeId); Models.MapNote mpn = new Models.MapNote(); return(Load(mpn, obj)); }
public static Placeable Load(ulong nodeId) { Placeable result; if (idMap.TryGetValue(nodeId, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(nodeId); Placeable plc = new Placeable(); return(Load(plc, obj)); }
public static Models.Encounter Load(string fqn) { Encounter result; if (nameMap.TryGetValue(fqn, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(fqn); Encounter enc = new Encounter(); return(Load(enc, obj)); }
public static Models.Conversation Load(string fqn) { Conversation result; if (nameMap.TryGetValue(fqn, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(fqn); Conversation cnv = new Conversation(); return(Load(cnv, obj)); }
public static Models.Codex Load(string fqn) { Codex result; if (nameMap.TryGetValue(fqn, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(fqn); Codex cdx = new Codex(); return(Load(cdx, obj)); }
public static Models.Conversation Load(ulong nodeId) { Conversation result; if (idMap.TryGetValue(nodeId, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(nodeId); Conversation cnv = new Conversation(); return(Load(cnv, obj)); }
public static Models.Ability Load(ulong nodeId) { Ability result; if (idMap.TryGetValue(nodeId, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(nodeId); Models.Ability abl = new Ability(); return(Load(abl, obj)); }
public static Models.Npc Load(string fqn) { Npc result; if (nameMap.TryGetValue(fqn, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(fqn); Npc npc = new Npc(); return(Load(npc, obj)); }
public static Models.Npc Load(ulong nodeId) { Npc result; if (idMap.TryGetValue(nodeId, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(nodeId); Npc npc = new Npc(); return(Load(npc, obj)); }
public static Models.Placeable Load(string fqn) { Placeable result; if (nameMap.TryGetValue(fqn, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(fqn); Placeable plc = new Placeable(); return(Load(plc, obj)); }
public static Models.Ability Load(string fqn) { Ability result; if (nameMap.TryGetValue(fqn, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(fqn); Models.Ability abl = new Ability(); return(Load(abl, obj)); }
public static Encounter Load(ulong nodeId) { Encounter result; if (idMap.TryGetValue(nodeId, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(nodeId); Encounter enc = new Encounter(); return(Load(enc, obj)); }
public static Models.Codex Load(ulong nodeId) { Codex result; if (idMap.TryGetValue(nodeId, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(nodeId); Codex cdx = new Codex(); return(Load(cdx, obj)); }
public static Models.Schematic Load(string fqn) { Schematic result; if (nameMap.TryGetValue(fqn, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(fqn); Schematic sch = new Schematic(); return(Load(sch, obj)); }
public static Models.Schematic Load(ulong nodeId) { Schematic result; if (idMap.TryGetValue(nodeId, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(nodeId); Schematic sch = new Schematic(); return(Load(sch, obj)); }
public static Models.Quest Load(string fqn) { Quest result; if (nameMap.TryGetValue(fqn, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(fqn); Quest qst = new Quest(); return(Load(qst, obj)); }
public static Models.Quest Load(ulong nodeId) { Quest result; if (idMap.TryGetValue(nodeId, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(nodeId); Quest qst = new Quest(); return(Load(qst, obj)); }
private static void LoadData() { GomObject table = DataObjectModel.GetObject(itmRatingsTablePath); Dictionary <object, object> tableData = table.Data.Get <Dictionary <object, object> >("itmRatings"); item_rating_data = new Dictionary <int, Dictionary <Models.ItemQuality, int> >(); foreach (var kvp in tableData) { int lvl = (int)(long)kvp.Key; var ratingData = (Dictionary <object, object>)kvp.Value; var qMap = new Dictionary <Models.ItemQuality, int>(); foreach (var qr in ratingData) { var quality = Models.ItemQualityExtensions.ToItemQuality((ScriptEnum)qr.Key); var rating = (int)(long)qr.Value; qMap.Add(quality, rating); } item_rating_data.Add(lvl, qMap); } //var rows = Utilities.ReadDataTable(itmRatingsTablePath, (row) => //{ // return new // { // Level = row.Element("level").AsInt(), // Cheap = row.Element("itmQualityCheap").AsInt(), // Standard = row.Element("itmQualityStandard").AsInt(), // Premium = row.Element("itmQualityPremium").AsInt(), // Prototype = row.Element("itmQualityPrototype").AsInt(), // Artifact = row.Element("itmQualityArtifact").AsInt(), // Legendary = row.Element("itmQualityLegendary").AsInt(), // Legacy = row.Element("itmQualityLegacy").AsInt() // }; //}); //item_rating_data = new Dictionary<int, Dictionary<Models.ItemQuality, int>>(); //foreach (var row in rows) //{ // var qMap = new Dictionary<ItemQuality, int>(); // qMap.Add(Models.ItemQuality.Cheap, row.Cheap); // qMap.Add(Models.ItemQuality.Standard, row.Standard); // qMap.Add(Models.ItemQuality.Premium, row.Premium); // qMap.Add(Models.ItemQuality.Prototype, row.Prototype); // qMap.Add(Models.ItemQuality.Artifact, row.Artifact); // qMap.Add(Models.ItemQuality.Legendary, row.Legendary); // qMap.Add(Models.ItemQuality.Legacy, row.Legacy); // qMap.Add(Models.ItemQuality.Quest, row.Quest); // item_rating_data.Add(row.Level, qMap); //} }
public static Models.ClassSpec Load(ulong nodeId) { Models.ClassSpec result; if (idMap.TryGetValue(nodeId, out result)) { return(result); } var obj = DataObjectModel.GetObject(nodeId); if (obj == null) { return(null); } return(Load(obj)); }
static Npc CompanionBySimpleNameId(long nameId) { if (companionShortNameMap.Count == 0) { var cmpInfo = DataObjectModel.GetObject("chrCompanionInfo_Prototype"); var chrCompanionSimpleNameToSpec = cmpInfo.Data.Get <Dictionary <object, object> >("chrCompanionSimpleNameToSpec"); foreach (var kvp in chrCompanionSimpleNameToSpec) { var simpleNameId = (long)kvp.Key; Npc npc = NpcLoader.Load((ulong)kvp.Value); companionShortNameMap[simpleNameId] = npc; } } return(companionShortNameMap[nameId]); }
public static Models.Item Load(string fqn) { Item result; if (nameMap.TryGetValue(fqn, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(fqn); if (obj == null) { return(null); } Models.Item itm = new Item(); return(Load(itm, obj)); }
public static Models.Item Load(ulong nodeId) { Item result; if (idMap.TryGetValue(nodeId, out result)) { return(result); } GomObject obj = DataObjectModel.GetObject(nodeId); if (obj == null) { return(null); } Models.Item itm = new Item(); return(Load(itm, obj)); }
private static string LoadParamDuration(GomObjectData tokDesc, List <object> abilityEffectList) { float duration = 1; int tokEffIndex = (int)tokDesc.Get <long>("ablDescriptionTokenEffect"); int tokSubEffIndex = (int)tokDesc.Get <long>("ablDescriptionTokenSubEffect"); if (tokEffIndex >= abilityEffectList.Count) { // Effect is out of range, so just put a 0 here for the duration. duration = 0; } else { var tokEff = DataObjectModel.GetObject((ulong)abilityEffectList[tokEffIndex]); if (tokSubEffIndex < 1) { duration = (float)((ulong)tokEff.Data.ValueOrDefault <ulong>("effDuration", 0)) / 1000; } else { var tokSubEffInitializers = ((GomObjectData)tokEff.Data.Get <List <object> >("effSubEffects")[tokSubEffIndex - 1]).Get <List <object> >("effInitializers"); foreach (GomObjectData effInit in tokSubEffInitializers) { if (effInit.Get <object>("effInitializerName").ToString() == "effInitializer_SetDuration") { var durationMap = effInit.Get <Dictionary <object, object> >("field_40000004E27E11D1"); foreach (var durKvp in durationMap) { if (((ScriptEnum)durKvp.Key).Value == 0xA2) { duration = (float)durKvp.Value / 1000; break; } } break; } } } } return(String.Format("duration,{0}", duration)); }