Author Topic: New Revised Blinding Speed Script  (Read 762 times)

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
New Revised Blinding Speed Script
« on: May 08, 2012, 02:03:27 am »


               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.

':wizard:'

Genisys / Guile
               
               

               


                     Modifié par _Guile, 12 mai 2012 - 01:53 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
New Revised Blinding Speed Script
« Reply #1 on: May 08, 2012, 02:12:02 am »


               

_Guile wrote...

The Beauty is, NO HAK PAK REQUIRED! '<img'>

Since when did customizing the effect of spell/feat require hak packs? '<img'>

BTW since your script does not add haste you should really remove the default lines with removespelleffect - these lines are useless anyway and I have removed them in last community patch release (because multiple haste effects doesnt stack anyway)

and now I tell you my experiences: I have altered this feat to grant extra attacks on the PW I maintained and I have seen numerous ways of altering this useless feat. But I haven't seen anything that would really maintain balance. My attempt was overlooked by players since it was 1minute 1x day boost anyway. Which is the fate of other attempts I have seen on many PWs. Not even in no-perma-haste had this feat any effect because there always existed potions of haste which has also 1minute duration. I don't think that your attempt is unique in anything except the fact you are publishing in in scripting forum (reason?) and not at vault.
               
               

               


                     Modifié par ShaDoOoW, 08 mai 2012 - 01:17 .
                     
                  


            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
New Revised Blinding Speed Script
« Reply #2 on: May 08, 2012, 02:17:13 am »


               Haha, never, but you don't have to create "Feats" for different versions of the same feats, I guess that's what I meant...  

You are correct, let me fix that in the script. '<img'>

--------------------------

ShadoOow, do you know the proper function to remove Extra Attacks?  I have to remove these or it will stack on the PC!

(non nwnx_function Preferably)

------------------------

I suppose your question was rather in the tone of "This is not the proper place for this", but I placed it here for comments, unlike the nwvault, you can actually post stuff quickly and get quick responses, on the nwvault.ign.com you usually get NOTHING (in the way of responses that is)...

So, I suppose I posted it here because I wanted feedback from other scripters...
               
               

               


                     Modifié par _Guile, 08 mai 2012 - 01:38 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
New Revised Blinding Speed Script
« Reply #3 on: May 08, 2012, 02:37:33 am »


               

_Guile wrote...

ShadoOow, do you know the proper function to remove Extra Attacks?  I have to remove these or it will stack on the PC!

(non nwnx_function Preferably)

Simple. Replace your custom function with this:

   RemoveEffectsFromSpell(GetSpellTargetObject(), GetSpellId());
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
New Revised Blinding Speed Script
« Reply #4 on: May 08, 2012, 02:39:06 am »


               Your Awesome! '<img'>
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
New Revised Blinding Speed Script
« Reply #5 on: May 08, 2012, 02:45:22 am »


               btw the dual monk wielding check has no sense - players will exploit this easily by not using two weapons when they use the feat and then they swap weapons back.

If you really want to provide only 1 extra apr to dual wield monks (which has sense only with kamas which are really not good weapons) then you should check the dual weapon feats like:
ranger dual, ambidex, 2wf, i2wf
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
New Revised Blinding Speed Script
« Reply #6 on: May 08, 2012, 02:50:27 am »


               Ah you mean a check to see if they have the feat (Ambidexterity / Two Weapon Fighting, etc)???

Say, your idea has merit. '<img'>

----------------

Fixed, changed check to see if they have the feat instead...
               
               

               


                     Modifié par _Guile, 08 mai 2012 - 01:52 .
                     
                  


            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
New Revised Blinding Speed Script
« Reply #7 on: May 08, 2012, 04:02:58 am »


               I am also not sure why monk is needed to be capped.  Monk's off-hand and bonus attacks are both -5 progressions just like non-monks.  If you are trying to compensate for a large number of mainhand attacks in the standard progression you could use the model that divine power uses and calculate the pre-epic BAB and determine standard progression APR that way.
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
New Revised Blinding Speed Script
« Reply #8 on: May 08, 2012, 07:06:07 pm »


               

