OK guys, thanks...
Looks like I'll just stick with the current configuration include I made, any suggestions on it?
This will be released to the public so that we can have a solid & good adjustable spell system...
(All Spells hook into multiple configurations scripts to give the builder greater control over spells)
/////////////////////
// gen_sbd_config (Spells Bonus Damage Configuration Include Script)
////////////////////////////////////////////////////////////////////////////////
// Created By Genisys / Guile
// Created On 4/28/2012
////////////////////////////////////////////////////////////////////////////////
// SETTINGS....
//Set this to TRUE if you want to use Additional Damage Bonuses
const int USE_SPELL_DAMAGE_BONUSES = TRUE; // Default = FALSE; (NO Dmg Bonuses)
//Set this to FALSE if you DO NOT want to use Bonus Durations & Damage
//based upon if the Caster has Spell Focus Feat(s)...
// + 10% Dmg Bonus / Spell Focus Feat
// e.g. +30 % Dmg Bonus if Caster has the Epic Spell Focus Feat (For that spell!)
const int USE_SPELL_FOCUS_BONUS = TRUE; //Default = TRUE (Use Focus Bonus)
// Calculate Damage Bonuses...
// Set this to the damage bonus given / X Levels of the caster...
// e.g. if set to 1, then + 1 Damage / 1 Caster Levels...
// e.g. if set to 2, then + 1 Damage / 2 Caster Levels...
// ### WARNING ### DO NOT SET THIS TO 0!!!!!
const int SPELL_DMG_BONUS_LVL = 2; //Default = 2; (+1 dmg / 2 Levels)
// Set the following settings to the Bonus Given Based Upon The SPELL LEVEL
// This is set to +1 Dmg / X Caster Levels By Default
// The Above Setting controls the X Caster Levels, this controls how much
// damage is given based upon the Level of The Spell (For Finer Control!)
// NOTE: If Bonus Damage is NOT used, then this will never be calculated..
const int SPELL_LVL_0_BONUS_DMG = 1; // + 1 Dmg / X Caster Levels
const int SPELL_LVL_1_BONUS_DMG = 1; // + 1 Dmg / X Caster Levels
const int SPELL_LVL_2_BONUS_DMG = 1; // + 1 Dmg / X Caster Levels
const int SPELL_LVL_3_BONUS_DMG = 1; // + 1 Dmg / X Caster Levels
const int SPELL_LVL_4_BONUS_DMG = 1; // + 1 Dmg / X Caster Levels
const int SPELL_LVL_5_BONUS_DMG = 1; // + 1 Dmg / X Caster Levels
const int SPELL_LVL_6_BONUS_DMG = 1; // + 1 Dmg / X Caster Levels
const int SPELL_LVL_7_BONUS_DMG = 1; // + 1 Dmg / X Caster Levels
const int SPELL_LVL_8_BONUS_DMG = 1; // + 1 Dmg / X Caster Levels
const int SPELL_LVL_9_BONUS_DMG = 1; // + 1 Dmg / X Caster Levels
//The Math is really simple on this....
//First divide Caster Level by SPELL_DMG_BONUS_LVL
//Then Multiply that by SPELL_LVL_X_BONUS_DMG
////////////////////////////////////////////////////////////////////////////////
// END SETTINGS...
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//###############################################
// WARNING DO NOT TOUCH ANYTHING BELOW THIS LINE
//###############################################
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
// Define PROTOTYPE
// This function will check to see if the caster has the Spell Focus Feat(s)
// if so, then it will return the bonus for Durations & Damage!
// Durations are only slightly extended by +1 / 2 / 3 / 4 rounds/turns etc..
int GetFocusBonus(object oCaster, int nSchool)
{
//Determine which Spell Focus level the Caster Has
int nESF, nGSF, nSF;
//See which feats they have...
switch(nSchool)
{
case IP_CONST_SPELLSCHOOL_ABJURATION: {
nESF = GetHasFeat(FEAT_EPIC_SPELL_FOCUS_ABJURATION, oCaster);
nGSF = GetHasFeat(FEAT_GREATER_SPELL_FOCUS_ABJURATION, oCaster);
nSF = GetHasFeat(FEAT_SPELL_FOCUS_ABJURATION, oCaster); } break;
case IP_CONST_SPELLSCHOOL_CONJURATION: {
nESF = GetHasFeat(FEAT_EPIC_SPELL_FOCUS_CONJURATION, oCaster);
nGSF = GetHasFeat(FEAT_GREATER_SPELL_FOCUS_CONJURATION, oCaster);
nSF = GetHasFeat(FEAT_SPELL_FOCUS_CONJURATION, oCaster); } break;
case IP_CONST_SPELLSCHOOL_DIVINATION: {
nESF = GetHasFeat(FEAT_EPIC_SPELL_FOCUS_DIVINATION, oCaster);
nGSF = GetHasFeat(FEAT_GREATER_SPELL_FOCUS_DIVINATION, oCaster);
nSF = GetHasFeat(FEAT_SPELL_FOCUS_DIVINATION, oCaster); } break;
case IP_CONST_SPELLSCHOOL_ENCHANTMENT: {
nESF = GetHasFeat(FEAT_EPIC_SPELL_FOCUS_ENCHANTMENT, oCaster);
nGSF = GetHasFeat(FEAT_GREATER_SPELL_FOCUS_ENCHANTMENT, oCaster);
nSF = GetHasFeat(FEAT_SPELL_FOCUS_ENCHANTMENT, oCaster); } break;
case IP_CONST_SPELLSCHOOL_EVOCATION: {
nESF = GetHasFeat(FEAT_EPIC_SPELL_FOCUS_EVOCATION, oCaster);
nGSF = GetHasFeat(FEAT_GREATER_SPELL_FOCUS_EVOCATION, oCaster);
nSF = GetHasFeat(FEAT_SPELL_FOCUS_EVOCATION, oCaster); } break;
case IP_CONST_SPELLSCHOOL_ILLUSION: {
nESF = GetHasFeat(FEAT_EPIC_SPELL_FOCUS_ILLUSION, oCaster);
nGSF = GetHasFeat(FEAT_GREATER_SPELL_FOCUS_ILLUSION, oCaster);
nSF = GetHasFeat(FEAT_SPELL_FOCUS_ILLUSION, oCaster); } break;
case IP_CONST_SPELLSCHOOL_NECROMANCY: {
nESF = GetHasFeat(FEAT_EPIC_SPELL_FOCUS_NECROMANCY, oCaster);
nGSF = GetHasFeat(FEAT_GREATER_SPELL_FOCUS_NECROMANCY, oCaster);
nSF = GetHasFeat(FEAT_SPELL_FOCUS_NECROMANCY, oCaster); } break;
case IP_CONST_SPELLSCHOOL_TRANSMUTATION: {
nESF = GetHasFeat(FEAT_EPIC_SPELL_FOCUS_TRANSMUTATION, oCaster);
nGSF = GetHasFeat(FEAT_GREATER_SPELL_FOCUS_TRANSMUTATION, oCaster);
nSF = GetHasFeat(FEAT_SPELL_FOCUS_TRANSMUTATION, oCaster); } break;
}
//Calculate Power Based upon Feats...
int nFeatLevel = 1; //By Default NO Bonus Damage or Duration!
if(nESF)
{ nFeatLevel = 4; } // +30 % Base Bonus Damage
else if(nGSF)
{ nFeatLevel = 3; } // +20 % Base Bonus Damage
else if(nSF)
{ nFeatLevel = 2; } // +10 % Base Bonus Damage
if(USE_SPELL_FOCUS_BONUS)
return nFeatLevel;
else
return 1; // No Bonus...( X1 or +0)
}
////////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
// Define PROTOTYPE
// This Function simply calculates the bonus damage for Spell Focus Feat(s)
int GetFocusDamage(int iDam, int nSFBonus)
{
int iFinal = 0;
float fSF = IntToFloat(nSFBonus);
float fDam = IntToFloat(iDam);
switch(nSFBonus)
{
case 1: { fSF = 0.0; }break;
case 2: { fSF = 0.1; } break;
case 3: { fSF = 0.2; } break;
case 4: { fSF = 0.3; } break;
}
if(nSFBonus == 1) { return iDam; } //Stop Here... (No Bonus!)
float fAdj = fSF * fDam; // + 10 - 30% dmg (IF caster has Spell Focus Feat(s)
iFinal = iDam + FloatToInt(fAdj); //Add the bonus damage!
return iFinal;
}
////////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
// Define PROTOTYPE
// NOTE: This function will add damage to ALL Spells, as it's added to
// the base damage that spells do normally.
int GetBonusDamage(object oCaster, int nSpellLevel, int nSchool, int CLvl)
{
//Only run this if it is set to use this (see setting above)
if(USE_SPELL_DAMAGE_BONUSES == FALSE)
{ return 0; } // There is not bonus, return 0 (no damage bonus).. STOP HERE..
int iDam = 0;
int nSFBonus = GetFocusBonus(oCaster, nSchool);
//Calculate Bonus Damage Based Upon Constants Above!
int iLvl = CLvl / SPELL_DMG_BONUS_LVL; // X Levels
//---------------------------------------------------------------
//Control Spells By LEVEL and NOT by which school it is!!
switch(nSpellLevel)
{
case 0:{ iDam = SPELL_LVL_0_BONUS_DMG * iLvl; } break;
case 1:{ iDam = SPELL_LVL_1_BONUS_DMG * iLvl; } break;
case 2:{ iDam = SPELL_LVL_2_BONUS_DMG * iLvl; } break;
case 3:{ iDam = SPELL_LVL_3_BONUS_DMG * iLvl; } break;
case 4:{ iDam = SPELL_LVL_4_BONUS_DMG * iLvl; } break;
case 5:{ iDam = SPELL_LVL_5_BONUS_DMG * iLvl; } break;
case 6:{ iDam = SPELL_LVL_6_BONUS_DMG * iLvl; } break;
case 7:{ iDam = SPELL_LVL_7_BONUS_DMG * iLvl; } break;
case 8:{ iDam = SPELL_LVL_8_BONUS_DMG * iLvl; } break;
case 9:{ iDam = SPELL_LVL_9_BONUS_DMG * iLvl; } break;
}
//---------------------------------------------------------------
//If we are using the Spell Focus Bonus...
if(USE_SPELL_FOCUS_BONUS)
{
// Calculate Spell Focus Bonus + Original Bonus (iDam)..
iDam = GetFocusDamage(iDam, nSFBonus);
}
return iDam;
//End Prototype
}
////////////////////////////////////////////////////////////////////////////////
// END INCLUDE
////////////////////////////////////////////////////////////////////////////////
Modifié par _Guile, 28 avril 2012 - 03:31 .