453 lines
14 KiB
Plaintext
453 lines
14 KiB
Plaintext
#include "mn_i_pcskin"
|
|
|
|
// Base classes
|
|
const int MN_BARBARIAN = 1;
|
|
const int MN_BARD = 2;
|
|
const int MN_CLERIC = 4;
|
|
const int MN_DRUID = 8;
|
|
const int MN_FIGHTER = 16;
|
|
const int MN_MONK = 32;
|
|
const int MN_PALADIN = 64;
|
|
const int MN_RANGER = 128;
|
|
const int MN_ROGUE = 256;
|
|
const int MN_SORCERER = 512;
|
|
const int MN_WIZARD = 1024;
|
|
const int MN_CORE_CLASSES = 2047;
|
|
// Prestige classes
|
|
const int MN_SHADOWDANCER = 2048;
|
|
const int MN_HARPER_SCOUT = 4096;
|
|
const int MN_ARCANE_ARCHER = 8192;
|
|
const int MN_ASSASSIN = 16384;
|
|
const int MN_BLACKGUARD = 32768;
|
|
const int MN_CHAMPION_OF_TORM = 65536;
|
|
const int MN_WEAPON_MASTER = 131072;
|
|
const int MN_PALE_MASTER = 262144;
|
|
const int MN_SHIFTER = 524288;
|
|
const int MN_DWARVEN_DEFENDER = 1048576;
|
|
const int MN_DRAGON_DISCIPLE = 2097152;
|
|
const int MN_PRESTIGE_CLASSES = 4194304;
|
|
|
|
|
|
int IsClass ( int constant, object oPC )
|
|
{
|
|
return ( GetLevelByClass( constant, oPC ) >= 1 );
|
|
}
|
|
|
|
int IsClassMN ( int class, int classvalue )
|
|
{
|
|
return ( (class & classvalue) == class );
|
|
}
|
|
|
|
int CalculateClassValue( object oPC)
|
|
{
|
|
int result = 0;
|
|
|
|
result += ( IsClass( CLASS_TYPE_BARBARIAN, oPC )) ? MN_BARBARIAN :0;
|
|
result += ( IsClass( CLASS_TYPE_BARD, oPC )) ? MN_BARD :0;
|
|
result += ( IsClass( CLASS_TYPE_CLERIC, oPC )) ? MN_CLERIC :0;
|
|
result += ( IsClass( CLASS_TYPE_DRUID, oPC )) ? MN_DRUID :0;
|
|
result += ( IsClass( CLASS_TYPE_FIGHTER, oPC )) ? MN_FIGHTER :0;
|
|
result += ( IsClass( CLASS_TYPE_MONK, oPC )) ? MN_MONK :0;
|
|
result += ( IsClass( CLASS_TYPE_PALADIN, oPC )) ? MN_PALADIN :0;
|
|
result += ( IsClass( CLASS_TYPE_ROGUE, oPC )) ? MN_ROGUE :0;
|
|
result += ( IsClass( CLASS_TYPE_SORCERER, oPC )) ? MN_SORCERER :0;
|
|
result += ( IsClass( CLASS_TYPE_WIZARD, oPC )) ? MN_WIZARD :0;
|
|
result += ( IsClass( CLASS_TYPE_ARCANE_ARCHER, oPC )) ? MN_ARCANE_ARCHER :0;
|
|
result += ( IsClass( CLASS_TYPE_ASSASSIN, oPC )) ? MN_ASSASSIN :0;
|
|
result += ( IsClass( CLASS_TYPE_BLACKGUARD, oPC )) ? MN_BLACKGUARD :0;
|
|
result += ( IsClass( CLASS_TYPE_DIVINE_CHAMPION, oPC )) ? MN_CHAMPION_OF_TORM :0;
|
|
result += ( IsClass( CLASS_TYPE_DRAGON_DISCIPLE, oPC )) ? MN_DRAGON_DISCIPLE :0;
|
|
result += ( IsClass( CLASS_TYPE_DWARVEN_DEFENDER, oPC )) ? MN_DWARVEN_DEFENDER :0;
|
|
result += ( IsClass( CLASS_TYPE_HARPER, oPC )) ? MN_HARPER_SCOUT :0;
|
|
result += ( IsClass( CLASS_TYPE_PALE_MASTER, oPC )) ? MN_PALE_MASTER :0;
|
|
result += ( IsClass( CLASS_TYPE_SHADOWDANCER, oPC )) ? MN_SHADOWDANCER :0;
|
|
result += ( IsClass( CLASS_TYPE_SHIFTER, oPC )) ? MN_SHIFTER :0;
|
|
result += ( IsClass( CLASS_TYPE_WEAPON_MASTER, oPC )) ? MN_WEAPON_MASTER :0;
|
|
|
|
return result;
|
|
}
|
|
|
|
int CheckForDevastatingCrit( object oPC )
|
|
{
|
|
int result = FALSE;
|
|
|
|
result =
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_CLUB, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_DAGGER, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_DART, oPC) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_HEAVYCROSSBOW, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTCROSSBOW, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTMACE, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_MORNINGSTAR, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_QUARTERSTAFF, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_SHORTSPEAR, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_SICKLE, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_SLING, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_UNARMED, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_LONGBOW, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_SHORTBOW, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_SHORTSWORD, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_RAPIER, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_SCIMITAR, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_LONGSWORD, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_GREATSWORD, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_HANDAXE, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_THROWINGAXE, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_BATTLEAXE, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_GREATAXE, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_HALBERD, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTHAMMER, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTFLAIL, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_WARHAMMER, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_HEAVYFLAIL, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_KAMA, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_KUKRI, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_SHURIKEN, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_SCYTHE, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_KATANA, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_BASTARDSWORD, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_DIREMACE, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_DOUBLEAXE, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_TWOBLADEDSWORD, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_DWAXE, oPC ) ||
|
|
GetHasFeat( FEAT_EPIC_DEVASTATING_CRITICAL_WHIP, oPC );
|
|
return result;
|
|
}
|
|
|
|
/*
|
|
int CheckForShiftFeats(object oPC)
|
|
{
|
|
int result = FALSE;
|
|
|
|
result =
|
|
GetHasFeat(FEAT_EPIC_CONSTRUCT_SHAPE,oPC) ||
|
|
GetHasFeat( FEAT_EPIC_WILD_SHAPE_UNDEAD,oPC);
|
|
|
|
return result;
|
|
|
|
}
|
|
int CheckForCraftingFeats (object oPC)
|
|
{
|
|
int result = FALSE;
|
|
|
|
result =
|
|
GetHasFeat( FEAT_BREW_POTION, oPC ) ||
|
|
// GetHasFeat( FEAT_SCRIBE_SCROLL, oPC ) ||
|
|
GetHasFeat( FEAT_CRAFT_WAND, oPC );
|
|
|
|
return result;
|
|
}
|
|
*/
|
|
void Feedback( string message, object oPC )
|
|
{
|
|
FloatingTextStringOnCreature(message,oPC,FALSE);
|
|
// SendMessageToPC( oPC, message );
|
|
}
|
|
|
|
int CountPrestigeClasses( object oPC )
|
|
{
|
|
// Count the number of prestige classes that a character has
|
|
int result = 0;
|
|
|
|
result += ( IsClass( CLASS_TYPE_ARCANE_ARCHER, oPC )) ? 1:0;
|
|
result += ( IsClass( CLASS_TYPE_ASSASSIN, oPC )) ? 1:0;
|
|
result += ( IsClass( CLASS_TYPE_BLACKGUARD, oPC )) ? 1:0;
|
|
result += ( IsClass( CLASS_TYPE_DIVINE_CHAMPION, oPC )) ? 1:0;
|
|
result += ( IsClass( CLASS_TYPE_DRAGON_DISCIPLE, oPC )) ? 1:0;
|
|
result += ( IsClass( CLASS_TYPE_DWARVEN_DEFENDER, oPC )) ? 1:0;
|
|
result += ( IsClass( CLASS_TYPE_HARPER, oPC )) ? 1:0;
|
|
result += ( IsClass( CLASS_TYPE_PALE_MASTER, oPC )) ? 1:0;
|
|
result += ( IsClass( CLASS_TYPE_SHADOWDANCER, oPC )) ? 1:0;
|
|
result += ( IsClass( CLASS_TYPE_SHIFTER, oPC )) ? 1:0;
|
|
result += ( IsClass( CLASS_TYPE_WEAPON_MASTER, oPC )) ? 1:0;
|
|
|
|
return result;
|
|
}
|
|
|
|
int CheckClericRestrictions( int classValue )
|
|
{
|
|
int result = FALSE;
|
|
|
|
if ( IsClassMN( MN_CLERIC, classValue ) )
|
|
result = ( classValue != MN_CLERIC );
|
|
|
|
return result;
|
|
}
|
|
/*
|
|
int CheckWizardRestrictions( int classValue )
|
|
{
|
|
int result = FALSE;
|
|
|
|
if ( IsClassMN( MN_WIZARD, classValue ) )
|
|
result = ( classValue != MN_WIZARD ) &&
|
|
( classValue != MN_WIZARD && MN_ARCANE_ARCHER );
|
|
|
|
return result;
|
|
}
|
|
|
|
int CheckSorcererRestrictions( int classValue )
|
|
{
|
|
int result = FALSE;
|
|
|
|
if ( IsClassMN( MN_SORCERER, classValue ) )
|
|
result = ( classValue != MN_SORCERER ) &&
|
|
( classValue != MN_SORCERER && MN_ARCANE_ARCHER );
|
|
|
|
return result;
|
|
}
|
|
|
|
int CheckDruidRestrictions( int classValue )
|
|
{
|
|
int result = FALSE;
|
|
|
|
if ( IsClassMN( MN_DRUID, classValue ) )
|
|
result = ( classValue != MN_DRUID ) &&
|
|
( classValue != (MN_DRUID + MN_RANGER) ) &&
|
|
( classValue != (MN_DRUID + MN_SHIFTER) ) &&
|
|
( classValue != (MN_DRUID + MN_RANGER + MN_SHIFTER) );
|
|
|
|
return result;
|
|
}
|
|
|
|
int CheckPaladinRestrictions( int classValue )
|
|
{
|
|
int result = FALSE;
|
|
|
|
if ( IsClassMN( MN_PALADIN, classValue ) )
|
|
result = ( classValue != MN_PALADIN ) &&
|
|
( classValue != (MN_PALADIN + MN_CHAMPION_OF_TORM) );
|
|
|
|
return result;
|
|
}
|
|
|
|
int CheckMonkRestrictions( int classValue )
|
|
{
|
|
int result = FALSE;
|
|
|
|
if ( IsClassMN( MN_MONK, classValue ) )
|
|
result = ( classValue != MN_MONK );
|
|
|
|
return result;
|
|
}
|
|
*/
|
|
int CheckClassRestrictions( object oPC )
|
|
{
|
|
int result = FALSE;
|
|
int classValue = CalculateClassValue( oPC );
|
|
|
|
// *** removing cleric restrictions ***
|
|
|
|
// if ( CheckClericRestrictions( classValue ) )
|
|
// {
|
|
// result = TRUE;
|
|
// Feedback("Clerics can not multiclass on this server.", oPC);
|
|
// }
|
|
|
|
// *** done removing cleric restrictions ***
|
|
|
|
// Forbid
|
|
// if ( IsClassMN( MN_MONK, classValue ) )
|
|
// {
|
|
// result = TRUE;
|
|
// Feedback("Monk cannot be chosen as a class on this server.", oPC);
|
|
// }
|
|
|
|
// Forbid
|
|
if ( IsClassMN( MN_SHADOWDANCER, classValue ) )
|
|
{
|
|
result = TRUE;
|
|
Feedback("Shadowdancer cannot be chosen as a class on this server.", oPC);
|
|
}
|
|
|
|
// Forbid
|
|
if ( IsClassMN( MN_SHIFTER, classValue ) )
|
|
{
|
|
result = TRUE;
|
|
Feedback("Shifter cannot be chosen as a class on this server.", oPC);
|
|
}
|
|
|
|
// Forbid
|
|
if ( IsClassMN( MN_PALE_MASTER, classValue ) )
|
|
{
|
|
result = TRUE;
|
|
Feedback("Pale Master cannot be chosen as a class on this server.", oPC);
|
|
}
|
|
|
|
/*
|
|
if ( CheckWizardRestrictions( classValue ) )
|
|
{
|
|
result = TRUE;
|
|
Feedback("Wizards can only multiclass with Arcane Archer on this server.", oPC);
|
|
}
|
|
|
|
if ( CheckSorcererRestrictions( classValue ) )
|
|
{
|
|
result = TRUE;
|
|
Feedback("Sorcerers can only multiclass with Arcane Archer on this server.", oPC);
|
|
}
|
|
|
|
if ( CheckDruidRestrictions( classValue ) )
|
|
{
|
|
result = TRUE;
|
|
Feedback("Druids can only multiclass with Ranger and Shifter on this server.", oPC);
|
|
}
|
|
|
|
if ( CheckPaladinRestrictions( classValue ) )
|
|
{
|
|
result = TRUE;
|
|
Feedback("Paladins can only multiclass with Champion of Torm on this server.", oPC);
|
|
}
|
|
|
|
if ( CheckMonkRestrictions( classValue ) )
|
|
{
|
|
result = TRUE;
|
|
Feedback("Monks can not multiclass on this server.", oPC);
|
|
}
|
|
*/
|
|
return result;
|
|
}
|
|
|
|
int CheckFeatRestrictions( object oPC )
|
|
{
|
|
int result = FALSE;
|
|
|
|
if (GetHasFeat(FEAT_MOUNTED_COMBAT, oPC))
|
|
{
|
|
result = TRUE;
|
|
Feedback("The Mounted Combat feat is not useable on this server.", oPC);
|
|
}
|
|
|
|
if (GetHasFeat(FEAT_MOUNTED_ARCHERY, oPC))
|
|
{
|
|
result = TRUE;
|
|
Feedback("The Mounted Archery feat is not useable on this server.", oPC);
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
int CheckSkillRestrictions( object oPC )
|
|
{
|
|
int result = FALSE;
|
|
if (GetSkillRank(SKILL_PICK_POCKET, oPC, TRUE) > 0)
|
|
{
|
|
result = TRUE;
|
|
Feedback("The Pick Pocket skill is not allowed on this server.", oPC);
|
|
}
|
|
|
|
if (GetSkillRank(SKILL_RIDE, oPC, TRUE) > 0)
|
|
{
|
|
Feedback("The Ride skill is not used on this server.", oPC);
|
|
}
|
|
|
|
if (GetSkillRank(SKILL_PERSUADE, oPC, TRUE) > 0)
|
|
{
|
|
Feedback("The Persuade skill is not used on this server.", oPC);
|
|
}
|
|
|
|
if (GetSkillRank(SKILL_APPRAISE, oPC, TRUE) > 0)
|
|
{
|
|
Feedback("The Appraise skill is not used on this server.", oPC);
|
|
}
|
|
|
|
if (GetSkillRank(SKILL_BLUFF, oPC, TRUE) > 0)
|
|
{
|
|
Feedback("The Bluff skill is not used on this server.", oPC);
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
|
|
void main()
|
|
{
|
|
object oPC = GetPCLevellingUp();
|
|
if ( GetIsPC( oPC ) )
|
|
{
|
|
int relevel = FALSE;
|
|
|
|
if ( CheckForDevastatingCrit( oPC ) )
|
|
{
|
|
relevel = TRUE;
|
|
Feedback("The feat devastating critical is not allowed on this server.", oPC);
|
|
}
|
|
|
|
if ( CheckFeatRestrictions ( oPC ) )
|
|
{
|
|
relevel = TRUE;
|
|
}
|
|
|
|
if ( CheckSkillRestrictions( oPC ) )
|
|
{
|
|
relevel = TRUE;
|
|
}
|
|
|
|
|
|
/*
|
|
if ( CheckForShiftFeats( oPC ) )
|
|
{
|
|
relevel = TRUE;
|
|
Feedback("The feat Construct Shape or Undead shape is not allowed on this server.",oPC);
|
|
}
|
|
*/
|
|
|
|
/*
|
|
// Tjek om spiller har valgt en af Biowares crafting feats
|
|
if ( CheckForCraftingFeats( oPC ) )
|
|
{
|
|
relevel = TRUE;
|
|
Feedback("The feats Brew Potion, and Craft Wand are disabled on this server.", oPC);
|
|
}
|
|
*/
|
|
|
|
/*
|
|
if (CountPrestigeClasses ( oPC ) > 1 )
|
|
{
|
|
relevel = TRUE;
|
|
Feedback("You may not choose more than one prestige class on this server.", oPC);
|
|
}
|
|
*/
|
|
|
|
if ( CheckClassRestrictions( oPC ) )
|
|
{
|
|
relevel = TRUE;
|
|
}
|
|
|
|
|
|
if ( relevel )
|
|
{
|
|
Feedback("Please re-level.", oPC);
|
|
int oldXP = GetXP( oPC );
|
|
int hitdice = GetHitDice( oPC );
|
|
int newXP;
|
|
|
|
hitdice--;
|
|
newXP = ( hitdice * ( hitdice - 1 ) * 500 );
|
|
SetXP(oPC, newXP);
|
|
|
|
// Recalculate specials, since level has changed
|
|
setupSpecialEffects (oPC);
|
|
updateSkin (oPC);
|
|
|
|
DelayCommand(1.0, SetXP(oPC, oldXP));
|
|
}
|
|
else
|
|
{
|
|
// Recalculate specials, since level has changed
|
|
setupSpecialEffects (oPC);
|
|
updateSkin (oPC);
|
|
|
|
/*
|
|
// Bloker for pale master level 10
|
|
// Skal ogsaa inkluderes i on client enter
|
|
if ( GetLevelByClass( CLASS_TYPE_PALE_MASTER, oPC ) >= 9 )
|
|
SetLocalInt( oPC, "X2_AllowPalema", 1 );
|
|
else
|
|
DeleteLocalInt( oPC, "X2_AllowPalema" );
|
|
*/
|
|
}
|
|
}
|
|
}
|
|
|
|
//void main(){}
|