| rdfs:comment
| - These level up scripts are scripts that allow advancing player characters (PCs) based upon levels instead of experience points. The basis for these scripts is the formula converting a level to the number of experience points required for that level: (level * (level - 1) / 2) * 1000 For example, a PC earns level 5 upon gaining (5*4/2)*1000 = 10,000 experience points. void main() { object oPC = GetLastUsedBy(); int nCurrentLevel = GetHitDice(oPC); int nGoalXP = (nCurrentLevel + 1) * nCurrentLevel * 500; if ( GetXP(oPC) < nGoalXP ) SetXP(oPC,nGoalXP); }
- This is a long over-due question that needs answered. There are several ways to do this, I will post 2 simple scripts here that can be modified to your own needs. The basic formula for gaining a level is this, (((CurrentLevel +1) * CurrentLevel) / 2) * 1000 i.e. To Gain 5th level from 4th level the PC would need, (((4 + 1) * 4) / 2) * 1000 = 10,000 XP points needed for 5th level. Here is a Script that will allow you to level up 1 level each time an object is used.
|
| abstract
| - This is a long over-due question that needs answered. There are several ways to do this, I will post 2 simple scripts here that can be modified to your own needs. The basic formula for gaining a level is this, (((CurrentLevel +1) * CurrentLevel) / 2) * 1000 i.e. To Gain 5th level from 4th level the PC would need, (((4 + 1) * 4) / 2) * 1000 = 10,000 XP points needed for 5th level. Here is a Script that will allow you to level up 1 level each time an object is used. void main() { object oPC = GetLastUsedBy(); int nCurrentL = GetHitDice(oPC); int nXP = (((nCurrentL + 1)*nCurrentL)/2)*1000; SetXP(oPC,nXP); } The next script is a script that will set your level to 5 as long as you are already less than level 5. You can change the int nLevelMax to what ever you want the max level to be. void main() { object oPC = GetLastUsedBy(); int nCurrentL = GetHitDice(oPC); int nLevelMax = 5; if(nCurrentL < nLevelMax) { int nXP = ((nLevelMax*(nLevelMax - 1))/2)*1000; SetXP(oPC,nXP); } } Again this is in a OnUsed of an object. If you would like to use it in a conversation then change this line, object oPC = GetLastUsedBy(); to this, object oPC = GetPCSpeaker(); and place it in a "Actions Taken" script node of your conversation.
- These level up scripts are scripts that allow advancing player characters (PCs) based upon levels instead of experience points. The basis for these scripts is the formula converting a level to the number of experience points required for that level: (level * (level - 1) / 2) * 1000 For example, a PC earns level 5 upon gaining (5*4/2)*1000 = 10,000 experience points. The first script gives a PC enough experience to the take another level. If the PC already has enough experience, it will do nothing. In its current form, it would be the OnUsed event handler for a placeable. Hence, a player would use the placeable to advance a single level. void main() { object oPC = GetLastUsedBy(); int nCurrentLevel = GetHitDice(oPC); int nGoalXP = (nCurrentLevel + 1) * nCurrentLevel * 500; if ( GetXP(oPC) < nGoalXP ) SetXP(oPC,nGoalXP); } The next script advances a PC to a fixed level, provided the PC has not yet earned that level. This is also written as an OnUsed event handler. To change the target level, change the value of GOAL_LEVEL. const int GOAL_LEVEL = 5; void main() { object oPC = GetLastUsedBy(); int nGoalXP = GOAL_LEVEL * (GOAL_LEVEL - 1) * 500; if ( GetXP(oPC) < nGoalXP ) SetXP(oPC, nGoalXP); }
|