WhiZard wrote...

I am also not sure why monk is needed to be capped.  Monk's off-hand and bonus attacks are both -5 progressions just like non-monks.  If you are trying to compensate for a large number of mainhand attacks in the standard progression you could use the model that divine power uses and calculate the pre-epic BAB and determine standard progression APR that way.


If you are willing to code that I'd be willing to give you credit. '<img'>
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
New Revised Blinding Speed Script
« Reply #9 on: May 08, 2012, 09:21:23 pm »


               int GetMainHandAPR(object oCreature = OBJECT_SELF)
{
int nAPR, nAB, nHD, nMonk;
nHD = GetHitDice(oCreature);
nAB = GetBaseAttackBonus(oCreature);
if(nHD > 20) nAB -= (nHD - 19)/2;
nMonk = GetLevelByclass(class_TYPE_MONK, oCreature);
if(nMonk) nAPR = (nAB + 2)/3;
else nAPR = (nAB + 4)/5;
if(nAPR < 1) nAPR = 1;
if(nAPR > 6) nAPR = 6;
return nAPR;
}
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
New Revised Blinding Speed Script
« Reply #10 on: May 10, 2012, 03:36:24 pm »


               So what you are saying is, that Monks don't get to use their "Extra Monk Attacks" when dual welding essentially?  Or is there some other argument you are making that I'm missing here?

I'm trying to figure out why you are against the Monk Cap...
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
New Revised Blinding Speed Script
« Reply #11 on: May 10, 2012, 07:07:30 pm »


               Monks don't necessarily have significantly more attacks than other characters.  The exalted sorceress, for example, would have 4APR on the main hand due to low BAB.  A high BAB monk/fighter multiclass can have up to 6 APR on the main hand, while a pure monk would only achieve 5APR on the main hand.  In order to provide a cap, I would think it would be more meaningful to cap mainhand APR then give a penalty cap to the monk builds that do not have high APR.

I below have compared the pure monk to the pure fighter so you have an example of how the APR is affected.

Monk 20 vs. fighter 20
+15/+12/+9/+6/+3
+20/+15/+10/+5
Monk 20 DW kamas vs. fighter 20 dualwield
+13/+10/+7/+4/+1/  +13/+8
+18/+13/+8/+3/ +18/+13
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
New Revised Blinding Speed Script
« Reply #12 on: May 11, 2012, 04:01:40 am »


               Well that means monks get +1 Attack here than the fighter, which was my point, they should get less one attack, and dual welders should get 1 less attack as well..

However when you add fighter to that monk say (10 monk / 10 fighter) they have more attacks...

I don't know any functions to get their # of attacks, but I just figured it would be best to apply 2 penalties to extra attacks, thereby reducing the maximum # they can have..

- 1 Extra Attack for Monks
- 1 Extra Attack for Dual Welding

Ideally the system helps Archers & Single Weapon Welders More obviously...

However, the bonus AB & AC helps all classes (that are dex based)...
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
New Revised Blinding Speed Script
« Reply #13 on: May 11, 2012, 05:39:10 am »


               

_Guile wrote...
I don't know any functions to get their # of attacks.


That is what my GetMainHandAPR() function above does.  It gets the number of attacks the main hand makes.  You can then reduce bonuses by that number (so fighter/monk gets -2, pure monk -1, exalted sorceress -0).
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
New Revised Blinding Speed Script
« Reply #14 on: May 11, 2012, 01:14:35 pm »


               int GetMainHandAPR(object oCreature = OBJECT_SELF)
{
int nAPR, nAB, nHD, nMonk;
nHD = GetHitDice(oCreature);
nAB = GetBaseAttackBonus(oCreature);
if(nHD > 20) nAB -= (nHD - 19)/2;
nMonk = GetLevelByclass(class_TYPE_MONK, oCreature);
if(nMonk>=1) nAPR = (nAB + 2)/3;
else nAPR = (nAB + 4)/5;
if(nAPR < 1) nAPR = 1;
if(nAPR > 6) nAPR = 6;
return nAPR;
}

Minor error you had there, if(nMonk), should be if(nMonk>=1)