private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem equipped = oItem ?? oPC.RightHand; if (Equals(equipped, oItem) || equipped.CustomItemType != CustomItemType.Vibroblade) { _nwnxCreature.RemoveFeat(oPC, FEAT_POWER_ATTACK); _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_POWER_ATTACK); if (_.GetActionMode(oPC, ACTION_MODE_POWER_ATTACK) == TRUE) { _.SetActionMode(oPC, ACTION_MODE_POWER_ATTACK, FALSE); } if (_.GetActionMode(oPC, ACTION_MODE_IMPROVED_POWER_ATTACK) == TRUE) { _.SetActionMode(oPC, ACTION_MODE_IMPROVED_POWER_ATTACK, FALSE); } return; } int perkLevel = _perk.GetPCPerkLevel(oPC, PerkType.BladePowerAttack); _nwnxCreature.AddFeat(oPC, FEAT_POWER_ATTACK); if (perkLevel >= 2) { _nwnxCreature.AddFeat(oPC, FEAT_IMPROVED_POWER_ATTACK); } }
private void ApplyFeatChanges(NWPlayer oPC, NWItem unequippingItem) { NWItem mainHand = oPC.RightHand; NWItem offHand = oPC.LeftHand; CustomItemType mainType = mainHand.CustomItemType; CustomItemType offType = offHand.CustomItemType; bool receivesFeat = true; if (unequippingItem != null && Equals(unequippingItem, mainHand)) { mainHand = (new Object()); } else if (unequippingItem != null && Equals(unequippingItem, offHand)) { offHand = (new Object()); } if ((!mainHand.IsValid && !offHand.IsValid) || (mainType != CustomItemType.MartialArtWeapon || offType != CustomItemType.MartialArtWeapon)) { receivesFeat = false; } if (receivesFeat) { _nwnxCreature.AddFeat(oPC, NWScript.FEAT_CIRCLE_KICK); } else { _nwnxCreature.RemoveFeat(oPC, NWScript.FEAT_CIRCLE_KICK); } }
private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem mainEquipped = oItem ?? oPC.RightHand; NWItem offEquipped = oItem ?? oPC.LeftHand; // oItem was unequipped. if (Equals(mainEquipped, oItem) || Equals(offEquipped, oItem)) { RemoveFeats(oPC); return; } // Main or offhand was invalid (i.e not equipped) if (!mainEquipped.IsValid || !offEquipped.IsValid) { RemoveFeats(oPC); return; } // Main or offhand is not acceptable item type. if (mainEquipped.CustomItemType != CustomItemType.Blade || mainEquipped.CustomItemType != CustomItemType.Blunt || mainEquipped.CustomItemType != CustomItemType.FinesseBlade || offEquipped.CustomItemType != CustomItemType.Blade || offEquipped.CustomItemType != CustomItemType.Blunt || offEquipped.CustomItemType != CustomItemType.FinesseBlade) { RemoveFeats(oPC); return; } int perkLevel = _perk.GetPCPerkLevel(oPC, PerkType.DualWielding); _nwnxCreature.AddFeat(oPC, FEAT_TWO_WEAPON_FIGHTING); if (perkLevel >= 2) { _nwnxCreature.AddFeat(oPC, FEAT_AMBIDEXTERITY); } if (perkLevel >= 3) { _nwnxCreature.AddFeat(oPC, FEAT_IMPROVED_TWO_WEAPON_FIGHTING); } }
private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem equipped = oItem ?? oPC.RightHand; int perkLevel = _perk.GetPCPerkLevel(oPC, PerkType.BluntPowerAttack); if (Equals(equipped, oItem) || equipped.CustomItemType != CustomItemType.Baton) { _nwnxCreature.RemoveFeat(oPC, NWScript.FEAT_POWER_ATTACK); _nwnxCreature.RemoveFeat(oPC, NWScript.FEAT_IMPROVED_POWER_ATTACK); return; } _nwnxCreature.AddFeat(oPC, NWScript.FEAT_POWER_ATTACK); if (perkLevel >= 2) { _nwnxCreature.AddFeat(oPC, NWScript.FEAT_IMPROVED_POWER_ATTACK); } }
private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem equipped = oItem ?? oPC.RightHand; if (Equals(equipped, oItem) || (equipped.CustomItemType != CustomItemType.Lightsaber && equipped.CustomItemType != CustomItemType.Saberstaff && equipped.GetLocalInt("LIGHTSABER") == FALSE)) { _nwnxCreature.RemoveFeat(oPC, NWScript.FEAT_WEAPON_FINESSE); return; } _nwnxCreature.AddFeat(oPC, NWScript.FEAT_WEAPON_FINESSE); }
private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem equipped = oItem ?? oPC.RightHand; if (Equals(equipped, oItem) || equipped.CustomItemType != CustomItemType.FinesseVibroblade) { _nwnxCreature.RemoveFeat(oPC, NWScript.FEAT_OPPORTUNIST); return; } _nwnxCreature.AddFeat(oPC, NWScript.FEAT_OPPORTUNIST); }
private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem equipped = oItem ?? oPC.Chest; if (equipped.Equals(oItem) || equipped.CustomItemType != CustomItemType.HeavyArmor) { _nwnxCreature.RemoveFeat(oPC, (int)CustomFeatType.Provoke); return; } _nwnxCreature.AddFeat(oPC, (int)CustomFeatType.Provoke); }
private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem equipped = oItem ?? oPC.Chest; if (equipped.Equals(oItem) || equipped.CustomItemType != CustomItemType.LightArmor) { _nwnxCreature.RemoveFeat(oPC, NWScript.FEAT_DODGE); return; } _nwnxCreature.AddFeat(oPC, NWScript.FEAT_DODGE); }
private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem equipped = oItem ?? oPC.RightHand; if (Equals(equipped, oItem) || equipped.CustomItemType != CustomItemType.FinesseBlade) { _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FINESSE); return; } _nwnxCreature.AddFeat(oPC, FEAT_WEAPON_FINESSE); }
private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem equipped = oItem ?? oPC.RightHand; if (Equals(equipped, oItem) || equipped.CustomItemType != CustomItemType.Throwing) { _nwnxCreature.RemoveFeat(oPC, FEAT_ZEN_ARCHERY); return; } _nwnxCreature.AddFeat(oPC, FEAT_ZEN_ARCHERY); }
private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem equipped = oItem ?? oPC.RightHand; if (equipped.Equals(oItem) || (equipped.CustomItemType != CustomItemType.Bow && equipped.CustomItemType != CustomItemType.Crossbow)) { _nwnxCreature.RemoveFeat(oPC, FEAT_ZEN_ARCHERY); return; } _nwnxCreature.AddFeat(oPC, FEAT_ZEN_ARCHERY); }
private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem equipped = oItem ?? oPC.RightHand; if (Equals(equipped, oItem) || equipped.CustomItemType != CustomItemType.TwinBlade) { RemoveFeats(oPC); return; } int perkLevel = _perk.GetPCPerkLevel(oPC, PerkType.TwinBladeMastery); _nwnxCreature.AddFeat(oPC, FEAT_TWO_WEAPON_FIGHTING); if (perkLevel >= 2) { _nwnxCreature.AddFeat(oPC, FEAT_AMBIDEXTERITY); } if (perkLevel >= 3) { _nwnxCreature.AddFeat(oPC, FEAT_IMPROVED_TWO_WEAPON_FIGHTING); } }
private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem equipped = oItem ?? oPC.RightHand; if (equipped.Equals(oItem) || (equipped.CustomItemType != CustomItemType.BlasterPistol && equipped.CustomItemType != CustomItemType.BlasterRifle)) { _nwnxCreature.RemoveFeat(oPC, NWScript.FEAT_ZEN_ARCHERY); return; } _nwnxCreature.AddFeat(oPC, NWScript.FEAT_ZEN_ARCHERY); }
private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem equippedArmor = oItem ?? oPC.Chest; NWItem equippedWeapon = oItem ?? oPC.RightHand; if (Equals(equippedArmor, oItem) || Equals(equippedWeapon, oItem) || equippedArmor.CustomItemType != CustomItemType.LightArmor || equippedWeapon.CustomItemType != CustomItemType.Throwing) { _nwnxCreature.RemoveFeat(oPC, FEAT_RAPID_SHOT); return; } _nwnxCreature.AddFeat(oPC, FEAT_RAPID_SHOT); }
private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem equippedArmor = oItem ?? oPC.Chest; NWItem equippedWeapon = oItem ?? oPC.RightHand; if (equippedArmor.Equals(oItem) || equippedWeapon.Equals(oItem) || equippedArmor.CustomItemType != CustomItemType.LightArmor || equippedWeapon.CustomItemType != CustomItemType.BlasterPistol) { _nwnxCreature.RemoveFeat(oPC, NWScript.FEAT_RAPID_RELOAD); return; } _nwnxCreature.AddFeat(oPC, NWScript.FEAT_RAPID_RELOAD); }
private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem armor = oItem ?? oPC.Chest; if (armor.BaseItemType != BASE_ITEM_ARMOR) { return; } if (Equals(armor, oItem) || armor.CustomItemType != CustomItemType.LightArmor) { _nwnxCreature.RemoveFeat(oPC, FEAT_POINT_BLANK_SHOT); return; } _nwnxCreature.AddFeat(oPC, FEAT_POINT_BLANK_SHOT); }
private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem armor = oItem ?? oPC.Chest; if (armor.BaseItemType != NWScript.BASE_ITEM_ARMOR) { return; } if (Equals(armor, oItem) || armor.CustomItemType != CustomItemType.LightArmor) { _nwnxCreature.RemoveFeat(oPC, NWScript.FEAT_RAPID_RELOAD); return; } _nwnxCreature.AddFeat(oPC, NWScript.FEAT_RAPID_RELOAD); }
private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem equipped = oItem ?? oPC.RightHand; RemoveAllFeats(oPC); // Unarmed check NWItem mainHand = oPC.RightHand; NWItem offHand = oPC.LeftHand; if (oItem != null && Equals(oItem, mainHand)) { mainHand = NWItem.Wrap(new Object()); } else if (oItem != null && Equals(oItem, offHand)) { offHand = NWItem.Wrap(new Object()); } if (!mainHand.IsValid && !offHand.IsValid) { if (_perk.GetPCPerkLevel(oPC, PerkType.ImprovedCriticalMartialArts) > 0) { _nwnxCreature.AddFeat(oPC, FEAT_IMPROVED_CRITICAL_UNARMED_STRIKE); } return; } if (oItem != null && Equals(oItem, equipped)) { return; } // All other weapon types PerkType perkType; switch (equipped.CustomItemType) { case CustomItemType.Blade: perkType = PerkType.ImprovedCriticalBlades; break; case CustomItemType.FinesseBlade: perkType = PerkType.ImprovedCriticalFinesseBlades; break; case CustomItemType.Blunt: perkType = PerkType.ImprovedCriticalBlunts; break; case CustomItemType.HeavyBlade: perkType = PerkType.ImprovedCriticalHeavyBlades; break; case CustomItemType.HeavyBlunt: perkType = PerkType.ImprovedCriticalHeavyBlunts; break; case CustomItemType.Polearm: perkType = PerkType.ImprovedCriticalPolearms; break; case CustomItemType.TwinBlade: perkType = PerkType.ImprovedCriticalTwinBlades; break; case CustomItemType.MartialArtWeapon: perkType = PerkType.ImprovedCriticalMartialArts; break; case CustomItemType.Blaster: perkType = PerkType.ImprovedCriticalBows; break; case CustomItemType.Rifle: perkType = PerkType.ImprovedCriticalCrossbows; break; case CustomItemType.Throwing: perkType = PerkType.ImprovedCriticalThrowing; break; default: return; } int perkLevel = _perk.GetPCPerkLevel(oPC, perkType); int type = equipped.BaseItemType; if (perkLevel > 0) { AddCriticalFeat(oPC, type); } }
private void ApplyFeatChanges(NWPlayer oPC, NWItem oItem) { NWItem equipped = oItem ?? oPC.RightHand; RemoveAllFeats(oPC); // Unarmed check NWItem mainHand = oPC.RightHand; NWItem offHand = oPC.LeftHand; if (oItem != null && Equals(oItem, mainHand)) { mainHand = NWItem.Wrap(new Object()); } else if (oItem != null && Equals(oItem, offHand)) { offHand = NWItem.Wrap(new Object()); } if (!mainHand.IsValid && !offHand.IsValid) { int martialArtsLevel = _perk.GetPCPerkLevel(oPC, PerkType.WeaponFocusMartialArts); if (martialArtsLevel >= 1) { _nwnxCreature.AddFeat(oPC, FEAT_WEAPON_FOCUS_UNARMED_STRIKE); } if (martialArtsLevel >= 2) { _nwnxCreature.AddFeat(oPC, FEAT_WEAPON_SPECIALIZATION_UNARMED_STRIKE); } return; } if (oItem != null && Equals(oItem, equipped)) { return; } // All other weapon types PerkType perkType; switch (equipped.CustomItemType) { case CustomItemType.Blade: perkType = PerkType.WeaponFocusBlades; break; case CustomItemType.FinesseBlade: perkType = PerkType.WeaponFocusFinesseBlades; break; case CustomItemType.Blunt: perkType = PerkType.WeaponFocusBlunts; break; case CustomItemType.HeavyBlade: perkType = PerkType.WeaponFocusHeavyBlades; break; case CustomItemType.HeavyBlunt: perkType = PerkType.WeaponFocusHeavyBlunts; break; case CustomItemType.Polearm: perkType = PerkType.WeaponFocusPolearms; break; case CustomItemType.TwinBlade: perkType = PerkType.WeaponFocusTwinBlades; break; case CustomItemType.MartialArtWeapon: perkType = PerkType.WeaponFocusMartialArts; break; case CustomItemType.Blaster: perkType = PerkType.WeaponFocusBows; break; case CustomItemType.Rifle: perkType = PerkType.WeaponFocusCrossbows; break; case CustomItemType.Throwing: perkType = PerkType.WeaponFocusThrowing; break; default: return; } int perkLevel = _perk.GetPCPerkLevel(oPC, perkType); int type = equipped.BaseItemType; if (perkLevel >= 1) { AddFocusFeat(oPC, type); } if (perkLevel >= 2) { AddSpecializationFeat(oPC, type); } }