public float GetValue(D3Attribute attribute) { if (this.finalAttributes.ContainsKey(attribute)) { return this.finalAttributes[attribute]; } return 0.0f; }
public void AddValue(D3Attribute attribute, float value, float maxValue) { if (!this.attributes.ContainsKey(attribute)) { this.attributes.Add(attribute, value); return; } this.attributes[attribute] += value; if (this.attributes[attribute] > maxValue) { this.attributes[attribute] = maxValue; } }
// ------------------------------------------------------------------- // Private // ------------------------------------------------------------------- private void MergeAttribute(D3Attribute attribute, float value) { switch (attribute) { // These replace instead of add case D3Attribute.AttackSpeed: { this.attributes[attribute] = value; break; } default: { this.attributes[attribute] += value; break; } } }
private void MultiplyFinalAttribute(D3Attribute attribute, float value) { if (!this.finalAttributes.ContainsKey(attribute)) { return; } float current = this.finalAttributes[attribute]; this.finalAttributes[attribute] += current * (value / 100); }
private bool AddPrimaryAttributeFinalValue(D3Attribute attribute, float value) { switch (attribute) { case D3Attribute.Str: case D3Attribute.GemStr: { if (this.currentClass.PrimaryAttribute == D3Attribute.Str) { this.AddFinalAttribute(D3Attribute.DmgIncreasePrimary, value); } this.AddFinalAttribute(D3Attribute.Armor, value); return true; } case D3Attribute.Dex: case D3Attribute.GemDex: { if (this.currentClass.PrimaryAttribute == D3Attribute.Dex) { this.AddFinalAttribute(D3Attribute.DmgIncreasePrimary, value); } this.AddFinalAttribute(D3Attribute.DodgeRate, value / 216.0f); return true; } case D3Attribute.Int: case D3Attribute.GemInt: { if (this.currentClass.PrimaryAttribute == D3Attribute.Int) { this.AddFinalAttribute(D3Attribute.DmgIncreasePrimary, value); } this.AddFinalResistAll(value / 10.0f); return true; } } return false; }
private void AddFinalAttribute(D3Attribute attribute, float value) { if (!this.finalAttributes.ContainsKey(attribute)) { this.finalAttributes.Add(attribute, value); return; } this.finalAttributes[attribute] += value; }
public void SetValue(D3Attribute attribute, float value) { if (!this.attributes.ContainsKey(attribute)) { this.attributes.Add(attribute, value); } this.attributes[attribute] = value; this.RecalculateAttributes(); }
public int GetInt(D3Attribute attribute) { int result; try { uint objActor = Framework.GetACDByGuid(this.GUID); result = Framework.GetInt(objActor, (uint)attribute); } catch (Exception ex) { Framework.smethod_0("Error in D3Item.GetFloat: " + ex.Message); result = 0; } return result; }
public int GetInt(D3Attribute attribute) { int result; if (this.ObjectGuid == 0u || this.ObjectGuid == 4294967295u) { result = 0; } else { try { uint objActor = Framework.GetACDByGuid(this.ObjectGuid); result = Framework.GetInt(objActor, (uint)attribute); } catch (Exception) { result = -666; } } return result; }