public override TalentEntry ConvertTo(byte[] rawData, ref int id) { TalentEntry talentEntry = new TalentEntry(); id = (int)(talentEntry.Id = (TalentId)GetUInt32(rawData, 0)); TalentTreeId uint32_1 = (TalentTreeId)GetUInt32(rawData, 1); talentEntry.Tree = TalentTrees.Get((uint)uint32_1); if (talentEntry.Tree == null) { return(null); } talentEntry.Row = GetUInt32(rawData, 2); talentEntry.Col = GetUInt32(rawData, 3); List <Spell> spellList = new List <Spell>(5); for (int index = 0; index < 9; ++index) { uint uint32_2 = GetUInt32(rawData, index + 4); Spell triggerSpell; if (uint32_2 != 0U && (triggerSpell = SpellHandler.Get(uint32_2)) != null) { if (triggerSpell.IsTeachSpell) { triggerSpell = triggerSpell.GetEffectsWhere( effect => effect.TriggerSpell != null)[0].TriggerSpell; } if (triggerSpell != null) { spellList.Add(triggerSpell); } else { log.Warn("Talent has invalid Spell: {0} ({1})", talentEntry.Id, uint32_2); } } else { break; } } talentEntry.Spells = spellList.ToArray(); talentEntry.RequiredId = (TalentId)GetUInt32(rawData, 13); talentEntry.RequiredRank = GetUInt32(rawData, 16); return(talentEntry); }
/// <summary>Returns the requested TalentTree</summary> public static TalentTree GetTree(TalentTreeId treeId) { return(TalentTrees[(uint)treeId]); }
/// <summary> /// Returns the requested TalentTree /// </summary> public static TalentTree GetTree(TalentTreeId treeId) { return TalentTrees[(uint)treeId]; }