PRC8/nwn/nwnprc/trunk/scripts/prc_bladesinger.nss
Jaysyn904 e641b42f84 Exalted update
Updated Vow of Poverty. Added Sanctify Ki Strike, Holy Strike, Fist of Heavens, Vow of Abstinence, Vow of Chastity & Gift of Faith.  (@fenac).  Turned off the Taunt & Parry skills.  Re-disabled AC & save bonuses from Tumble & Spellcraft.   Updated min() & max() to PRCmin() & PRCmax() to not conflict with similarly named NUI adjacent functions.  Set Point Blank Shot to 30' per PnP.  Added icon for Chosen of Evil.  Started work on Hidden Talent.  Created Psionics function cheatsheet.  Updated release archive.
2025-01-29 22:46:38 -05:00

145 lines
4.1 KiB
Plaintext

#include "prc_class_const"
#include "prc_feat_const"
#include "prc_spell_const"
#include "inc_item_props"
//#include "prc_misc_const"
#include "inc_utility"
int GetIsBladesongWeapon(object oWeapon)
{
if(!GetIsObjectValid(oWeapon))
return FALSE;
int nType = GetBaseItemType(oWeapon);
return nType == BASE_ITEM_RAPIER
|| nType == BASE_ITEM_LONGSWORD
|| nType == BASE_ITEM_ELVEN_LIGHTBLADE
|| nType == BASE_ITEM_ELVEN_THINBLADE;
}
void RemoveSpellEffectSong(object oPC)
{
effect eff = GetFirstEffect(oPC);
while(GetIsEffectValid(eff))
{
if(GetEffectSpellId(eff) == SPELL_SONG_OF_FURY)
RemoveEffect(oPC, eff);
eff = GetNextEffect(oPC);
}
}
void OnEquip(object oPC,object oSkin)
{
// 1 longsword/rapier & light armour
if(!GetIsBladesongWeapon(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC))
|| GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC))
|| GetBaseAC(GetItemInSlot(INVENTORY_SLOT_CHEST, oPC)) > 3)
{
if(GetHasFeatEffect(FEAT_SONG_OF_FURY, oPC))
RemoveSpellEffectSong(oPC);
SetCompositeBonus(oSkin, "BladesAC", 0, ITEM_PROPERTY_AC_BONUS);
SetCompositeBonus(oSkin, "BladesCon", 0, ITEM_PROPERTY_SKILL_BONUS,SKILL_CONCENTRATION);
return;
}
// Bonus Lvl BladeSinger Max Bonus Int
int BladeLv = PRCMin(GetLevelByClass(CLASS_TYPE_BLADESINGER, oPC), GetAbilityModifier(ABILITY_INTELLIGENCE,oPC));
SetCompositeBonus(oSkin, "BladesAC", BladeLv, ITEM_PROPERTY_AC_BONUS);
if(GetHasFeat(FEAT_LESSER_SPELLSONG,oPC))
SetCompositeBonus(oSkin, "BladesCon", 5, ITEM_PROPERTY_SKILL_BONUS, SKILL_CONCENTRATION);
}
void OnUnEquip(object oPC,object oSkin)
{
object oItem=GetItemLastUnequipped();
object oArmor=GetItemInSlot(INVENTORY_SLOT_CHEST,oPC);
object oWeapL=GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC);
object oWeapR=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
if (GetBaseAC(oArmor)>3)
{
if (GetHasFeatEffect(FEAT_SONG_OF_FURY,oPC))
{
RemoveSpellEffectSong(oPC);
}
SetCompositeBonus(oSkin, "BladesAC", 0, ITEM_PROPERTY_AC_BONUS);
SetCompositeBonus(oSkin, "BladesCon", 0, ITEM_PROPERTY_SKILL_BONUS,SKILL_CONCENTRATION);
return;
}
if (
(GetIsObjectValid(oWeapL) && GetIsObjectValid(oWeapR) ) ||
(!GetIsObjectValid(oWeapL) && !GetIsObjectValid(oWeapR) )
)
{
if (GetHasFeatEffect(FEAT_SONG_OF_FURY,oPC))
{
RemoveSpellEffectSong(oPC);
}
SetCompositeBonus(oSkin, "BladesAC", 0, ITEM_PROPERTY_AC_BONUS);
SetCompositeBonus(oSkin, "BladesCon", 0, ITEM_PROPERTY_SKILL_BONUS,SKILL_CONCENTRATION);
return;
}
if (!(GetBaseItemType(oWeapL)==BASE_ITEM_RAPIER ||
GetBaseItemType(oWeapR)==BASE_ITEM_RAPIER ||
GetBaseItemType(oWeapL)==BASE_ITEM_ELVEN_THINBLADE ||
GetBaseItemType(oWeapR)==BASE_ITEM_ELVEN_THINBLADE ||
GetBaseItemType(oWeapL)==BASE_ITEM_ELVEN_LIGHTBLADE ||
GetBaseItemType(oWeapR)==BASE_ITEM_ELVEN_LIGHTBLADE ||
GetBaseItemType(oWeapL)==BASE_ITEM_LONGSWORD ||
GetBaseItemType(oWeapR)==BASE_ITEM_LONGSWORD) )
{
if (GetHasFeatEffect(FEAT_SONG_OF_FURY,oPC))
{
RemoveSpellEffectSong(oPC);
}
SetCompositeBonus(oSkin, "BladesAC", 0, ITEM_PROPERTY_AC_BONUS);
SetCompositeBonus(oSkin, "BladesCon", 0, ITEM_PROPERTY_SKILL_BONUS,SKILL_CONCENTRATION);
return;
}
int BladeLv=GetLevelByClass(CLASS_TYPE_BLADESINGER,oPC);
int Intb=GetAbilityModifier(ABILITY_INTELLIGENCE,oPC);
if ( BladeLv>Intb)
BladeLv=Intb;
SetCompositeBonus(oSkin, "BladesAC", BladeLv, ITEM_PROPERTY_AC_BONUS);
if ( GetHasFeat(FEAT_LESSER_SPELLSONG,oPC))
SetCompositeBonus(oSkin, "BladesCon", 5, ITEM_PROPERTY_SKILL_BONUS,SKILL_CONCENTRATION);
}
void main()
{
//Declare main variables.
object oPC = OBJECT_SELF;
object oSkin = GetPCSkin(oPC);
OnEquip(oPC,oSkin);
//int iEquip = GetLocalInt(oPC,"ONEQUIP");
// if (iEquip !=1) OnEquip(oPC,oSkin);
// if (iEquip ==1) OnUnEquip(oPC,oSkin);
}