Author Topic: Bolster Undead Ability  (Read 721 times)

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Bolster Undead Ability
« on: February 15, 2012, 09:52:58 pm »


               Does anybody know if using this ability also affects the caster?
http://nwn.wikia.com.../Bolster_undead
The description here makes it sound like it just affects party members but not the caster?
Thanks,
Laz
               
               

               
            

Legacy_f3l1p3

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Bolster Undead Ability
« Reply #1 on: February 15, 2012, 10:41:31 pm »


               i think it would be easier to just alter the TU script to take into account post40 when calculating an undeads HD just add a line like
nHD = Level40PlusMagicBuff( nHD, oTarget );
at the end of HD calculation, this would make a lvl40 toon at lvl140 have 80hd(without magic rune) and shouldnt affect monsters (tho im not sure on that since they get some sort of post40 as well and i have no idea if it uses same script as player post40)
               
               

               
            

Legacy_f3l1p3

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Bolster Undead Ability
« Reply #2 on: February 15, 2012, 10:43:42 pm »


               and i didn't realize this wasn't our forums when posting '<img'> sry
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Bolster Undead Ability
« Reply #3 on: February 15, 2012, 10:44:34 pm »


               

Lazarus Magni wrote...

Does anybody know if using this ability also affects the caster?
http://nwn.wikia.com.../Bolster_undead
The description here makes it sound like it just affects party members but not the caster?
Thanks,
Laz

it does
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Bolster Undead Ability
« Reply #4 on: February 16, 2012, 12:58:41 am »


               TY Angus, and ShadoooW. NPC "post 40" (More like CR based boost) is facilitated by multiple scripts. For the magic componet, yes it is integrated into our post 40 magic system which would mean NPC undead, vermin, constructs, and elementals would take advantage of this too. Which might not be a bad idea actually... They have a max 180 class levels, and although turn resistance can boost their HD to anything really for the purposes of resisting TU, still an accross the board approach might be effective.Then again we have already spent alot of time balancing the HD on creatures to scale appropiately for the level area they are in, so iduno... Perhaps an if target creature is oPC, than nHD = Level40PlusMagicBuff( nHD, oTarget ); statement might work?
               
               

               


                     Modifié par Lazarus Magni, 16 février 2012 - 01:00 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Bolster Undead Ability
« Reply #5 on: February 16, 2012, 02:02:01 am »


               not sure what are you talking about but turn resistance does no effect on PC by default, my unofficial patch added this feature however only from items as there is no pretty way to retrieve the ammount of increase from effect.

In your environment, you need to alter nTurnLevel to add "levels" above 40 when caster is PC etc.
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Bolster Undead Ability
« Reply #6 on: February 16, 2012, 06:24:52 am »


               Turn resistance can be added to hides of creatures to boost their effective HD vs TU above 180. That's what I am talking about. Your unofficial patch may have added this, but we already have it either by default, or from CEP 2.3+. I have already added this to a number of turnable bosses to prevent then from being turned by a cleric/pally/ect well below the level of the area.

Turn undead has already been modified on Av3 (actually since Av1) to give post 40 (Av3 just modified it further to make it usefull for lower lvl turners). That is not the issue. The issue is that a lvl 300+ shifter in undead form can be turned by a lvl 60 cleric PC or NPC (lvl 80 with the defualt TU). Hence wanting to give bolster undead post 40 increasing the TR to undead shifter shapes.

The problem is Angus mixed an internal post with an external one. Hence I understand your confusion. Av3 is not vanilla nwn 1.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Bolster Undead Ability
« Reply #7 on: February 16, 2012, 09:07:01 am »


               again, turn resistance does not apply to the PC by default, shifter player character with a tunr resistance of 180 on its hide has turn resistance equal to his character level. Thats why  NPC of 60HD can turn him.

My patch counts the turn resistance on all items for PCs (with the ability to give turn resistance even on non-creature items - however turn resistance ammount has not been increased, thats from CEP) and again my solution does not count TR from spells like Bolster Undead.
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Bolster Undead Ability
« Reply #8 on: February 16, 2012, 09:29:09 am »


               I have no mis-conception about this ShaDoOoW. I never said PCs got TR applied to their skins. Just that you could apply it the the skins of NPCs. Again this is not the issue.

