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