Files
PRC8/nwn/nwnprc/trunk/scripts/prc_forestmaster.nss
Jaysyn904 4026b6af2c 2026/02/08 Update
Archived Spellman's Project content.
Added missing Diamond Dragon stat feats.
Hospitaler's should be able to take Extra Turning.
Dodge proxies should allow entry into Champion of Corellon.
Mounted Combat is a prereq for Champion of Corellon.
Only Clerics have Domain reqs to enter Morninglord.
Verdant Lord was missing BAB 4 entry requirement.
Diamond Dragons don't get spellcraft.
Re-added Korobokuru race.
Added .ltr tables for Korobokuru.
Capped Blood in the Water at +20.
Capped Pearl of Black Doubt at +20.
Added json_GetFirstKnownSpell() and json_GetNextKnownSpell().
Updated all old NWNx functions to work with NWNxEE.
Added new switch to enable optional PRCX / NWNxEE shims.
Commented out ConvoCC switches on inc_switch_setup.nss
Diamond Dragon's stat increases are intrinsic when using NWNxEE.
Forsaker's stat increases are intrinsic when using NWNxEE.
Vow of Poverty's stat increases are intrinsic when using NWNxEE.
Cloud Dragon summon should be Neutral Good.
Fixed Verdant Lord's regen.
Fixed Forest Master's regen.
Morninglord's Creative Fire should affect Alchemy.
Added yes/no dialog when choosing Vow of Poverty bonus Exalted Feats.
Racial natural AC should be intrinsic when NWNxEE is enabled.
Transcendent Vitality's CON bonus is intrinsic when NWNxEE is enabled.
2026-02-08 00:44:28 -05:00