My original question was if the ability "Bolster Undead" would apply to both the party as well as the caster. In the context of the caster being a PC, specifically this is what I was wondering. If your telling me that TR can not be applied to a PC (due to lack of skin), well this is usefull info. In that case giving this ability to PC undead shifters serves no purpose. And if so, it sounds like Angus' approach is prolly the only solution if I want the mobs with more than 40 class lvls (HD) to have TU on our mod and not be able to turn undead shifters regardless of their lvls.

Then again I could just remove the ability from such mobs. But I was hoping for a more dynamic solution.
               
               

               


                     Modifié par Lazarus Magni, 16 février 2012 - 09:45 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Bolster Undead Ability
« Reply #9 on: February 16, 2012, 09:57:00 am »


               

Lazarus Magni wrote...
If your telling me that TR can not be applied to a PC (due to lack of skin), well this is usefull info.

In brief yes, though reasons why it doesnt work are differents, but conclusion is the same PC shifter will not benefit from this ability by default. Still you can modify the turn undead script to make it work but if that should have been workaround in order not to do this, then its pointless:innocent:
               
               

               


                     Modifié par ShaDoOoW, 16 février 2012 - 09:58 .
                     
                  


            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Bolster Undead Ability
« Reply #10 on: February 16, 2012, 06:20:34 pm »


               

Lazarus Magni wrote...
 If your telling me that TR can not be applied to a PC (due to lack of skin), well this is usefull info.


It is not due to a lack of skin, rather it is because the command for getting turn resistance returns 0 if the creature is a PC.  The best a PC shifter can do for TR using the default turn undead scripts is the TR emulation of SR while in an outsider form.
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Bolster Undead Ability
« Reply #11 on: February 16, 2012, 07:33:41 pm »


               That's too bad. Thanks for the info guys. I will have to look for another solution.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Bolster Undead Ability
« Reply #12 on: February 16, 2012, 09:23:34 pm »


               I don't see what the dilemma is. Just code your own. You can use a custom effect with either the effect id set to a custom number (if you're using NWNX) or an EffectCreator to distinguish it from other effects. Here's our TR function:


int GetTurnResistance (object oCreature) {
    int nTR = GetLocalInt(oCreature, "TR"), nTRAdd = 0;

    /* check for bolster effect */

    if (GetHasSpellEffect(HGEFFECT_BOLSTER_UNDEAD, oCreature))
        nTRAdd += 4;

    /* check for Falxugon bardsong, adds 2 to TR */

    effect eScan = GetFirstEffect(oCreature);
    int nFalx = 0, nEffectID;
    while (GetIsEffectValid(eScan)) {

        nEffectID = GetEffectSpellId(eScan);
        if (nEffectID >= 19000 && nEffectID <= 19099) {

            if (GetLocalInt(GetEffectCreator(eScan), "ID") == 65) {
                nFalx = 2;
                break;
            }
        }

        eScan = GetNextEffect(oCreature);
    }
    nTRAdd += nFalx;

    /* return here if TR var was set */

    if (nTR > 0)
        return nTR + nTRAdd;

    if (GetIsPC(oCreature))
        nTR = GetHitDiceIncludingLLs(oCreature);
    else {
        float fCR = GetChallengeRating(oCreature);
        if (fCR < 10.0)
            nTR = FloatToInt(fCR);
        else
            nTR = 1 + FloatToInt(fCR / (log(fCR) / log(10.0)));
    }

    return nTR + nTRAdd;
}

Obviously, that last bit is going to depend on what your CRs look like, but this should give you an idea. You will of course have to customize your turning scripts, but it sounds like you're already doing that. Here's ours, in case it's of help:


#include "hg_inc"

#include "ac_data_inc"
#include "ac_spell_inc"


const int DAMAGE_BEHAVIOR_TURNED        = 0x00000020;
const float RADIUS_SIZE_TURNING         = 15.0;


