This is a New Revision of the Feat Blinding Speed Script I edited to give 3 uses & bonuses (including new functions) based upon the Level & Dexterity of the User. (Works on Monsters Too!)
The Beauty of this revisions is, you don't have to go making special icons / feats for these greater abilities, the script does all the work for the original feat..
You can tweak it to your desires, Enjoy!
----------------------------
//::///////////////////////////////////////////////
//:: Blinding Speed (Modified & Tested)
//:: x2_s2_blindspd.nss
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Gives the targeted creature one extra partial
action per round.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 29, 2001
//:://////////////////////////////////////////////
//:: Modified By: Genisys / Guile
//:: Modified On: 4/25/2012
/////////////////////////////////////////////////////////////
// Modified March 2003: Remove Expeditious Retreat effects
////////////////////////////////////////////////////////////
/*
+1 Attack / Round (Up To +4 Extra Attacks @ 36+ BASE Dex / Scaled By Dex)
Duration 1 Second / Level + 10 Seconds / Bonus Attack
#of Attacks Capped for Monks & Dual Welders (including Dual Welding Monks)
Max Duration 80 Seconds / Max Uses 4
+1 AB / +2 AC BASE + 1 / Extra Attack up to + 5 AB / + 6 AC
(NOTE: This Damage STACKS with other Blud. Dmg!)
Bonus Bludgeoning Damage 1d10 / 2d8 / 2d8 / 2d10 / 2d12
*/
///////////////////////////////////////////////////////////////////////////////
//Required Includes
#include "x0_i0_spells"
#include "x2_inc_spellhook"
//Main Script
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
effect eHaste = EffectHaste(); //If NOT Hasted...
effect eVis = EffectVisualEffect(460);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eLink = EffectLinkEffects(eHaste, eDur);
//Calculate Extra Attacks (Based on the BASE Dex Score)
int nDex = GetAbilityScore(oTarget, ABILITY_DEXTERITY, TRUE);
int nCount;
int nTimes;
int nDmg;
//First remove pre-existing Blinding Speed Feat Effects...
RemoveEffectsFromSpell(GetSpellTargetObject(), GetSpellId());
//Bonus Attacks based upon Dex Score...
switch(nDex)
{
case 28: { nCount = 2; nTimes = 2; nDmg = DAMAGE_BONUS_2d8;} break; // +2 Attacks
case 29: { nCount = 2; nTimes = 2; nDmg = DAMAGE_BONUS_2d8;} break;
case 30: { nCount = 2; nTimes = 2; nDmg = DAMAGE_BONUS_2d8;} break;
case 31: { nCount = 2; nTimes = 2; nDmg = DAMAGE_BONUS_2d8;} break;
case 32: { nCount = 3; nTimes = 3; nDmg = DAMAGE_BONUS_2d10;} break; // +3 Attacks
case 33: { nCount = 3; nTimes = 3; nDmg = DAMAGE_BONUS_2d10;} break;
case 34: { nCount = 3; nTimes = 3; nDmg = DAMAGE_BONUS_2d10;} break;
case 35: { nCount = 3; nTimes = 3; nDmg = DAMAGE_BONUS_2d10;} break;
case 36: { nCount = 4; nTimes = 4; nDmg = DAMAGE_BONUS_2d12;} break; // +4 Attacks
case 37: { nCount = 4; nTimes = 4; nDmg = DAMAGE_BONUS_2d12;} break;
case 38: { nCount = 4; nTimes = 4; nDmg = DAMAGE_BONUS_2d12;} break;
}
if(nDex <28) { nCount = 1; nTimes = 1; nDmg = DAMAGE_BONUS_2d6;} //Base +1 Attack (all users)
if(nDex >38) { nCount = 4; nTimes = 4; nDmg = DAMAGE_BONUS_2d12;}
object oLeft = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oTarget);
int nDual = GetHasFeat(FEAT_TWO_WEAPON_FIGHTING, oTarget);
if(nDual)
{
//Dual Welding Monks ONLY + 1 Attack! Max!
if(GetLevelByclass(class_TYPE_MONK, oTarget)>=1)
{
if(nCount>=2) { nCount = 1; } //Monks Max Attacks = +2 Bonus Attacks!
}
else
{
if(nCount >1)
{
nCount = nCount - 1; //decrement by -1...
}
}
}
//Monks ONLY + 2 Attacks! Max! (IF NOT Dual Welding)
else if(GetLevelByclass(class_TYPE_MONK, oTarget)>=1)
{
if(nCount>=3) { nCount = 2; } //Monks Max Attacks = +2 Bonus Attacks!
}
//Prevent Errors (Unlikely to happen, but just in case!)
if(nCount <1) { nCount = 1; }
if(nCount >4) { nCount = 4; }
if(nTimes <1) { nTimes = 1; }
if(nTimes >4) { nTimes = 4; }
effect eAtt = EffectModifyAttacks(nCount); //nCount is only for Bonus Attacks!
int nAB = nTimes + 1; // e.g. +1 through + 4
//Cap AB @ +4
if(nAB > 4) { nAB = 4; }
int nAC = nTimes + 2; // e.g. +2 through + 6
//Cap AC @ + 6
if(nAC >6) { nAC = 6; } //Not really needed, but just incase!
effect eAB = EffectAttackIncrease(nAB, ATTACK_BONUS_MISC);
effect eAC = EffectACIncrease(nAC, AC_DODGE_BONUS, AC_VS_DAMAGE_TYPE_ALL);
effect eDam = EffectDamageIncrease(nDmg, DAMAGE_TYPE_BLUDGEONING);
//Duration Calculated...
int nLvl = GetHitDice(oTarget); // 1 Second / Level (21-40 Levels)
int nMod = nTimes * 10; // (10 - 40 Bonus) 31 - 80 Seconds Possible...
int nNew = nLvl + nMod;
// Check & Set Usage...
int nUses = GetLocalInt(oTarget, "BLS_USES");
int nCheck = nUses + 1;
int nTest = nTimes - nCheck;
//We only use this system if they have more than 1 Blinding Speed Uses
//If the PC has not used BS & they have more than 1 use available!
if(nTimes > 1 && nUses == 0)
{
SetLocalInt(OBJECT_SELF, "BLS_USES", nCheck);
DelayCommand(0.6, IncrementRemainingFeatUses(OBJECT_SELF, 491));
}
//If the PC has more uses left over...
else if(nTest >= 1)
{
SetLocalInt(OBJECT_SELF, "BLS_USES", nCheck);
DelayCommand(0.6, IncrementRemainingFeatUses(OBJECT_SELF, 491));
}
else
{
SetLocalInt(oTarget, "BLS_USES", 0); //Reset the system!
}
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oTarget, GetSpellId(), FALSE));
//Check for metamagic extension
// Apply effects to the currently selected target.
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAtt, oTarget, RoundsToSeconds(nNew));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAB, oTarget, RoundsToSeconds(nNew));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAC, oTarget, RoundsToSeconds(nNew));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDam, oTarget, RoundsToSeconds(nNew));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nNew));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
//End Main Script
}
////////////////////////////////////////
--------------------------
Again, All Instances of "class" will need to be Capitalized, as the forums are (for some reason) automatically making "class" lower case... Even the "C" in "class" will be reduced to lower case, you will need to fix this in order to use this script! You will need to change the "C" in the function GetLevelByclass(), so that the "C" is capitalized.
Genisys / Guile
Modifié par _Guile, 12 mai 2012 - 01:53 .