Hi all,
I came here to ask a question, as you guys are the bristling hub of all NWN activity.
I am wondering if there is a way to disable dev crit without forcing players to download a hak file?
My scripting knowhow is very little, and so is everyone involved in the server.
I apologize that this has nothing to do with Arelith, but I didn't know where to turn.
Thank you!
-Mask
Help with scripting out Dev Crit (on a new EE server)
Moderators: Forum Moderators, Active DMs
-
- Posts: 3
- Joined: Fri May 04, 2018 4:06 pm
-
- Project Lead
- Posts: 1445
- Joined: Fri Sep 12, 2014 2:02 am
Re: Help with scripting out Dev Crit (on a new EE server)
Arelith's approach to disabling Devastating Critical was to have a script that checked for forbidden feats upon level-up or login. If a character had a forbidden feat (in this case, one of the Devastating Critical feats), the player would be sent a message that picking the feat was disallowed and the character would automatically be reduced to one XP less than what was needed for their current level.
This script was written well before the NWNX plugin, which has functions for directly removing feats from characters.
Hope this helps.
This script was written well before the NWNX plugin, which has functions for directly removing feats from characters.
Hope this helps.
Dinosaur Space Program is my working partner on Arelith-related projects. If my inbox is full or I take a while to get back to you, feel free to PM them questions or concerns.
-
- Posts: 3
- Joined: Fri May 04, 2018 4:06 pm
Re: Help with scripting out Dev Crit (on a new EE server)
Thanks for the reply!
Is there a way of getting ahold of this script and a simple instruction of how to implement it?
We are total scripting newbs.
Thanks!
Is there a way of getting ahold of this script and a simple instruction of how to implement it?
We are total scripting newbs.
Thanks!
-
- Project Lead
- Posts: 1445
- Joined: Fri Sep 12, 2014 2:02 am
Re: Help with scripting out Dev Crit (on a new EE server)
When you edit your module's properties, you will see an Events tab. One of these tabs has a field called OnPlayerLevelUp. Entering a script here will have that script trigger when a player finishes the level-up process by hitting the "OK" button.
In that script, you will likely want to first define some variables.
Once you have these, you can check to see if a player has any of the Devastating Critical feats. If so, you can send them a message and drop their XP to the XP needed for their current level, minus one.
All of the above should be placed in the void main(){} function of your OnPlayerLevelUp script.
There are likely more efficient ways of doing this, especially with NWNX. But this is how Arelith disabled Devastating Critical.
Good luck!
In that script, you will likely want to first define some variables.
Code: Select all
object oPC = GetPCLevellingUp(); // The player-character object that just leveled-up
int nLevel = GetHitDice(oPC); // The PC's hit dice. In other words, their current level.
int nXPLevel = nLevel * (nLevel - 1) / 2 * 1000; // How much XP is needed for their current level.
Code: Select all
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_BASTARDSWORD, oPC) ||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_BATTLEAXE, oPC) ||
// etc, etc. Go through all the devastating critical feats.
// Not listing them all here, just a few for purpose of example.
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_WARHAMMER, oPC) ||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_WHIP, oPC))
{
SetXP(oPC, nXPLevel - 1);
FloatingTextStringOnCreature("Devastating Critical is disabled, please do not choose it as a feat when leveling up!", oPC, FALSE);
return;
}
There are likely more efficient ways of doing this, especially with NWNX. But this is how Arelith disabled Devastating Critical.
Good luck!
Dinosaur Space Program is my working partner on Arelith-related projects. If my inbox is full or I take a while to get back to you, feel free to PM them questions or concerns.
-
- Posts: 3
- Joined: Fri May 04, 2018 4:06 pm
Re: Help with scripting out Dev Crit (on a new EE server)
Thank you So much for this, I really appreciate it!
Re: Help with scripting out Dev Crit (on a new EE server)
Could always disable it with a server side override. Looks like you have a working solution, though!