void main() {
    object oTurner = OBJECT_SELF;

    if (GetAbilityScore(oTurner, ABILITY_CHARISMA, TRUE) < 10) {
        FloatingTextStringOnCreature("You must have 10 base Charisma to turn undead!", oTurner, FALSE);
        return;
    }

    int i, nclass, nLL, nBonus = 0, nUndead = GetLevelByclass(class_TYPE_CLERIC, oTurner);
    int bPlanar = GetHasFeat(FEAT_EPIC_PLANAR_TURNING, oTurner);

    /* check for creatures that block turning */
    i = 1;
    object oTurnBlocker = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY);
    while (GetIsObjectValid(oTurnBlocker)) {
        if (GetLocalInt(oTurnBlocker, "TurnBlock")) {
            FloatingTextStringOnCreature("The " + GetName(oTurnBlocker) + " is blocking your power to turn!", oTurner, FALSE);
            return;
        }
        oTurnBlocker = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, oTurner, ++i);
    }

    if ((nclass = GetLevelByclass(class_TYPE_PALADIN, oTurner)) > 2 &&
        GetAlignmentGoodEvil(oTurner) == ALIGNMENT_GOOD) {
        if (bPlanar                                     &&
            !GetPCOption(oTurner, PCOPTION_NOTURNSMITE) &&
            GetHasFeat(FEAT_SMITE_EVIL, oTurner)) {

            DecrementRemainingFeatUses(oTurner, FEAT_SMITE_EVIL);
        } else
            nclass -= 2;
        nUndead += nclass;
    }

    if ((nclass = GetLevelByclass(class_TYPE_BLACKGUARD, oTurner)) > 2 &&
        GetAlignmentGoodEvil(oTurner) == ALIGNMENT_EVIL) {

        if (!GetQuasiclass(oTurner))
            nclass += GetLevelByclass(class_TYPE_PALADIN, oTurner);

        if (bPlanar                                     &&
            !GetPCOption(oTurner, PCOPTION_NOTURNSMITE) &&
            GetHasFeat(FEAT_SMITE_GOOD, oTurner)) {

            DecrementRemainingFeatUses(oTurner, FEAT_SMITE_GOOD);
        } else
            nclass -= 2;
        nUndead += nclass;
    }


    if ((nLL = GetHitDiceIncludingLLs(oTurner) - 40) > 0) {
        switch (GetLLControlclass(oTurner)) {
            case class_TYPE_CLERIC:
            case class_TYPE_PALADIN:
            case class_TYPE_BLACKGUARD:
                nUndead += nLL;
                break;

            default: nLL = 0; break;
        }
    } else
        nLL = 0;

    if (nUndead < 1) {
        FloatingTextStringOnCreature("You have no turning powers! You must be good to use Paladin turning powers, and evil to use Blackguard turning powers.",
                                     oTurner, FALSE);
        return;
    }

    if (nUndead > 60) {
        nBonus  = nUndead - 60;
        nUndead = 60;
    }


    /* check for the Extra Turning item feat */
    int nExtra = GetLocalInt(oTurner, "ExtraTurning");
    if (nExtra > 0) {
        if (GetHasFeat(HGFEAT_Y_EXTRA_TURNING_ITEM, oTurner)) {
            if (--nExtra <= 0) {
                IncrementRemainingFeatUses(oTurner, FEAT_TURN_UNDEAD);
                IncrementRemainingFeatUses(oTurner, FEAT_TURN_UNDEAD);
                IncrementRemainingFeatUses(oTurner, FEAT_TURN_UNDEAD);
                IncrementRemainingFeatUses(oTurner, FEAT_TURN_UNDEAD);
            }
        } else
            nExtra = 0;

        SetLocalInt(oTurner, "ExtraTurning", nExtra);
    }


    /* Total TR turned is equal to (TL + Cha modifer) * 3; and destruction DC is
     * equal to (TL / 2) + Cha modifier. */
    int nTotal = (nUndead + GetAbilityModifier(ABILITY_CHARISMA, oTurner)) * 3;
    int nDC    = 10 + (nUndead / 4) + GetAbilityModifier(ABILITY_CHARISMA, oTurner);
    nDC -= GetSpellAreaDCPenalty(oTurner);

    /* handle bonus turning capacity items */
    for (i = 0; i < NUM_INVENTORY_SLOTS; i++) {
        if (GetLocalInt(GetItemInSlot(i, oTurner), "ImproveTurnerCapacity")) {
            nTotal += (nTotal / 3);
            break;
        }
    }


    /* ensure turning won't break in the following round */
    int nUptime = GetLocalInt(GetModule(), "uptime") + 7;
    float fDur = RoundsToSeconds(10);


    /* TP vs Elementals receives +1 per 4 LLs for Planar Turning */
    int nElemental = GetHasFeat(FEAT_AIR_DOMAIN_POWER, oTurner) +
                     GetHasFeat(FEAT_EARTH_DOMAIN_POWER, oTurner) +
                     GetHasFeat(FEAT_FIRE_DOMAIN_POWER, oTurner) +
                     GetHasFeat(FEAT_WATER_DOMAIN_POWER, oTurner);

    if (nElemental)
        nElemental = nUndead + (bPlanar ? nLL / 4 : 0);


    /* TP vs Vermin receives +1 per 4 LLs for Planar Turning */
    int nVermin = GetHasFeat(FEAT_PLANT_DOMAIN_POWER, oTurner);

    if (nVermin)
        nVermin = nUndead + (bPlanar ? nLL / 4 : 0);


    /* TP vs Outsiders receives +1 per LL for Planar Turning */
    int nOutsider = GetHasFeat(FEAT_GOOD_DOMAIN_POWER, oTurner) +
                    GetHasFeat(FEAT_EVIL_DOMAIN_POWER, oTurner);

    if (nOutsider)
        nOutsider = nUndead + (bPlanar ? nLL : 0);


    /* TP vs Constructs is equal to TL */
    int nConstruct = GetHasFeat(FEAT_DESTRUCTION_DOMAIN_POWER, oTurner);

    if (nConstruct)
        nConstruct = nUndead + GetSpellPenetration(oTurner);


    /* TP vs Undead receives +1 per 2 LLs for Sun domain */
    if (GetHasFeat(FEAT_SUN_DOMAIN_POWER))
        nUndead += nLL / 2;


    /* Vestments of the Gardenborn */
    int bPlant = (GetResRef(GetItemInSlot(INVENTORY_SLOT_CHEST, oTurner)) == "elysetarm002");


    effect eLink = EffectTurned();

    if (!GetPCOption(oTurner, PCOPTION_NOTURNIMMOB))
        eLink = EffectLinkEffects(eLink, EffectCutsceneImmobilize());

    eLink = EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR));
    eLink = EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE));


    effect eDamage;
    effect eDeath = SupernaturalEffect(EffectDeath(TRUE));
    effect eVisTurn = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
    effect eVisDeath = EffectVisualEffect(HGVFX_IMP_TURN_DESTRUCTION_GOOD);

    location lTarget = GetLocation(oTurner);
    ApplyVisualAtLocation(HGVFX_FNF_LOS_TURNING_GOOD, lTarget);


    int nTurned = 0;
    struct List l = ListCreate(oTurner, "Turn");
    object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_TURNING, lTarget, TRUE);

    while (GetIsObjectValid(oTarget)) {
        if (GetIsTarget(oTarget)) {
            int nPower = 0, nTR = GetTurnResistance(oTarget) + 100;
            int nFeat = GetLocalInt(oTarget, "TurnFeat");
            int nRacial = GetLocalInt(oTarget, "TurnAs");

            if (GetHasSpellImmunity(SPELL_PROTECTION_FROM_ALIGNMENT, oTarget))
                nRacial = -1;

            if (nFeat && !GetHasFeat(nFeat, oTurner))
                nRacial = -1;

            if (nRacial == 0 && GetLevelByclass(class_TYPE_MONK, oTarget) >= 20)
                nRacial = RACIAL_TYPE_OUTSIDER;

            if (nRacial == 0)
                nRacial = GetRacialType(oTarget);

            if (nRacial == RACIAL_TYPE_PLANT && bPlant)
                nRacial = RACIAL_TYPE_VERMIN;

            switch (nRacial) {
                case RACIAL_TYPE_CONSTRUCT: nPower = nConstruct; break;
                case RACIAL_TYPE_ELEMENTAL: nPower = nElemental; break;
                case RACIAL_TYPE_UNDEAD:    nPower = nUndead;    break;
                case RACIAL_TYPE_VERMIN:    nPower = nVermin;    break;

                case RACIAL_TYPE_OUTSIDER:
                    if (GetIsPC(oTurner)                                &&
                        !GetIsPC(oTarget)                               &&
                        GetAlignmentGoodEvil(oTarget) == ALIGNMENT_GOOD &&
                        GetLevelByclass(class_TYPE_BLACKGUARD, oTurner) < 1)
                        nRacial = RACIAL_TYPE_INVALID;
                    else
                        nPower = nOutsider;
                    break;
            }

            /* TR is stored as an offset to TP, so we can sort by difficulty of
             * turning. To ensure we never get a negative number, 100 is added
             * to TR above (TP can never be higher than 80). */
            if (nPower > 0 && nTR <= 200) {
                int nRank = FloatToInt(GetDistanceBetween(oTarget, oTurner) * 10.0);
                nRank = ((nTR - nPower) * 1000000) + ((nRank % 1000) * 1000) + (nPower % 1000);

                for (ListSeek(l, LIST_SEEK_FIRST); ListGetValid(l); ListSeek(l, LIST_SEEK_NEXT)) {
                    if (ListGetInt(l) > nRank)
                        break;
                }

                if (!ListGetValid(l)) {
                    ListSeek(l, LIST_SEEK_LAST);
                    ListSetInt(l, nRank, LIST_SET_APPEND);
                } else
                    ListSetInt(l, nRank, LIST_SET_INSERT);

                ListSetObject(l, oTarget);

                if (GetHasEffectOfType(EFFECT_TYPE_TURNED, oTarget, oTurner))
                    nTurned++;
            }
        }

        oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_TURNING, lTarget, TRUE);
    }


    for (ListSeek(l, LIST_SEEK_FIRST); nTotal > 0 && ListGetValid(l); ListSeek(l, LIST_SEEK_NEXT)) {
        int nRank  = ListGetInt(l);
        int nPower = nRank % 1000;
        int nTR    = ((nRank / 1000000) + nPower) - 100;

        if (nTR > nTotal)
            break;


        oTarget = ListGetObject(l);
        int nLimit, nRacial = GetLocalInt(oTarget, "TurnAs");

        if (nRacial == 0)
            nRacial = GetRacialType(oTarget);

        switch (nRacial) {
            case RACIAL_TYPE_OUTSIDER: nLimit = 78; break;
            case RACIAL_TYPE_UNDEAD:   nLimit = 68; break;
            default:                   nLimit = 63; break;
        }

        /* For creatures that cannot possibly be destroyed, limit the number
         * turned at any one time to half the amount by which they exceed the
         * destruction limit. For example, for outsiders:
         *
         *  TR 79-80 = limit 4  (Amnizu, Cornugons)
         *  TR 81-82 = limit 3  (Absklarg, Fodorz)
         *  TR 83-84 = limit 2  (Pit Fiends, Malebranches)
         *  TR 85-88 = limit 1  (Ichors, Brood Serpents)
         */
        int nTargetLimit = GetLocalInt(oTarget, "TurnLimit");
        if (nTargetLimit > 0 || nTR > nLimit && nTurned > 0 && nTurned >= ((nLimit + 10) - nTR) / 2) {
            if (nTargetLimit == 0) {
                if ((nTargetLimit = ((nLimit + 10) - nTR) / 2) < 1)
                    nTargetLimit = 1;
            }

            SendMessageToPC(oTurner, C_MED_YELLOW + GetName(oTarget) + " : Turn limit of " +
                IntToString(nTargetLimit) + " exceeded");
            break;
        }


        /* calculate DC bonus, distance, and delay (standard spell effect delay) */
        int nDCBonus = 0;
        float fDist  = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget));
        float fDelay = fDist / 20;

        if (fDist <= RADIUS_SIZE_MEDIUM)
            nDCBonus = 2;
        else if (fDist <= RADIUS_SIZE_HUGE)
            nDCBonus = 1;


        SignalEvent(oTarget, EventSpellCastAt(oTurner, SPELLABILITY_TURN_UNDEAD));

        if (nRacial == RACIAL_TYPE_CONSTRUCT) {
            int nRoll = d20() + nBonus;
            int nSR = GetSpellResistance(oTarget) + nTurned++;

            if (nRoll > 20)
                nRoll = 20;

            SendSpellResistanceMessage(oTurner, oTarget, nRoll, nPower, nSR, fDelay);

            if (nPower + nRoll >= nSR) {
                if (bPlanar && GetSaveCheckResult(SAVING_THROW_WILL, oTarget, nDC + nDCBonus, SAVING_THROW_TYPE_TURNING) <= 0) {
                    DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisDeath, oTarget));
                    DelayCommand(fDelay + 0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget));
                } else {
                    effect eDamage = EffectDamage(d3(nPower), DAMAGE_TYPE_MAGICAL);

                    DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisTurn, oTarget));
                    DelayCommand(fDelay + 0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget));
                }
            }

            nTotal -= nTR;
        } else {
            int nRoll = d8() + nBonus;
            if (nRoll > 8)
                nRoll = 8;

            SendTurnResistanceMessage(oTurner, oTarget, nRoll, nPower, nTR, fDelay);

            if (nPower + nRoll >= nTR) {
                int bTurned = GetHasEffectOfType(EFFECT_TYPE_TURNED, oTarget);

                if (bTurned && (nPower + nRoll) >= (nTR + 10) &&
                    GetSaveCheckResult(SAVING_THROW_WILL, oTarget, nDC + nDCBonus, SAVING_THROW_TYPE_TURNING) <= 0) {

                    DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisDeath, oTarget));
                    DelayCommand(fDelay + 0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget));

                    nTurned++;
                } else if (!bTurned) {
                    int nBehavior = GetLocalInt(oTarget, "DamageBehavior") | DAMAGE_BEHAVIOR_TURNED;
                    SetLocalInt(oTarget, "DamageBehavior", nBehavior);

                    SetLocalObject(oTarget, "Turner", oTurner);
                    SetLocalInt(oTarget, "TurnerDC", nDC);

                    /* if the target could have been destroyed, guarantee they stay turned
                     * for at least 2 rounds instead of 1 */
                    if ((nPower + nRoll) >= (nTR + 10))
                        SetLocalInt(oTarget, "TurnBreakAttempt", nUptime + 6);
                    else
                        SetLocalInt(oTarget, "TurnBreakAttempt", nUptime);

                    DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisTurn, oTarget));
                    DelayCommand(fDelay + 0.1, ApplyTurnEffect(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDur));

                    nTurned++;
                }
            }

            nTotal -= nTR;
        }
    }

    ListDestroy(l);
}

