107 lines
5.0 KiB
Plaintext
107 lines
5.0 KiB
Plaintext
////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Devestating Critical at Level Up Restriction
|
|
// opw_devcrit
|
|
// By Don Anderson
|
|
// dandersonru@msn.com
|
|
//
|
|
// Place this in the Module OnPlayeLevelUp Event
|
|
//
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
void main()
|
|
{
|
|
object oPC = GetPCLevellingUp();
|
|
|
|
if (!GetIsPC(oPC)) return;
|
|
|
|
//Dev Crit Allowed set in opw_mod_onload
|
|
int nDCAllow = GetLocalInt(GetModule(),"DEVCRIT");
|
|
if(nDCAllow == 0) return;
|
|
|
|
int nDevCrit = 0;
|
|
//Now Check for DevCrit Feats Chosen at Level Up
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_BASTARDSWORD, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_BATTLEAXE, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_CLUB, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_DAGGER, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_DART, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_DIREMACE, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_DOUBLEAXE, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_DWAXE, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_GREATAXE, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_GREATSWORD, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_HALBERD, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_HANDAXE, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_HEAVYCROSSBOW, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_HEAVYFLAIL, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_KAMA, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_KATANA, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_KUKRI, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTCROSSBOW, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTFLAIL, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTHAMMER, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTMACE, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LONGBOW, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LONGSWORD, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_MORNINGSTAR, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_QUARTERSTAFF, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_RAPIER, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SCIMITAR, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SCYTHE, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SHORTBOW, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SHORTSPEAR, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SHORTSWORD, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SHURIKEN, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SICKLE, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SLING, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_THROWINGAXE, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_TWOBLADEDSWORD, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_UNARMED, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_WARHAMMER, oPC)) nDevCrit = 1;
|
|
if (GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_WHIP, oPC)) nDevCrit = 1;
|
|
|
|
if (nDevCrit == 1)
|
|
{
|
|
//Set The Player to Previous Level
|
|
int nCurLevel = GetHitDice(oPC);
|
|
int nCurXP = GetXP(oPC);
|
|
int nPreXP;
|
|
|
|
switch(nCurLevel)
|
|
{
|
|
case 21: nPreXP = 190000;
|
|
case 22: nPreXP = 210000;
|
|
case 23: nPreXP = 231000;
|
|
case 24: nPreXP = 253000;
|
|
case 25: nPreXP = 276000;
|
|
case 26: nPreXP = 300000;
|
|
case 27: nPreXP = 325000;
|
|
case 28: nPreXP = 351000;
|
|
case 29: nPreXP = 378000;
|
|
case 30: nPreXP = 406000;
|
|
case 31: nPreXP = 435000;
|
|
case 32: nPreXP = 465000;
|
|
case 33: nPreXP = 496000;
|
|
case 34: nPreXP = 528000;
|
|
case 35: nPreXP = 561000;
|
|
case 36: nPreXP = 595000;
|
|
case 37: nPreXP = 630000;
|
|
case 38: nPreXP = 666000;
|
|
case 39: nPreXP = 703000;
|
|
case 40: nPreXP = 741000;
|
|
}
|
|
|
|
//Now Set How Much XP to Give Back
|
|
int nRetXP = nCurXP - nPreXP;
|
|
|
|
SendMessageToPC(oPC,"Devastating Critical is Forbidden! You will be relevelled!");
|
|
|
|
//Now we set the Previous XP
|
|
SetXP(oPC, nPreXP);
|
|
|
|
//Now Delay the Returned XP For Relevel
|
|
DelayCommand(5.0,GiveXPToCreature(oPC,nRetXP));
|
|
}
|
|
}
|