Author Topic: Does anyone know a way to exceed the skill cap of 127?  (Read 481 times)

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Does anyone know a way to exceed the skill cap of 127?
« on: October 23, 2011, 12:55:38 am »


               Specifically I am wanting to be able to boost the concentration of caster mobs in high level areas on my PW. PCs do some crazy damage, and even if maxed at 127 concentration, caster mobs dont stand a chance at making their check. Any one have any ideas on this?
Thanks,
Laz
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Does anyone know a way to exceed the skill cap of 127?
« Reply #1 on: October 23, 2011, 02:59:03 am »


               The skill rank is stored as a byte, so the maximum range that can be stored when the PC is saved is --128 to 127. If you could increase the skill to 128 it would be ox80 in hex, so the game would read it as -128 since the sign flag is set.
               
               

               


                     Modifié par Lightfoot8, 23 octobre 2011 - 01:59 .
                     
                  


            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Does anyone know a way to exceed the skill cap of 127?
« Reply #2 on: October 23, 2011, 03:11:19 am »


               Yep and that is the problem we are experiencing (same with saves), is there any work around for this?
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Does anyone know a way to exceed the skill cap of 127?
« Reply #3 on: October 23, 2011, 06:42:18 am »


               There may be a NWNx fix.   I dont know,  Since I am not a NWNx user.   Without it or some other way of haking into the engine I see no way to do it.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Does anyone know a way to exceed the skill cap of 127?
« Reply #4 on: October 23, 2011, 07:22:58 am »


               You can actually get it up to 140 with both skill focuses - this is something that we do on our hardest mobs, though acaos has been talking about a hack to up that further. Aside from skill focus/epic sf, there's only one way to break that barrier - lockpicks, on OL.

If it's a problem, I would suggest spawning the casters in with some Su damage immunities and or resists, as an alternative. Or just have them instabuff on spawn with some immunity and soaking spells, like premo and energy buffer (and ele shield, melf's acid sheath, etc).

Funky
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Does anyone know a way to exceed the skill cap of 127?
« Reply #5 on: October 23, 2011, 07:35:32 am »


               Our caster mobs do autobuff on spawning, and many builders have added immunities and resists, but unless they are 85% immune or more it doesn't do much against a player dishing out 1000-2000 dmg, and it's kinda a self-defeating cycle, if we just up % immune the spawns in higher lvl areas it get.

We do use nwnx_funcs (for windows), and in fact I think it was your suggestion Light (If IRC) that let us use this to stop mobs PPing in their on spawn script:
NWNXFuncs_SetSkill(OBJECT_SELF, SKILL_PICK_POCKET, 0);

Using this function is it possible to exceed the cap? Or will it bug the creature into negatives like when exceeding it with item properties?
               
               

               


                     Modifié par Lazarus Magni, 23 octobre 2011 - 11:16 .
                     
                  


            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Does anyone know a way to exceed the skill cap of 127?
« Reply #6 on: October 23, 2011, 08:33:45 am »


               Hrm. I kind of doubt it, since acaos was talking about extra coding, but you could try. I THINK you can exceed 99 on critter abilities with ModifyAbilityScore, but I seem to recall it causing serious problems - viewing them causing crashing, or some such.

Funky
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Does anyone know a way to exceed the skill cap of 127?
« Reply #7 on: October 23, 2011, 12:22:55 pm »


               Hmm, well I could try and play around with:
NWNXFuncs_SetSkill(OBJECT_SELF, SKILL_CONCENTRATION, 500);
in the on spawn script, and see what happens. But if it causes crashes that's not much of a solution.

There would also be the problem of getting it to scale correctly based off the creature's CR. I would not want a CR 40 spawn to have 500 concentration, but I might want a CR 400 one to.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Does anyone know a way to exceed the skill cap of 127?
« Reply #8 on: October 24, 2011, 12:58:59 am »


               I suspect that will either crash server or simply wont work, so my suggestion is to make a special AI where you tell creature to cast fake spell and after this action trigger normal code, of course that has its own issues... if you are interested in this solution I can post a code that I use for one my creature that fake spell in order to be able to target even out of range characters.
               
               

               


                     Modifié par ShaDoOoW, 23 octobre 2011 - 11:59 .
                     
                  


            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Does anyone know a way to exceed the skill cap of 127?
« Reply #9 on: October 24, 2011, 01:43:43 am »


               What do you mean by fake spell Shadooow? This fake spell would then absorb (so to speak) the concentration check I take it, and give a free action to cast a normal spell or something?
               
               

               


                     Modifié par Lazarus Magni, 24 octobre 2011 - 12:44 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Does anyone know a way to exceed the skill cap of 127?
« Reply #10 on: October 24, 2011, 02:01:20 am »


               See this code, you might understand it better than from my description:

#include "x2_inc_switches"
#include "nw_i0_generic"

void Spell(int nSpell, object oTarget);

