Is there a way to force it?
What I mean is, set it to something it normally couldn't be set and/or modifying it on the fly.
Forcing level requiriment on a server
Débuté par
Xardex
, mai 27 2011 06:52
#1
Posté 27 mai 2011 - 06:52
#2
Posté 03 juin 2011 - 02:13
I think the level restrictions are controlled by 2da's
If you wanted to change them, you would need to alter the 2da files on the server.
I dont know if they are loaded into memory and cached, so
1. You could potentially use a nwnx plugin to read and write to the 2da on the fly.
but this would only work if the 2da is not cached on each startup.
if the 2da is cached on startup, then changing it on the fly wont be possible, unless a nwnx plugin was used to refresh it somehow.
If you wanted to change them, you would need to alter the 2da files on the server.
I dont know if they are loaded into memory and cached, so
1. You could potentially use a nwnx plugin to read and write to the 2da on the fly.
but this would only work if the 2da is not cached on each startup.
if the 2da is cached on startup, then changing it on the fly wont be possible, unless a nwnx plugin was used to refresh it somehow.
#3
Posté 03 juin 2011 - 08:08
They are? Which .2da controls it then?
#4
Posté 03 juin 2011 - 09:49
Hello,
Pretty sure max level is only a command line switch on the server or an ini setting. I have a plugin that I called nwnx_levels that I'm going to post up soon (for linux). it allows changing max level on the fly. it doesn't currently encompass all that you might want since I built solely to do 'real' 1-60th levels for PCs, but it could be extended easily enough. It's been in limited production for a few months on my server.
Pretty sure max level is only a command line switch on the server or an ini setting. I have a plugin that I called nwnx_levels that I'm going to post up soon (for linux). it allows changing max level on the fly. it doesn't currently encompass all that you might want since I built solely to do 'real' 1-60th levels for PCs, but it could be extended easily enough. It's been in limited production for a few months on my server.
#5
Posté 04 juin 2011 - 06:04
The values given in itemvalue.2da seem to match up. It wouldn't be too hard to work something off those values to allow for ECL or situational modifiers to character level, though, admittedly, raising the restrictions is easier than lowering them.
Turning off ILR by default, then adding a check to the spellhook and OnEquip scripts is the only way I can think of doing it for both raising and lowering "on the fly", though the items won't show up as unusable in the inventory.
NWNX allows forced item unequipping, which covers any worn item easily in the OnEquip script, and all activated effects and spells run through the spellhook.
Turning off ILR by default, then adding a check to the spellhook and OnEquip scripts is the only way I can think of doing it for both raising and lowering "on the fly", though the items won't show up as unusable in the inventory.
NWNX allows forced item unequipping, which covers any worn item easily in the OnEquip script, and all activated effects and spells run through the spellhook.
#6
Posté 11 juin 2011 - 04:17
Oh wow I just now realize how lacking my OP was. I ment the min/max level of a server... Any chance this plugin of yours coming to windows leo?
Modifié par Xardex, 11 juin 2011 - 04:18 .
#7
Posté 11 juin 2011 - 05:19
I control maximum level in my mod entirely through the XP script. In my case, it's level + ECL for a maximum level of 20, but the maximum could easily be set as either a module or PC specific variable. As long as you run all XP awards through a single script it's an easy application to insert. I check level based on XP to prevent people from being able to exploit the XP system I have in by not taking levels.
This is (essentially) all I use:
if (GetHitDiceByXP (oTarget) + GetSkinInt (oTarget, "ECL") < 20) )
{
GiveXPToCreature (oTarget, nXPReward);
}
which references:
///////////////////////////////////////////////////////////////////////////////
// By th1ef
// GetHitDiceByXP
// HitDice is determined by player's xp, not by whether or not they have
// leveled
// Solve for hd from xp = hd * (hd - 1) * 500
// hd = 1/50 * (sqrt(5) * sqrt(xp + 125) + 25)
int GetHitDiceByXP(object oCreature)
{
float fXP = IntToFloat(GetXP(oCreature));
return FloatToInt(0.02f * (sqrt(5.0f) * sqrt(fXP + 125.0f) + 25.0f));
}
Something like that might work for you until you can get a NWNX plugin to handle it, though it's still limited by the number set in the module maximum level regardless.
This is (essentially) all I use:
if (GetHitDiceByXP (oTarget) + GetSkinInt (oTarget, "ECL") < 20) )
{
GiveXPToCreature (oTarget, nXPReward);
}
which references:
///////////////////////////////////////////////////////////////////////////////
// By th1ef
// GetHitDiceByXP
// HitDice is determined by player's xp, not by whether or not they have
// leveled
// Solve for hd from xp = hd * (hd - 1) * 500
// hd = 1/50 * (sqrt(5) * sqrt(xp + 125) + 25)
int GetHitDiceByXP(object oCreature)
{
float fXP = IntToFloat(GetXP(oCreature));
return FloatToInt(0.02f * (sqrt(5.0f) * sqrt(fXP + 125.0f) + 25.0f));
}
Something like that might work for you until you can get a NWNX plugin to handle it, though it's still limited by the number set in the module maximum level regardless.





Retour en haut







