diff --git a/nwn/nwnprc/trunk/include/x2_inc_spellhook.nss b/nwn/nwnprc/trunk/include/x2_inc_spellhook.nss index 27857899..c631c0e5 100644 --- a/nwn/nwnprc/trunk/include/x2_inc_spellhook.nss +++ b/nwn/nwnprc/trunk/include/x2_inc_spellhook.nss @@ -1441,8 +1441,9 @@ int CheckSecondaryPrC(object oPC = OBJECT_SELF) if (GetHasFeat(FEAT_WILDMAGE_SPELLCASTING_BARD)) return TRUE; if (GetHasFeat(FEAT_WWOC_SPELLCASTING_BARD)) return TRUE; } - else if (bBeguiler) + if (bBeguiler) { + if(DEBUG) DoDebug("x2_inc_spellhook: CheckSecondaryPrC >>> Entering Beguiler", oPC); if (GetHasFeat(FEAT_ABCHAMP_SPELLCASTING_BEGUILER)) return TRUE; if (GetHasFeat(FEAT_AOTS_SPELLCASTING_BEGUILER)) return TRUE; if (GetHasFeat(FEAT_ALCHEM_SPELLCASTING_BEGUILER)) return TRUE; @@ -1492,8 +1493,9 @@ int CheckSecondaryPrC(object oPC = OBJECT_SELF) } - else if (bDuskblade) + if (bDuskblade) { + if(DEBUG) DoDebug("x2_inc_spellhook: CheckSecondaryPrC >>> Entering Dusblade", oPC); if (GetHasFeat(FEAT_ABCHAMP_SPELLCASTING_DUSKBLADE)) return TRUE; if (GetHasFeat(FEAT_AOTS_SPELLCASTING_DUSKBLADE)) return TRUE; if (GetHasFeat(FEAT_ALCHEM_SPELLCASTING_DUSKBLADE)) return TRUE; @@ -1540,8 +1542,9 @@ int CheckSecondaryPrC(object oPC = OBJECT_SELF) } - else if (bSorcerer) + if (bSorcerer) { + if(DEBUG) DoDebug("x2_inc_spellhook: CheckSecondaryPrC >>> Entering Sorcerer", oPC); if (GetHasFeat(FEAT_ABERRATION_SPELLCASTING_DRIDER)) return TRUE; if (GetHasFeat(FEAT_MONSTROUS_SPELLCASTING_ARKAMOI)) return TRUE; if (GetHasFeat(FEAT_MONSTROUS_SPELLCASTING_MARRUTACT)) return TRUE; @@ -1599,8 +1602,9 @@ int CheckSecondaryPrC(object oPC = OBJECT_SELF) if (GetHasFeat(FEAT_WILDMAGE_SPELLCASTING_SORCERER)) return TRUE; if (GetHasFeat(FEAT_WWOC_SPELLCASTING_SORCERER)) return TRUE; } - else if (bWarmage) + if (bWarmage) { + if(DEBUG) DoDebug("x2_inc_spellhook: CheckSecondaryPrC >>> Entering Warmage", oPC); if (GetHasFeat(FEAT_AOTS_SPELLCASTING_WARMAGE)) return TRUE; if (GetHasFeat(FEAT_ALCHEM_SPELLCASTING_WARMAGE)) return TRUE; if (GetHasFeat(FEAT_ANIMA_SPELLCASTING_WARMAGE)) return TRUE; @@ -1662,14 +1666,71 @@ int BardSorcPrCCheck(object oCaster, int nCastingClass, object oSpellCastItem) return TRUE; } - //check its a sorc spell + //check its a sorcerer spell if(nCastingClass == CLASS_TYPE_SORCERER) { - if (CheckSecondaryPrC(oCaster) == TRUE) + if(DEBUG) DoDebug("x2_inc_spellhook: BardSorcPrCCheck >>> nCastingClass is Sorcerer.", oCaster); + //no need to check further if new spellbooks are disabled + if(GetPRCSwitch(PRC_SORC_DISALLOW_NEWSPELLBOOK)) { - if (DEBUG) DoDebug("x2_inc_spellhook: BardSorcPrCCheck >>> Sorcerer w/RHD found.", oCaster); + if (DEBUG) DoDebug("x2_inc_spellhook: BardSorcPrCCheck >>> PRC_SORC_DISALLOW_NEWSPELLBOOK.", oCaster); return TRUE; } + //check they have sorcerer levels + if(!GetLevelByClass(CLASS_TYPE_SORCERER, oCaster)) + { + if(DEBUG) DoDebug("x2_inc_spellhook: BardSorcPrCCheck >>> Not a sorcerer.", oCaster); + return TRUE; + } + //check if they are casting via new spellbook + if(GetLocalInt(oCaster, "NSB_Class") != CLASS_TYPE_SORCERER && GetLevelByClass(CLASS_TYPE_ULTIMATE_MAGUS, oCaster)) + { + if(DEBUG) DoDebug("x2_inc_spellhook: BardSorcPrCCheck >>> UltMagus using new spellbook.", oCaster); + return FALSE; + } + //check if they are casting via new spellbook + if(GetLocalInt(oCaster, "NSB_Class") == CLASS_TYPE_SORCERER) + { + if(DEBUG) DoDebug("x2_inc_spellhook: BardSorcPrCCheck >>> Using new spellbook.", oCaster); + return TRUE; + } + if(GetLevelByClass(CLASS_TYPE_SUBLIME_CHORD, oCaster) > 0 && CheckSecondaryPrC(oCaster) == TRUE) + { + if (DEBUG) DoDebug("x2_inc_spellhook: BardSorcPrCCheck >>> Sublime Chord w/RHD found.", oCaster); + FloatingTextStringOnCreature("You must use the new spellbook on the class radial.", oCaster, FALSE); + return FALSE; + } + if (CheckSecondaryPrC(oCaster) == TRUE) + { + if (DEBUG) DoDebug("x2_inc_spellhook: BardSorcPrCCheck >>> Sorcerer w/RHD found.", oCaster); + FloatingTextStringOnCreature("You must use the new spellbook on the class radial.", oCaster, FALSE); + return FALSE; + } + //check they have arcane PrC or Draconic Arcane Grace/Breath + if(!(GetArcanePRCLevels(oCaster, nCastingClass) - GetLevelByClass(CLASS_TYPE_SUBLIME_CHORD, oCaster)) + && !(GetHasFeat(FEAT_DRACONIC_GRACE, oCaster) || GetHasFeat(FEAT_DRACONIC_BREATH, oCaster))) + { + if(DEBUG) DoDebug("x2_inc_spellhook: BardSorcPrCCheck >>> First Sublime Chord check.", oCaster); + return TRUE; + } + + //check they have sorcerer in first arcane slot + //if(GetPrimaryArcaneClass() != CLASS_TYPE_SORCERER) + if(GetPrCAdjustedCasterLevelByType(TYPE_ARCANE, oCaster, TRUE) != GetPrCAdjustedCasterLevelByType(CLASS_TYPE_SORCERER, oCaster, TRUE)) + { + if(DEBUG) DoDebug("x2_inc_spellhook: BardSorcPrCCheck >>> GetPrCAdjustedCasterLevelByType.", oCaster); + return TRUE; + } + //at this point, they must be using the bioware spellbook + //from a class that adds to bard + FloatingTextStringOnCreature("You must use the new spellbook on the class radial.", oCaster, FALSE); + return FALSE; + } + + +/* //check its a sorc spell + if(nCastingClass == CLASS_TYPE_SORCERER) + { //no need to check further if new spellbooks are disabled if(GetPRCSwitch(PRC_SORC_DISALLOW_NEWSPELLBOOK)) return TRUE; @@ -1708,7 +1769,7 @@ int BardSorcPrCCheck(object oCaster, int nCastingClass, object oSpellCastItem) //from a class that adds to sorc FloatingTextStringOnCreature("You must use the new spellbook on the class radial.", oCaster, FALSE); return FALSE; - } + } */ //check its a bard spell if(nCastingClass == CLASS_TYPE_BARD) diff --git a/nwn/nwnprc/trunk/newspellbook/tob_eternalblade.nss b/nwn/nwnprc/trunk/newspellbook/tob_eternalblade.nss index 6f3ba980..4f15f8bd 100644 --- a/nwn/nwnprc/trunk/newspellbook/tob_eternalblade.nss +++ b/nwn/nwnprc/trunk/newspellbook/tob_eternalblade.nss @@ -79,6 +79,7 @@ void RemoveUncannyDodge(object oInitiator) DeleteLocalInt(oInitiator, "ETBL_AUD_Applied"); } } + void BladeGuide(object oInitiator, object oItem) { if (GetBaseItemType(oItem) == BASE_ITEM_ARMOR) @@ -176,11 +177,12 @@ void main() oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oInitiator); } - int nClass = CLASS_TYPE_ETERNAL_BLADE; - int nLevel = GetLevelByClass(CLASS_TYPE_ETERNAL_BLADE, oInitiator); - int nMoveTotal = GetKnownManeuversModifier(oInitiator, nClass, MANEUVER_TYPE_MANEUVER); - int nStncTotal = GetKnownManeuversModifier(oInitiator, nClass, MANEUVER_TYPE_STANCE); - int nRdyTotal = GetReadiedManeuversModifier(oInitiator, nClass); + int nClass = CLASS_TYPE_ETERNAL_BLADE; + int nLevel = GetLevelByClass(CLASS_TYPE_ETERNAL_BLADE, oInitiator); + int nBladeClass = GetPrimaryBladeMagicClass(oInitiator); + int nMoveTotal = GetKnownManeuversModifier(oInitiator, nBladeClass, MANEUVER_TYPE_MANEUVER); + int nStncTotal = GetKnownManeuversModifier(oInitiator, nBladeClass, MANEUVER_TYPE_STANCE); + int nRdyTotal = GetReadiedManeuversModifier(oInitiator, nBladeClass); if(DEBUG) DoDebug("tob_eternalblade running, event: " + IntToString(nEvent)); if(DEBUG) DoDebug("tob_eternalblade nMoveTotal: " + IntToString(nMoveTotal)); @@ -203,57 +205,109 @@ void main() // It's not pretty, but it works if (nLevel >= 1 && !GetPersistantLocalInt(oInitiator, "ToBEternalBlade1")) { - if(DEBUG) DoDebug("tob_eternalblade: Adding Maneuver 1"); - if(DEBUG) DoDebug("tob_eternalblade SetKnownManeuversModifier 1: " + IntToString(++nMoveTotal)); - DelayCommand(0.0f, SetKnownManeuversModifier(oInitiator, GetPrimaryBladeMagicClass(oInitiator), ++nMoveTotal, MANEUVER_TYPE_MANEUVER)); + nMoveTotal += 1; + if(DEBUG) DoDebug("tob_eternalblade: Adding Maneuver 1"); + if(DEBUG) DoDebug("tob_eternalblade SetKnownManeuversModifier 1: " + IntToString(nMoveTotal)); + //DelayCommand(0.0f, SetKnownManeuversModifier(oInitiator, GetPrimaryBladeMagicClass(oInitiator), nMoveTotal, MANEUVER_TYPE_MANEUVER)); + SetKnownManeuversModifier(oInitiator, nBladeClass, nMoveTotal, MANEUVER_TYPE_MANEUVER); SetPersistantLocalInt(oInitiator, "ToBEternalBlade1", TRUE); - SetPersistantLocalInt(oInitiator, "AllowedDisciplines", 270);//DISCIPLINE_DEVOTED_SPIRIT + DISCIPLINE_DIAMOND_MIND + DISCIPLINE_IRON_HEART + DISCIPLINE_WHITE_RAVEN - } + SetPersistantLocalInt(oInitiator, "AllowedDisciplines", DISCIPLINE_DEVOTED_SPIRIT + + DISCIPLINE_DIAMOND_MIND + + DISCIPLINE_IRON_HEART + + DISCIPLINE_WHITE_RAVEN); //:: (270) + + if (DEBUG) DoDebug("Granted Maneuver at Level 1: total now " + IntToString(nMoveTotal)); + if (DEBUG) DoDebug(IntToString(nStncTotal) +" stances known"); + if (DEBUG) DoDebug("Readied maneuvers now: " + IntToString(nRdyTotal)); + } if (nLevel >= 3 && !GetPersistantLocalInt(oInitiator, "ToBEternalBlade3")) { - if(DEBUG) DoDebug("tob_eternalblade: Adding Maneuver 3"); - if(DEBUG) DoDebug("tob_eternalblade SetKnownManeuversModifier 3: " + IntToString(++nMoveTotal)); - SetReadiedManeuversModifier(oInitiator, GetPrimaryBladeMagicClass(oInitiator), ++nRdyTotal); - DelayCommand(0.0f, SetKnownManeuversModifier(oInitiator, GetPrimaryBladeMagicClass(oInitiator), ++nMoveTotal, MANEUVER_TYPE_MANEUVER)); + nMoveTotal += 1; + nRdyTotal += 1; + if(DEBUG) DoDebug("tob_eternalblade: Adding Maneuver 3"); + if(DEBUG) DoDebug("tob_eternalblade SetKnownManeuversModifier 3: " + IntToString(nMoveTotal)); + SetReadiedManeuversModifier(oInitiator, nBladeClass, nRdyTotal); + //DelayCommand(0.0f, SetKnownManeuversModifier(oInitiator, GetPrimaryBladeMagicClass(oInitiator), nMoveTotal, MANEUVER_TYPE_MANEUVER)); + SetKnownManeuversModifier(oInitiator, nBladeClass, nMoveTotal, MANEUVER_TYPE_MANEUVER); SetPersistantLocalInt(oInitiator, "ToBEternalBlade3", TRUE); - SetPersistantLocalInt(oInitiator, "AllowedDisciplines", 270);//DISCIPLINE_DEVOTED_SPIRIT + DISCIPLINE_DIAMOND_MIND + DISCIPLINE_IRON_HEART + DISCIPLINE_WHITE_RAVEN + SetPersistantLocalInt(oInitiator, "AllowedDisciplines", DISCIPLINE_DEVOTED_SPIRIT + + DISCIPLINE_DIAMOND_MIND + + DISCIPLINE_IRON_HEART + + DISCIPLINE_WHITE_RAVEN); //:: (270) + + if (DEBUG) DoDebug("Granted Maneuver at Level 3: total now " + IntToString(nMoveTotal)); + if (DEBUG) DoDebug(IntToString(nStncTotal) +" stances known"); + if (DEBUG) DoDebug("Readied maneuvers now: " + IntToString(nRdyTotal)); } if (nLevel >= 5 && !GetPersistantLocalInt(oInitiator, "ToBEternalBlade5")) { - if(DEBUG) DoDebug("tob_eternalblade: Adding Maneuver 5"); + nStncTotal += 1; + nMoveTotal += 1; + if(DEBUG) DoDebug("tob_eternalblade: Adding Maneuver 5"); if(DEBUG) DoDebug("tob_eternalblade SetKnownManeuversModifier 5: " + IntToString(++nMoveTotal)); - DelayCommand(0.0f, SetKnownManeuversModifier(oInitiator, GetPrimaryBladeMagicClass(oInitiator), ++nStncTotal, MANEUVER_TYPE_STANCE)); - DelayCommand(0.0f, SetKnownManeuversModifier(oInitiator, GetPrimaryBladeMagicClass(oInitiator), ++nMoveTotal, MANEUVER_TYPE_MANEUVER)); + //DelayCommand(0.0f, SetKnownManeuversModifier(oInitiator, GetPrimaryBladeMagicClass(oInitiator), nStncTotal, MANEUVER_TYPE_STANCE)); + //DelayCommand(0.0f, SetKnownManeuversModifier(oInitiator, GetPrimaryBladeMagicClass(oInitiator), nMoveTotal, MANEUVER_TYPE_MANEUVER)); + SetKnownManeuversModifier(oInitiator, nBladeClass, nStncTotal, MANEUVER_TYPE_STANCE); + SetKnownManeuversModifier(oInitiator, nBladeClass, nMoveTotal, MANEUVER_TYPE_MANEUVER); SetPersistantLocalInt(oInitiator, "ToBEternalBlade5", TRUE); - SetPersistantLocalInt(oInitiator, "AllowedDisciplines", 270);//DISCIPLINE_DEVOTED_SPIRIT + DISCIPLINE_DIAMOND_MIND + DISCIPLINE_IRON_HEART + DISCIPLINE_WHITE_RAVEN + SetPersistantLocalInt(oInitiator, "AllowedDisciplines", DISCIPLINE_DEVOTED_SPIRIT + + DISCIPLINE_DIAMOND_MIND + + DISCIPLINE_IRON_HEART + + DISCIPLINE_WHITE_RAVEN); //:: (270) + + if (DEBUG) DoDebug("Granted Maneuver at Level 5: total now " + IntToString(nMoveTotal)); + if (DEBUG) DoDebug(IntToString(nStncTotal) +" stances known"); + if (DEBUG) DoDebug("Readied maneuvers now: " + IntToString(nRdyTotal)); } if (nLevel >= 6 && !GetPersistantLocalInt(oInitiator, "ToBEternalBlade6")) { - if(DEBUG) DoDebug("tob_eternalblade: Adding Maneuver 6"); - SetReadiedManeuversModifier(oInitiator, GetPrimaryBladeMagicClass(oInitiator), ++nRdyTotal); + nRdyTotal += 1; + if(DEBUG) DoDebug("tob_eternalblade: Adding Maneuver 6"); + SetReadiedManeuversModifier(oInitiator, nBladeClass, nRdyTotal); SetPersistantLocalInt(oInitiator, "ToBEternalBlade6", TRUE); + + if (DEBUG) DoDebug("Granted Maneuver at Level 6: total now " + IntToString(nMoveTotal)); + if (DEBUG) DoDebug(IntToString(nStncTotal) +" stances known"); + if (DEBUG) DoDebug("Readied maneuvers now: " + IntToString(nRdyTotal)); } if (nLevel >= 7 && !GetPersistantLocalInt(oInitiator, "ToBEternalBlade7")) { - if(DEBUG) DoDebug("tob_eternalblade: Adding Maneuver 7"); - if(DEBUG) DoDebug("tob_eternalblade SetKnownManeuversModifier 7: " + IntToString(++nMoveTotal)); - DelayCommand(0.0f, SetKnownManeuversModifier(oInitiator, GetPrimaryBladeMagicClass(oInitiator), ++nMoveTotal, MANEUVER_TYPE_MANEUVER)); + nMoveTotal += 1; + if(DEBUG) DoDebug("tob_eternalblade: Adding Maneuver 7"); + if(DEBUG) DoDebug("tob_eternalblade SetKnownManeuversModifier 7: " + IntToString(nMoveTotal)); + DelayCommand(0.0f, SetKnownManeuversModifier(oInitiator, nBladeClass, nMoveTotal, MANEUVER_TYPE_MANEUVER)); SetPersistantLocalInt(oInitiator, "ToBEternalBlade7", TRUE); - SetPersistantLocalInt(oInitiator, "AllowedDisciplines", 270);//DISCIPLINE_DEVOTED_SPIRIT + DISCIPLINE_DIAMOND_MIND + DISCIPLINE_IRON_HEART + DISCIPLINE_WHITE_RAVEN + SetPersistantLocalInt(oInitiator, "AllowedDisciplines", DISCIPLINE_DEVOTED_SPIRIT + + DISCIPLINE_DIAMOND_MIND + + DISCIPLINE_IRON_HEART + + DISCIPLINE_WHITE_RAVEN); //:: (270) + + if (DEBUG) DoDebug("Granted Maneuver at Level 7: total now " + IntToString(nMoveTotal)); + if (DEBUG) DoDebug(IntToString(nStncTotal) +" stances known"); + if (DEBUG) DoDebug("Readied maneuvers now: " + IntToString(nRdyTotal)); } if (nLevel >= 9 && !GetPersistantLocalInt(oInitiator, "ToBEternalBlade9")) { - if(DEBUG) DoDebug("tob_eternalblade: Adding Maneuver 9"); - if(DEBUG) DoDebug("tob_eternalblade SetKnownManeuversModifier 9: " + IntToString(++nMoveTotal)); - SetReadiedManeuversModifier(oInitiator, GetPrimaryBladeMagicClass(oInitiator), ++nRdyTotal); - DelayCommand(0.0f, SetKnownManeuversModifier(oInitiator, GetPrimaryBladeMagicClass(oInitiator), ++nMoveTotal, MANEUVER_TYPE_MANEUVER)); + nMoveTotal += 1; + nRdyTotal += 1; + if(DEBUG) DoDebug("tob_eternalblade: Adding Maneuver 9"); + if(DEBUG) DoDebug("tob_eternalblade SetKnownManeuversModifier 9: " + IntToString(nMoveTotal)); + SetReadiedManeuversModifier(oInitiator, nBladeClass, nRdyTotal); + DelayCommand(0.0f, SetKnownManeuversModifier(oInitiator, nBladeClass, nMoveTotal, MANEUVER_TYPE_MANEUVER)); SetPersistantLocalInt(oInitiator, "ToBEternalBlade9", TRUE); - SetPersistantLocalInt(oInitiator, "AllowedDisciplines", 270);//DISCIPLINE_DEVOTED_SPIRIT + DISCIPLINE_DIAMOND_MIND + DISCIPLINE_IRON_HEART + DISCIPLINE_WHITE_RAVEN + SetPersistantLocalInt(oInitiator, "AllowedDisciplines", DISCIPLINE_DEVOTED_SPIRIT + + DISCIPLINE_DIAMOND_MIND + + DISCIPLINE_IRON_HEART + + DISCIPLINE_WHITE_RAVEN); //:: (270) + + if (DEBUG) DoDebug("Granted Maneuver at Level 9: total now " + IntToString(nMoveTotal)); + if (DEBUG) DoDebug(IntToString(nStncTotal) +" stances known"); + if (DEBUG) DoDebug("Readied maneuvers now: " + IntToString(nRdyTotal)); } // Hook to OnLevelDown to remove the maneuver slots granted here diff --git a/nwn/nwnprc/trunk/newspellbook/tob_rubyknight.nss b/nwn/nwnprc/trunk/newspellbook/tob_rubyknight.nss index 279f9177..741f62b0 100644 --- a/nwn/nwnprc/trunk/newspellbook/tob_rubyknight.nss +++ b/nwn/nwnprc/trunk/newspellbook/tob_rubyknight.nss @@ -28,9 +28,9 @@ void main() int nStncTotal = GetKnownManeuversModifier(oInitiator, nClass, MANEUVER_TYPE_STANCE); int nRdyTotal = GetReadiedManeuversModifier(oInitiator, nClass); -DoDebug("nMoveTotal = "+IntToString(nMoveTotal)); -DoDebug("nStncTotal = "+IntToString(nStncTotal)); -DoDebug("nRdyTotal = "+IntToString(nRdyTotal)); + if (DEBUG) DoDebug("nMoveTotal = "+IntToString(nMoveTotal)); + if (DEBUG) DoDebug("nStncTotal = "+IntToString(nStncTotal)); + if (DEBUG) DoDebug("nRdyTotal = "+IntToString(nRdyTotal)); int nRubyLvl = GetLevelByClass(CLASS_TYPE_RUBY_VINDICATOR, oInitiator); int nRubyBonusMove = nRubyLvl / 2; @@ -38,9 +38,9 @@ DoDebug("nRdyTotal = "+IntToString(nRdyTotal)); if (nRubyLvl >= 6) nRubyBonusStance = 2; int nRubyBonusReady = nRubyLvl > 8 ? 2 : nRubyLvl > 4 ? 1 : 0; int nMod; -DoDebug("nRubyBonusMove = "+IntToString(nRubyBonusMove)); -DoDebug("nRubyBonusStance = "+IntToString(nRubyBonusStance)); -DoDebug("nRubyBonusReady = "+IntToString(nRubyBonusReady)); + if (DEBUG) DoDebug("nRubyBonusMove = "+IntToString(nRubyBonusMove)); + if (DEBUG) DoDebug("nRubyBonusStance = "+IntToString(nRubyBonusStance)); + if (DEBUG) DoDebug("nRubyBonusReady = "+IntToString(nRubyBonusReady)); // We aren't being called from any event, instead from EvalPRCFeats if(nEvent == FALSE)