143 lines
5.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//::///////////////////////////////////////////////
//:: [Forest Master setup script]
//:: [prc_forestmaster.nss]
//:: [Jaysyn 20230106]
//::///////////////////////////////////////////////
#include "prc_inc_combat"
void AddVerdantHealing(object oSkin,int iFH)
{
if(GetLocalInt(oSkin, "ForestMaster_FastHealing") == iFH) return;
SetCompositeBonus(oSkin,"ForestMaster_FastHealing",iFH,ITEM_PROPERTY_REGENERATION);
}
void main()
{
//:: Declare major variables
object oPC = OBJECT_SELF;
object oSkin = GetPCSkin(oPC);
object oItem = GetPCItemLastUnequipped();
int nFMLevel = GetLevelByClass(CLASS_TYPE_FORESTMASTER, oPC);
int nEvent = GetRunningEvent();
effect eEffect;
itemproperty ipIP;
int iFH = GetHasFeat(FEAT_SOL_FAST_HEALING_1,oPC);
if (iFH) AddVerdantHealing(oSkin,iFH);
//:: We aren't being called from onPlayerUnequipItem event, instead from the PRCEvalFeats
if(nEvent == FALSE)
{
// :: Hook in the events
if(DEBUG) DoDebug("Forest Master: Adding eventhooks");
AddEventScript(oPC, EVENT_ONPLAYERUNEQUIPITEM, "prc_forestmaster", TRUE, FALSE);
}
//:: We're being called from the onPlayerUnequipItem eventhook, so check or skip
if(nEvent == EVENT_ONPLAYERUNEQUIPITEM)
{
//:: Remove Great Mallet damage bonuses from maul being unequipped
int bHadMaul = (GetBaseItemType(oItem) == BASE_ITEM_MAUL);
if(bHadMaul)
{
//:: Remove the Cleave or Great Cleave bonus feat from the maul being unequipped
IPRemoveMatchingItemProperties(oItem, ITEM_PROPERTY_BONUS_FEAT, DURATION_TYPE_TEMPORARY, IP_CONST_FEAT_GREAT_CLEAVE);
IPRemoveMatchingItemProperties(oItem, ITEM_PROPERTY_BONUS_FEAT, DURATION_TYPE_TEMPORARY, IP_CONST_FEAT_CLEAVE);
//:: Remove Great Mallet damage bonuses from maul being unequipped
IPRemoveMatchingItemProperties(oItem, ITEM_PROPERTY_DAMAGE_BONUS, DURATION_TYPE_TEMPORARY, IP_CONST_DAMAGETYPE_ELECTRICAL);
IPRemoveMatchingItemProperties(oItem, ITEM_PROPERTY_DAMAGE_BONUS, DURATION_TYPE_TEMPORARY, IP_CONST_DAMAGETYPE_COLD);
IPRemoveMatchingItemProperties(oItem, ITEM_PROPERTY_ENHANCEMENT_BONUS, DURATION_TYPE_TEMPORARY);
}
}
//:: End if - Running OnPlayerUnequipItem event
//:: Setup Oak Strength ////////////////////////////////////////////////////////
/* Oak Strength (Ex): Beginning at 4th level, the forest master gains a +2
bonus to Strength and the ability to make slam attacks. A Small creatures
slam attack deals 1d4 points of damage, one from a Medium-size creature
deals 1d6 points of damage, and a Large forest masters slam attack deals
1d8 points of damage. Slam attacks are natural weapon attacks and do not
provoke an attack of opportunity from the defender. A forest master can
select Improved Critical (slam), Weapon Focus (slam), and (if a fighter of
4th level or higher) Weapon Specialization (slam). Upon gaining this
ability, the forest masters hair takes on a green, leafy appearance. */
//::////////////////////////////////////////////////////////////////////////////
if (nFMLevel >= 4)
{
string sResRef;
int nHair;
int nHairSet = GetLocalInt(oPC, "FM_HAIR_INT");
int nSize = PRCGetCreatureSize(oPC)+1;
//primary weapon
sResRef = "prc_warf_slam_";
sResRef += GetAffixForSize(nSize);
AddNaturalPrimaryWeapon(oPC, sResRef, 2);
if (!nHairSet)
{
switch (Random(6))
{
case 0: {nHair = 30; break;}
case 1: {nHair = 31; break;}
case 2: {nHair = 49 ; break;}
case 3: {nHair = 106; break;}
case 4: {nHair = 107; break;}
case 5: {nHair = 152; break;}
case 6: {nHair = 153; break;}
}
SetColor(oPC, COLOR_CHANNEL_HAIR, nHair);
SetLocalInt(oPC, "FM_HAIR_INT", nHair);
}
}
//:: Setup Oakheart ///////////////////////////////////////////////////////////////
/* Oakheart (Ex): Upon reaching 7th level, a forest masters body becomes a
thing of wood and leaf rather than meat and bone. His type changes to plant.
As such, he is immune to mind-affecting effects, poison, sleep, paralysis,
stunning, and polymorphing. He is not subject to critical hits or sneak
attacks. However, the forest master becomes vulnerable to fire, and suffers
double damage from fire attacks if he fails a Reflex saving throw, or half
damage if he succeeds. */
//::///////////////////////////////////////////////////////////////////////////////
if (nFMLevel >= 7)
{
effect eNoStun = EffectImmunity(IMMUNITY_TYPE_STUN);
eNoStun = SupernaturalEffect(eNoStun);
eNoStun = ExtraordinaryEffect(eNoStun);
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eNoStun, oPC));
//:: These are handled via cls_feat_formast.2da (they don't seem to be)
ipIP =ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_PARALYSIS);
IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE);
ipIP =ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_POISON);
IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE);
ipIP =ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_MINDSPELLS);
IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE);
ipIP =ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_CRITICAL_HITS);
IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE);
ipIP =ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_BACKSTAB);
IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE);
ipIP = ItemPropertyDamageVulnerability(DAMAGE_TYPE_FIRE, IP_CONST_DAMAGEVULNERABILITY_50_PERCENT);
IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE);
}
} //:: End