Author Topic: Bolster Undead Ability  (Read 723 times)

Legacy_Lazarus Magni

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


               There seems to be a fair amount of confusion about my posts. We already have a highly customized TU which takes into account post 40 lvls, and I would not be looking to change it, except for perhaps how it interacts with undead shifter PCs (AKA Angu's suggestion, or perhaps Funky's if it can be integrated, and modified such that it can confer the TR boost to PC's but not with LL, but rather with our version of post 40.)

Shadooow, your patch looks nice. Using it in whole or part is deffinitely something I am considering.

As far as your TU (or more aptly TR) idea Shadooow... I will look into this too. TY.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Bolster Undead Ability
« Reply #16 on: February 17, 2012, 04:03:13 pm »


               

Lazarus Magni wrote...

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.


Yes, that's the turn undead script, though the name is deceptive, since it handles all types of turning. It IS primarily scirpted for PvM, but it shows how to modify TU however you might need it - the check for PCs is in the GetTurnResistance function. That TR is than passed on in the TU script.

As for hit dice, undead shifters have only 40, but the function will return 60 if they have 20 legendary levels. We track LL in the otherwise unused PC Lootable field, but you can just as easily track it by variable. Here's our GetHitDiceIncludingLLs function:

int GetHitDiceIncludingLLs (object oCreature=OBJECT_SELF, int bLL=TRUE, int bPL=FALSE) {
    int nHitDice = 0;

    if (GetIsPC(oCreature) && bLL) {
        if ((nHitDice = GetLocalInt(oCreature, "ArtificialLevel")) > 0) {
            string sTag = GetTag(GetArea(oCreature));

            if (sTag == "voyage" || sTag == "TheAltarOfLegends")
                nHitDice = GetLootable(oCreature);
        } else
            nHitDice = GetLootable(oCreature);

        if (nHitDice > 60 && !bPL)
            nHitDice = 60;
    }

    if (nHitDice < 41)
        nHitDice = GetHitDice(oCreature);

    return nHitDice;
}

The bLL and bPL are for legendary and paragon (61-80) levels respectively, indicating whether they should be included in the total.

You can alter HitDice returns anyway you like, or inject a raised number for Undead Shifters whereever you need in the calculations. You might, for example, count hit dice two or three times (or more) if the creature in question has, say, a EFFECT_TYPE_POLYMORPH effect (you might or might not need to be more specific, with an effect creator):


int GetHasEffectOfType (int nEffectType, object oTarget, object oCreator=OBJECT_INVALID) {
    int nEffects = 0;

    effect eEff = GetFirstEffect(oTarget);

    while (GetIsEffectValid(eEff)) {
        if (GetEffectType(eEff) == nEffectType &&
            (!GetIsObjectValid(oCreator) || GetEffectCreator(eEff) == oCreator))
            nEffects++;

        eEff = GetNextEffect(oTarget);
    }

    return nEffects;
}

Funky
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Bolster Undead Ability
« Reply #17 on: February 17, 2012, 09:03:08 pm »


               Thank you Funky, I will pass this info on to our scripters, and we will see what we can do.