public static BuffCastEventPrototype Builder(Table table) { BuffCastEventPrototype proto = new BuffCastEventPrototype(); PullData(table, proto); return(null); }
public static SpellAction ParseAndCreateSpell(string fileName) { if (allAbilites == null) { allAbilites = new Dictionary <string, SpellAction>(); } LuaFile file = new LuaFile(); file.Setup("Spells/" + fileName); SpellAction newSpell = new SpellAction(); newSpell.name = file.GetValue("Name").ToString(); newSpell.targetType = (TargetType)Convert.ToInt32(file.GetValue("TargetType")); newSpell.targetFilter = (TargetFilter)Convert.ToInt32(file.GetValue("TargetFilter")); newSpell.targetRange = (TargetRange)Convert.ToInt32(file.GetValue("TargetRange")); newSpell.targetAOE = (TargetAOE)Convert.ToInt32(file.GetValue("TargetAOE")); if (newSpell.targetRange == TargetRange.Range) { newSpell.range = Convert.ToInt32(file.GetValue("Range")); } else { newSpell.range = 1; } Table table = (Table)file.GetValue("Events"); Table insideTable; foreach (DynValue dy in table.Values) { insideTable = dy.Table; switch (insideTable.Get("Type").String) { case "DamageEvent": newSpell.protoEvents.Add(DamageEventPrototype.Builder(insideTable)); break; case "SpawnEvent": newSpell.protoEvents.Add(SpawnEventPrototype.Builder(insideTable)); break; case "BuffCastEvent": newSpell.protoEvents.Add(BuffCastEventPrototype.Builder(insideTable)); break; default: break; } } return(newSpell); }
private static void PullData(Table table, BuffCastEventPrototype proto) { proto.timer = (int)table.Get("timer").Number; proto.stat = (stats)(int)table.Get("stat").Number; proto.amount = (int)table.Get("amount").Number; }
public static BuffCastEventPrototype Builder(Table table) { BuffCastEventPrototype proto = new BuffCastEventPrototype(); PullData(table, proto); return null; }