FWIW, we've been considering tweaking the roll to get more granularity. The real pain is getting the numbers to fit your current creatures across the board, when retrofitting. LMK if you want a paste of any of the custom functions sabove.

Funky
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Bolster Undead Ability
« Reply #13 on: February 17, 2012, 12:00:39 am »


               This is interesting Funky ty. Bear with me though as I am really not a scripter. You use this as your TU script it looks correct? I only see a couple mentions in it for Turn Resistance, and they seem to be related to turn resistance on creatures (NPCs). Not PC undead shifters. Is that correct? How many HD do undead (PC) shifters have in your mod with HGLL? 60? Is that achieved via this script? It's alot of code so I may have missed it.
Laz
P.S. ShaDoOoW, does your unofficial patch work if it's only server side, or would a client have to have it too, to log in?
               
               

               


                     Modifié par Lazarus Magni, 17 février 2012 - 12:02 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Bolster Undead Ability
« Reply #14 on: February 17, 2012, 12:52:41 am »


               Lazarus: client with patch can log on server without and viceversa

as far as turn undead concerned, the 1.70 should have already include that change however I made an error in distribution and this change wasnt in the release, try 1.71beta2(dont worry about beta, its stable and I cannot recommend former 1.70 version due to few bugs introduced), or simply reuse the turn undead script from my patch (if you download 1.71b2 you get also all spellscripts in external folder.

I mean, it would be waste to install the Patch just for this as it also seriously changes behavior of spell mantle and AOEs (which most builders are not willing to try). It has many more usefull changes however I suspect that the spell related changes/fixes wont work on your server because you already modified every spells to include "levels" above 40 right? -> the Patch files has lowest priority specifically in order not to rewrite your changes in spells. However that mean that the spell-based exploits, namely metamagic one wont be automatically fixed with installing patch on your server (same as the AOE/spell mantle change). The Patch has definitely more advantages to consider though.

if you need more question above my project, please send me PM or post message into my threat in CC forum.

now back to the Turn Undead. As Funky said, its possible to modify it which is what I have done in my Patch. But I allowed only count TR from items, not from effects due to the difficulties to make such code global and CC-compatible (Note: I havent changed NWN engine but only Turn Undead script, if there is custom content special ability that also uses turn resistance, this fix wont apply in there). But in local environment like your server, you could indeed use eiither NWNX to get "power" of the TR effect from bolters undead or rescript the Bolster Undead spell to use special effect creator with tag like TR_X which would allowed to get the power this way. Or simply recalculate the power from effect creator hitdice if we know that TR bonus is HD/4
               
               

               


                     Modifié par ShaDoOoW, 17 février 2012 - 12:57 .