Get unspent skill points
#1
Posté 18 mars 2013 - 07:22
i always wondered if there is a way to get the number of a players unspent skill points via script. Searching the nwlexicon gave me no result and calculating it from already spent skill points, classes and intelligence score seems just meh.
So, does anyone know of some way ? (not involving any extensions like nwncx)
#2
Posté 18 mars 2013 - 07:49
I could detect any Great Intelligence feats and assume that every stat point was put into Intelligence if the person has mostly Wizard levels, but it would be possible for that assumption to be incorrect.
#3
Posté 18 mars 2013 - 08:47
It would be possible to calculate this precisely if we knew the when the intelligence score changed. Best way would be to track it manually, but there is a way to figure it out for existing characters as well.MagicalMaster wrote...
Calculating it from spent skill points and classes would actually be pretty easy, could whip up a script in five minutes for that. However, I'm not sure what to do about intelligence - or more specifically how to deal with the fact that character may have increased their intelligence (especially wizards).
I could detect any Great Intelligence feats and assume that every stat point was put into Intelligence if the person has mostly Wizard levels, but it would be possible for that assumption to be incorrect.
Provided this is only used in OnLevelUp and then it can be stored, it wouldnt be so inefficient.
Simpy make a copy of the PC in hidden area and delevel it continuously and keep track of base intelligence score at levels. Well, is really isnt that simple
#4
Posté 18 mars 2013 - 09:48
/* Gets oPC's remaining skill points. */ int GetPCSkillPoints (object oPC); /* Sets oPC's remaining skill points. */ int SetPCSkillPoints (object oPC, int nSkillPoints);
Funky
#5
Posté 18 mars 2013 - 09:56
Asymmetric wrote...
(not involving any extensions like nwncx)
So the hard way it is.
Modifié par MagicalMaster, 18 mars 2013 - 09:56 .
#6
Posté 18 mars 2013 - 11:03
There is one snag to this approach. When you copy a creature the Great Ability feats get applied a second time, and when you delevel only one instance gets removed. (So if I had Great Int IX and deleveled a copy the copy will always have an intelligence 9 higher than I would have at that level). I did not specifically test RDD 9 (+2 Int at that level), but I am betting this is broken (sometimes working and sometimes not depending on the build) for deleveling, so you would have to also report the RDD level as you delevel to figure out what character level the RDD 9 took place.
Example (only sends feedback, doesn't use the feedback for calculations):
void main()
{
object oCopy = CopyObject(OBJECT_SELF, GetLocation(OBJECT_SELF));
int nHD = GetHitDice(oCopy);
while(nHD--)
{
SetXP(oCopy, nHD * (nHD + 1) * 500);
SendMessageToPC(OBJECT_SELF, "INT: "
+ IntToString(GetAbilityScore(oCopy, ABILITY_INTELLIGENCE, TRUE))
+ "\\n" + "HD: " + IntToString(GetHitDice(oCopy)));
}
}
#7
Posté 18 mars 2013 - 11:46
Always. It wouldn't be as much fun otherwiseMagicalMaster wrote...
So the hard way it is.
Modifié par Asymmetric, 18 mars 2013 - 11:47 .
#8
Posté 19 mars 2013 - 03:56
that is easy to solve, after copying compare intelligence of the original and copy and if it differs store a difference modifier and apply this modifier to all score calculations later.WhiZard wrote...
Delevel a copy and it will tell where the intelligence was changed.
There is one snag to this approach. When you copy a creature the Great Ability feats get applied a second time, and when you delevel only one instance gets removed. (So if I had Great Int IX and deleveled a copy the copy will always have an intelligence 9 higher than I would have at that level).
it is interesting though, i didnt knew about this issue
Modifié par ShaDoOoW, 19 mars 2013 - 03:57 .





Retour en haut