void main()
{
    SetCreatureOverrideAIScriptFinished(OBJECT_SELF);

    if (GetLocalInt(OBJECT_SELF, "AI_RUNNING") == 1)
        return;

    object oEnemy = GetNearestSeenEnemy();
    if (GetIsObjectValid(oEnemy))
    {
        // this is where this line should be, not above where I've commented it out
        SetLocalInt(OBJECT_SELF, "AI_RUNNING", 1);

        talent t = GetCreatureTalentBest(TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_AREAEFFECT,60);
         while(GetIsTalentValid(t))
         {
         ActionCastSpellAtObject(GetIdFromTalent(t),OBJECT_SELF,METAMAGIC_NONE,FALSE,60,PROJECTILE_PATH_TYPE_DEFAULT,TRUE);
         t = GetCreatureTalentBest(TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_AREAEFFECT,60);
         }
        int nSpell = SPELL_EPIC_RUIN;
        vector vObjectPosition = GetPosition(oEnemy);
        vector vNewPosition = GetPosition(OBJECT_SELF);
        float fNewFacing = VectorToAngle(vObjectPosition-vNewPosition);
        SetFacing(fNewFacing);
        ActionCastFakeSpellAtObject(nSpell,OBJECT_SELF);
        ActionDoCommand(Spell(nSpell,OBJECT_SELF));
        ActionDoCommand(SetLocalInt(OBJECT_SELF, "AI_RUNNING", 0));

    }
}
#include "70_inc_spells"
#include "x0_i0_spells"

void Spell(int nSpell, object oTarget)
{
  oTarget = GetLastAttacker();
  if(!GetIsObjectValid(oTarget))oTarget = GetNearestSeenEnemy();
  if(!GetIsObjectValid(oTarget))
  return;
     float fDist = GetDistanceBetween(OBJECT_SELF, oTarget);
    float fDelay = fDist/(3.0 * log(fDist) + 2.0)-1.0;

    if(spellsIsTarget(oTarget, SPELL_TARGET_SINGLETARGET, OBJECT_SELF))
    {
        //Fire cast spell at event for the specified target
        SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_EPIC_RUIN));
        //Roll damage
        int nDam = d6(35);
        //Set damage effect

        if(MySavingThrow(SAVING_THROW_FORT, oTarget, 65, SAVING_THROW_TYPE_SPELL, OBJECT_SELF))
        {
            nDam /=3;
        }

        effect eDam = EffectDamage(nDam, DAMAGE_TYPE_POSITIVE, DAMAGE_POWER_PLUS_TWENTY);
        ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), GetLocation(oTarget));
        ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(487), oTarget);
        ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_BLOOD_CRT_RED), oTarget);
        ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_CHUNK_BONE_MEDIUM), oTarget);
        DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
    }
}


This is my custom AI which cause creature to cast epic "epic ruin" on nearest seen enemy. The epic ruin is slightly improved here.

Also since its fake spell the casting cannot be interrupted (unless you script it in OnDamaged event) however it has some other issues:
- the code after cast spell triggers a bit late than for normal spell
- resistspell probably not work right (havent tested yet but its very possibly)
- spellcraft bonus into save vs spell might not work (also havent tested yet)
- some spell functions like casterlevel obviously wont work or return weird numbers



Maybe it would be possible to cast instant normal spell after finishing fake one but the first issue will remain (I havent tried this as I needed the spell to work differently anyway)
               
               

               


                     Modifié par ShaDoOoW, 24 octobre 2011 - 01:04 .
                     
                  


            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Does anyone know a way to exceed the skill cap of 127?
« Reply #11 on: October 24, 2011, 08:47:09 am »


               Well I am by no means a scripter, so posting code doesn't help me much for explaining your meaning of fake spells. Given your disclaimers as to the flaws of this system however (and the fact that ruin has already been modified on my PW, and if every time a caster creature cast a spell it also cast ruin, this would deffinitely not be a solution.)

I take it you mean by fake spell, an epic spell? If so, yeah as stated in the last paragraph that's not going to be good for us if cast on evey spell (CR 10 mage spawns casting epic ruin every time they cast ice dagger... umm ouch.) Not to mention all the other things you mentioned Shadooow.

On a side note though, we have been looking at your dev crit immunity fix (not for dev crit, but for it's ability to allow bosses immunity to other instant death effects like vorpal.) Just thought I would mention that, and say thanks for that vault submission, although totally unrelated to the topic at hand.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Does anyone know a way to exceed the skill cap of 127?
« Reply #12 on: October 24, 2011, 03:22:03 pm »


               i didnt said this code should suit you, I just thought you are scripter and you will be able to understand the concept which I believe might allow to workaround your issue. But since I have lots of stuff to do, I dont have time to make something I wont need for myself so sorry I wont change the code to do this. You have to find other takers.

Second chance is NWNX I guess it should be possible to hook into Concentration Check function and rewrite it to use local variables for example.
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Does anyone know a way to exceed the skill cap of 127?
« Reply #13 on: October 24, 2011, 06:07:21 pm »


               I do appreciate the example code Shadoow, and I didn't mean to sound ungratefull. I will keep looking and see what I can turn up. Thanks everyone.