public static List<Monster_ActivePower> get_MonsterActivePowers(ActorCommonData acd) { try { List<Monster_ActivePower> Buffer = new List<Monster_ActivePower>(); var attributes = acd.EnumerateAttributes().ToList(); foreach (var attrib in attributes) { uint attribId = (uint)(attrib.x04_Key & 0xFFF); uint modifier = (uint)(attrib.x04_Key >> 12); int value = attrib.x08_Value.Int32; Buffer.Add(new Monster_ActivePower((int)attribId, (int)modifier, value)); } return Buffer; } catch { return new List<Monster_ActivePower>(); } }
public static List<ActivePower> get_PlayerActivePowers(ActorCommonData acd) { try { acd.TakeSnapshot(); var attributes = acd.EnumerateAttributes().ToList(); List<ActivePower> Buffer = new List<ActivePower>(); for (int i = 0; i < attributes.Count; i++) { uint attribId = (uint)(attributes[i].x04_Key & 0xFFF); uint modifier = (uint)(attributes[i].x04_Key >> 12); int value = attributes[i].x08_Value.Int32; Buffer.Add(new ActivePower((int)attribId, (int)modifier, value)); } acd.FreeSnapshot(); return Buffer; } catch { return new List<ActivePower>(); } }
public static bool isBuff(List<int> SnoPowerIDs, ActorCommonData acd) { try { acd.TakeSnapshot(); if (acd.x000_Id != -1) { var attributes = acd.EnumerateAttributes(); foreach (var attrib in attributes) { uint attribId = (uint)(attrib.x04_Key & 0xFFF); uint modifier = (uint)(attrib.x04_Key >> 12); int value = attrib.x08_Value.Int32; if (SnoPowerIDs.Contains((int)modifier) && value > 0) { acd.FreeSnapshot(); return true; } } } acd.FreeSnapshot(); return false; } catch { return false; } }