public string Apply(NWCreature oCaster, NWObject oTarget, int effectiveLevel) { _stat.ApplyStatChanges(oTarget.Object, null); int healAmount = (int)(_customEffect.CalculateEffectHPBonusPercent(oTarget.Object) * oTarget.MaxHP); if (healAmount > 0) { _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectHeal(healAmount), oTarget); } return(null); }
private int EffectiveMaxHitPoints(NWPlayer player, EffectiveItemStats stats) { int hp = 25 + player.ConstitutionModifier * 5; float effectPercentBonus = _customEffect.CalculateEffectHPBonusPercent(player); hp += _perk.GetPCPerkLevel(player, PerkType.Health) * 5; hp += stats.HP; hp = hp + (int)(hp * effectPercentBonus); if (hp > 1275) { hp = 1275; } if (hp < 20) { hp = 20; } return(hp); }
public int EffectiveMaxHitPoints(NWPlayer player, NWItem ignoreItem) { int hp = 25 + player.ConstitutionModifier * 5; int equippedItemHPBonus = 0; var skills = _data.Where <PCSkill>(x => x.PlayerID == player.GlobalID) .Select(x => new { x.SkillID, x.Rank }).ToDictionary(x => x.SkillID, x => x.Rank); float effectPercentBonus = _customEffect.CalculateEffectHPBonusPercent(player); for (int slot = 0; slot < NUM_INVENTORY_SLOTS; slot++) { NWItem item = _.GetItemInSlot(slot, player); if (item.Equals(ignoreItem)) { continue; } var skillType = _item.GetSkillTypeForItem(item); int rank = skills[(int)skillType]; equippedItemHPBonus += CalculateAdjustedValue(item.HPBonus, item.RecommendedLevel, rank, 0); } hp += _perk.GetPCPerkLevel(player, PerkType.Health) * 5; hp += equippedItemHPBonus; hp = hp + (int)(hp * effectPercentBonus); if (hp > 1275) { hp = 1275; } if (hp < 20) { hp = 20; } return(hp); }