PRC8/nwn/nwnprc/trunk/newspellbook/tob_jadephoenix.nss
Jaysyn904 6ec137a24e Updated AMS marker feats
Updated AMS marker feats.  Removed arcane & divine marker feats.  Updated Dread Necromancer for epic progression. Updated weapon baseitem models.  Updated new weapons for crafting & npc equip.
 Updated prefix.  Updated release archive.
2024-02-11 14:01:05 -05:00

79 lines
3.4 KiB
Plaintext

#include "tob_inc_tobfunc"
#include "tob_inc_recovery"
void main()
{
int nEvent = GetRunningEvent();
object oInitiator = OBJECT_SELF;
int nClass = GetPrimaryBladeMagicClass(oInitiator);
int nMoveTotal = GetKnownManeuversModifier(oInitiator, nClass, MANEUVER_TYPE_MANEUVER);
int nStncTotal = GetKnownManeuversModifier(oInitiator, nClass, MANEUVER_TYPE_STANCE);
int nRdyTotal = GetReadiedManeuversModifier(oInitiator, nClass);
int nJPMLevel = GetLevelByClass(CLASS_TYPE_JADE_PHOENIX_MAGE, oInitiator);
int nJPMBonusMove = (nJPMLevel + 1) / 2;
int nJPMBonusReadied = nJPMLevel / 3;
int nMod;
// We aren't being called from any event, instead from EvalPRCFeats
if(nEvent == FALSE)
{
// Allows gaining of maneuvers by prestige classes
nMod = nJPMBonusMove - GetPersistantLocalInt(oInitiator, "ToBJadePhoenixMove");
if(nMod)
{
SetKnownManeuversModifier(oInitiator, nClass, nMoveTotal + nMod, MANEUVER_TYPE_MANEUVER);
SetPersistantLocalInt(oInitiator, "ToBJadePhoenixMove", nJPMBonusMove);
SetPersistantLocalInt(oInitiator, "AllowedDisciplines", 3);//DISCIPLINE_DEVOTED_SPIRIT + DISCIPLINE_DESERT_WIND
}
nMod = nJPMBonusReadied - GetPersistantLocalInt(oInitiator, "ToBJadePhoenixReadied");
if(nMod)
{
SetReadiedManeuversModifier(oInitiator, nClass, nRdyTotal + nMod);
SetPersistantLocalInt(oInitiator, "ToBJadePhoenixReadied", nJPMBonusReadied);
}
if(nJPMLevel >= 5 && !GetPersistantLocalInt(oInitiator, "ToBJadePhoenixStance"))
{
SetKnownManeuversModifier(oInitiator, nClass, ++nStncTotal, MANEUVER_TYPE_STANCE);
SetPersistantLocalInt(oInitiator, "ToBJadePhoenixStance", TRUE);
SetPersistantLocalInt(oInitiator, "AllowedDisciplines", 3);//DISCIPLINE_DEVOTED_SPIRIT + DISCIPLINE_DESERT_WIND
}
// Hook to OnLevelDown to remove the maneuver slots granted here
AddEventScript(oInitiator, EVENT_ONPLAYERLEVELDOWN, "tob_jadephoenix", TRUE, FALSE);
}
else if(nEvent == EVENT_ONPLAYERLEVELDOWN)
{
// Has lost Maneuver, but the slot is still present
nMod = GetPersistantLocalInt(oInitiator, "ToBJadePhoenixMove") - nJPMBonusMove;
if(nMod)
{
SetKnownManeuversModifier(oInitiator, nClass, nMoveTotal - nMod, MANEUVER_TYPE_MANEUVER);
SetPersistantLocalInt(oInitiator, "ToBJadePhoenixMove", nJPMBonusMove);
}
nMod = GetPersistantLocalInt(oInitiator, "ToBJadePhoenixReadied") - nJPMBonusReadied;
if(nMod)
{
SetReadiedManeuversModifier(oInitiator, nClass, nRdyTotal - nMod);
SetPersistantLocalInt(oInitiator, "ToBJadePhoenixReadied", nJPMBonusReadied);
}
if(nJPMLevel < 5 && GetPersistantLocalInt(oInitiator, "ToBJadePhoenixStance"))
{
SetKnownManeuversModifier(oInitiator, nClass, --nStncTotal, MANEUVER_TYPE_STANCE);
DeletePersistantLocalInt(oInitiator, "ToBJadePhoenixStance");
}
// Remove eventhook if the character no longer has levels in Jade Phoenix
if(!nJPMLevel)
{
RemoveEventScript(oInitiator, EVENT_ONPLAYERLEVELDOWN, "tob_jadephoenix", TRUE, FALSE);
DeletePersistantLocalInt(oInitiator, "ToBJadePhoenixMove");
DeletePersistantLocalInt(oInitiator, "ToBJadePhoenixReadied");
}
}
}