Author Topic: Ability Overwrite  (Read 736 times)

Legacy_0pie

  • Jr. Member
  • **
  • Posts: 74
  • Karma: +0/-0
Ability Overwrite
« on: March 31, 2011, 02:36:44 am »


               I'm trying to make it so when a player uses an ability, lets say Divine Shield. The player can cast the ability again before the time is up on it. Example , a Paladin casts Divine Shield and casts it again a few seconds later. I want it to re start the timer for the buff.... but I dont know how. Anyone wana help me with an example or tips ? Thanks !
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Ability Overwrite
« Reply #1 on: March 31, 2011, 03:37:39 am »


               Well this wouldn't be much better than now, I considered it for the community patch where I allowed this for other feats (rage and empty body). Divine shield/might in fact does not reduce use per day if you try to use it again before the previous effect run out.

Which can be usefull for playing. The AC/damage increase effect icon don't blink and even if it would, it won't if you got any AC/damage increase from another source. So player is not informed before this effect ends and must have opened char sheet whole the time if he want to catch the moment when DS/DM effect will end.

While this modification would allow the player to activate it any time, most players would still monitor the previous effect being end before they use it again because they would lost all their turn undead uses much more quickly.

The "exalted sorc" is a good example. With this build you can "tank" npc via the spamming divine shield continuosly. When you feel that the DS effect could end any time soon, you just start to spam it, you won't lose turn undead use and you can't be flanked neither flatfooded or interrupted while you doing this. Also you can do this if there is no spell that would work on the pack of monsters and you got someone to help you (summons/party). If you would use "attack" action, you could been flanked which means subject to death/sneak attack.

Curse song is similar if you would allowed it here, it would be considerably much powerfull as it could be used to kill the monsters via the sonic damage.

But if you really want it, then just remove the
if(GetHasFeatEffect(X) == FALSE)

line and add:

RemoveEffectsFromSpell(oTarget,GetSpellId());

under object oTarget declaration
               
               

               
            

Legacy_0pie

  • Jr. Member
  • **
  • Posts: 74
  • Karma: +0/-0
Ability Overwrite
« Reply #2 on: March 31, 2011, 09:10:04 am »


               Sweet that worked ! Thanks again ShaDoOoW. Now what about bardsong, I would like to do the same thing to it. Let the bard keep his song up on himself and his allies as long as he keeps singing with no down time. I looked up nw_s2_bardsong but was not able to find

" if(GetHasFeatEffect(x) == FALSE) "

I did find this though and i THINK it does the same thing but i could be wrong ?

if(!GetHasFeatEffect(FEAT_BARD_SONGS, oTarget) && !GetHasSpellEffect(GetSpellId(),oTarget))

i'm not sure if i delete that and put in your " RemoveEffectsFromSpell " line in somewher or what ?
               
               

               
            

Legacy_0pie

  • Jr. Member
  • **
  • Posts: 74
  • Karma: +0/-0
Ability Overwrite
« Reply #3 on: March 31, 2011, 03:36:02 pm »


               Also for Barbarian rage i see what stops me from re-raging is

if(!GetHasFeatEffect(FEAT_BARBARIAN_RAGE))

should I remove this line and add the line

RemoveEffectsFromSpell(oTarget,GetSpellId());

somewhere in it ?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Ability Overwrite
« Reply #4 on: March 31, 2011, 04:06:32 pm »


               

0pie wrote...
if(!GetHasFeatEffect(FEAT_BARD_SONGS, oTarget) && !GetHasSpellEffect(GetSpellId(),oTarget))

i'm not sure if i delete that and put in your " RemoveEffectsFromSpell " line in somewher or what ?

yes that should work

0pie wrote...

Also for Barbarian rage i see what stops me
from re-raging is

if(!GetHasFeatEffect(FEAT_BARBARIAN_RAGE))

should
I remove this line and add the line

RemoveEffectsFromSpell(oTarget,GetSpellId());

somewhere
in it ?

Why dont you just download community patch that contain this and like hundrets of fixes thorought all spell scripts?
               
               

               
            

Legacy_0pie

  • Jr. Member
  • **
  • Posts: 74
  • Karma: +0/-0
Ability Overwrite
« Reply #5 on: March 31, 2011, 05:31:16 pm »


               I did but it didn't change any of the scripts in my mod. I may have DL it wrong or something.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Ability Overwrite
« Reply #6 on: March 31, 2011, 05:43:56 pm »


               

0pie wrote...

I did but it didn't change any of the scripts in my mod. I may have DL it wrong or something.

Well I think that you installed it correctly, the patch do not change any scripts included in your module (which is intended). So if you or your previous scripter in past opened the barbarian rage and saved it in module then it replaces the 1.70's version.

You can:
1) delete the current barbarian rage script, but this way you lose any specific changes for your module so you would have to redo those changes into new script
2) get the 1.70 script version from "1.70 builder resources/1.70 spell scripts/Creature Abilities/nw_s1_barbrage.nss", compare it to your version and merge it (builder resources are included only in exe installation, if you installed it from zip/7z version, you should download it separately, its on vault page) OR open this script in new empty module
3) don't think about it '<img'> you don't have those new scripts, its recommended to merge them but not needed

So to do it manually, you need to remove the GetHasFeatEffect(FEAT_BARBARIAN_RAGE) line and add

RemoveEffectsFromSpell(OBJECT_SELF, GetSpellId());
RemoveEffectsFromSpell(OBJECT_SELF, SPELLABILITY_EPIC_MIGHTY_RAGE);

but keep in mind that if your barbarian rage script grants temporary hitpoints instead of the contitution increase, player could use the rage again just in moment he loses the temporary hitpoints from first rage application which would be quite overpowered

EDIT: if you are seeing in game a new icon for movement (reversed haste icon with purple color) you got patch installed correctly.
               
               

               


                     Modifié par ShaDoOoW, 31 mars 2011 - 04:46 .
                     
                  


            

Legacy_0pie

  • Jr. Member
  • **
  • Posts: 74
  • Karma: +0/-0
Ability Overwrite
« Reply #7 on: March 31, 2011, 06:09:22 pm »


               Thanks ShaDoOoW turns out I did install in i saw the haste movement icon.
               
               

               
            

Legacy_0pie

  • Jr. Member
  • **
  • Posts: 74
  • Karma: +0/-0
Ability Overwrite
« Reply #8 on: March 31, 2011, 06:20:50 pm »


                I'm having a hard time placing the line to remove the bardsong buff. Take a look at this is this ok ?

 while(GetIsObjectValid(oTarget))    {             // * GZ Oct 2003: If we are silenced, we can not benefit from bard song             if (!GetHasEffect(EFFECT_TYPE_SILENCE,oTarget) && !GetHasEffect(EFFECT_TYPE_DEAF,oTarget))             {                if(oTarget == OBJECT_SELF)                {                    effect eLinkBard = EffectLinkEffects(eLink, eVis);                    eLinkBard = ExtraordinaryEffect(eLinkBard);// Remove Effects so bard can sing again                    RemoveEffectsFromSpell(oTarget,GetSpellId());
                    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLinkBard, oTarget, RoundsToSeconds(nDuration));                    if (nHP > 0)                    {                        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHP, oTarget, RoundsToSeconds(nDuration));                    }                }                else if(GetIsFriend(oTarget))                {                    ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oTarget);                    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));                    if (nHP > 0)                    {                        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHP, oTarget, RoundsToSeconds(nDuration));                    }                }            }        }        oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF));
}
               
               

               
            

Legacy_0pie

  • Jr. Member
  • **
  • Posts: 74
  • Karma: +0/-0
Ability Overwrite
« Reply #9 on: March 31, 2011, 06:29:31 pm »


               well that is ugly lol how do i post code so its not all ugly like that ? ( sorry i'm a noob )
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Ability Overwrite
« Reply #10 on: March 31, 2011, 06:31:29 pm »


               

0pie wrote...

well that is ugly lol how do i post code so its not all ugly like that ? ( sorry i'm a noob )

put it into quote block

but you should add that line on line 394 in default script, wich is actually the position of the


        if(!GetHasFeatEffect(FEAT_BARD_SONGS, oTarget) && !GetHasSpellEffect(GetSpellId(),oTarget))
               
               

               


                     Modifié par ShaDoOoW, 31 mars 2011 - 05:33 .
                     
                  


            

Legacy_0pie

  • Jr. Member
  • **
  • Posts: 74
  • Karma: +0/-0
Ability Overwrite
« Reply #11 on: March 31, 2011, 06:54:21 pm »


               

#include "x0_i0_spells"
void main(){    if (GetHasEffect(EFFECT_TYPE_SILENCE,OBJECT_SELF))    {        FloatingTextStrRefOnCreature(85764,OBJECT_SELF); // not useable when silenced        return;    }    string sTag = GetTag(OBJECT_SELF);
    if (sTag == "x0_hen_dee" || sTag == "x2_hen_deekin")    {        // * Deekin has a chance of singing a doom song        // * same effect, better tune        if (Random(100) + 1 > 80)        {            // the Xp2 Deekin knows more than one doom song            if (d3() ==1 && sTag == "x2_hen_deekin")            {                DelayCommand(0.0, PlaySound("vs_nx2deekM_050"));            }            else            {                DelayCommand(0.0, PlaySound("vs_nx0deekM_074"));                DelayCommand(5.0, PlaySound("vs_nx0deekM_074"));            }        }    }

    //Declare major variables    int nLevel = GetLevelByclass(class_TYPE_BARD);    int nRanks = GetSkillRank(SKILL_PERFORM);    int nChr = GetAbilityModifier(ABILITY_CHARISMA);    int nPerform = nRanks;    int nDuration = 10; //+ nChr;
    effect eAttack;    effect eDamage;    effect eWill;    effect eFort;    effect eReflex;    effect eHP;    effect eAC;    effect eSkill;
    int nAttack;    int nDamage;    int nWill;    int nFort;    int nReflex;    int nHP;    int nAC;    int nSkill;    //Check to see if the caster has Lasting Impression and increase duration.    if(GetHasFeat(870))    {        nDuration *= 10;    }
    // lingering song    if(GetHasFeat(424)) // lingering song    {        nDuration += 20;    }
    //SpeakString("Level: " + IntToString(nLevel) + " Ranks: " + IntToString(nRanks));
    if(nPerform >= 100 && nLevel >= 30)    {        nAttack = 2;        nDamage = 3;        nWill = 3;        nFort = 2;        nReflex = 2;        nHP = 48;        nAC = 7;        nSkill = 19;    }    else if(nPerform >= 95 && nLevel >= 29)    {        nAttack = 2;        nDamage = 3;        nWill = 3;        nFort = 2;        nReflex = 2;        nHP = 46;        nAC = 6;        nSkill = 18;    }    else if(nPerform >= 90 && nLevel >= 28)    {        nAttack = 2;        nDamage = 3;        nWill = 3;        nFort = 2;        nReflex = 2;        nHP = 44;        nAC = 6;        nSkill = 17;    }    else if(nPerform >= 85 && nLevel >= 27)    {        nAttack = 2;        nDamage = 3;        nWill = 3;        nFort = 2;        nReflex = 2;        nHP = 42;        nAC = 6;        nSkill = 16;    }    else if(nPerform >= 80 && nLevel >= 26)    {        nAttack = 2;        nDamage = 3;        nWill = 3;        nFort = 2;        nReflex = 2;        nHP = 40;        nAC = 6;        nSkill = 15;    }    else if(nPerform >= 75 && nLevel >= 25)    {        nAttack = 2;        nDamage = 3;        nWill = 3;        nFort = 2;        nReflex = 2;        nHP = 38;        nAC = 6;        nSkill = 14;    }    else if(nPerform >= 70 && nLevel >= 24)    {        nAttack = 2;        nDamage = 3;        nWill = 3;        nFort = 2;        nReflex = 2;        nHP = 36;        nAC = 5;        nSkill = 13;    }    else if(nPerform >= 65 && nLevel >= 23)    {        nAttack = 2;        nDamage = 3;        nWill = 3;        nFort = 2;        nReflex = 2;        nHP = 34;        nAC = 5;        nSkill = 12;    }    else if(nPerform >= 60 && nLevel >= 22)    {        nAttack = 2;        nDamage = 3;        nWill = 3;        nFort = 2;        nReflex = 2;        nHP = 32;        nAC = 5;        nSkill = 11;    }    else if(nPerform >= 55 && nLevel >= 21)    {        nAttack = 2;        nDamage = 3;        nWill = 3;        nFort = 2;        nReflex = 2;        nHP = 30;        nAC = 5;        nSkill = 9;    }    else if(nPerform >= 50 && nLevel >= 20)    {        nAttack = 2;        nDamage = 3;        nWill = 3;        nFort = 2;        nReflex = 2;        nHP = 28;        nAC = 5;        nSkill = 8;    }    else if(nPerform >= 45 && nLevel >= 19)    {        nAttack = 2;        nDamage = 3;        nWill = 3;        nFort = 2;        nReflex = 2;        nHP = 26;        nAC = 5;        nSkill = 7;    }    else if(nPerform >= 40 && nLevel >= 18)    {        nAttack = 2;        nDamage = 3;        nWill = 3;        nFort = 2;        nReflex = 2;        nHP = 24;        nAC = 5;        nSkill = 6;    }    else if(nPerform >= 35 && nLevel >= 17)    {        nAttack = 2;        nDamage = 3;        nWill = 3;        nFort = 2;        nReflex = 2;        nHP = 22;        nAC = 5;        nSkill = 5;    }    else if(nPerform >= 30 && nLevel >= 16)    {        nAttack = 2;        nDamage = 3;        nWill = 3;        nFort = 2;        nReflex = 2;        nHP = 20;        nAC = 5;        nSkill = 4;    }    else if(nPerform >= 24 && nLevel >= 15)    {        nAttack = 2;        nDamage = 3;        nWill = 2;        nFort = 2;        nReflex = 2;        nHP = 16;        nAC = 4;        nSkill = 3;    }    else if(nPerform >= 21 && nLevel >= 14)    {        nAttack = 2;        nDamage = 3;        nWill = 1;        nFort = 1;        nReflex = 1;        nHP = 16;        nAC = 3;        nSkill = 2;    }    else if(nPerform >= 18 && nLevel >= 11)    {        nAttack = 2;        nDamage = 2;        nWill = 1;        nFort = 1;        nReflex = 1;        nHP = 8;        nAC = 2;        nSkill = 2;    }    else if(nPerform >= 15 && nLevel >= 8)    {        nAttack = 2;        nDamage = 2;        nWill = 1;        nFort = 1;        nReflex = 1;        nHP = 8;        nAC = 0;        nSkill = 1;    }    else if(nPerform >= 12 && nLevel >= 6)    {        nAttack = 1;        nDamage = 2;        nWill = 1;        nFort = 1;        nReflex = 1;        nHP = 0;        nAC = 0;        nSkill = 1;    }    else if(nPerform >= 9 && nLevel >= 3)    {        nAttack = 1;        nDamage = 2;        nWill = 1;        nFort = 1;        nReflex = 0;        nHP = 0;        nAC = 0;        nSkill = 0;    }    else if(nPerform >= 6 && nLevel >= 2)    {        nAttack = 1;        nDamage = 1;        nWill = 1;        nFort = 0;        nReflex = 0;        nHP = 0;        nAC = 0;        nSkill = 0;    }    else if(nPerform >= 3 && nLevel >= 1)    {        nAttack = 1;        nDamage = 1;        nWill = 0;        nFort = 0;        nReflex = 0;        nHP = 0;        nAC = 0;        nSkill = 0;    }    effect eVis = EffectVisualEffect(VFX_DUR_BARD_SONG);
    eAttack = EffectAttackIncrease(nAttack);    eDamage = EffectDamageIncrease(nDamage, DAMAGE_TYPE_BLUDGEONING);    effect eLink = EffectLinkEffects(eAttack, eDamage);
    if(nWill > 0)    {        eWill = EffectSavingThrowIncrease(SAVING_THROW_WILL, nWill);        eLink = EffectLinkEffects(eLink, eWill);    }    if(nFort > 0)    {        eFort = EffectSavingThrowIncrease(SAVING_THROW_FORT, nFort);        eLink = EffectLinkEffects(eLink, eFort);    }    if(nReflex > 0)    {        eReflex = EffectSavingThrowIncrease(SAVING_THROW_REFLEX, nReflex);        eLink = EffectLinkEffects(eLink, eReflex);    }    if(nHP > 0)    {        //SpeakString("HP Bonus " + IntToString(nHP));        eHP = EffectTemporaryHitpoints(nHP);//        eLink = EffectLinkEffects(eLink, eHP);    }    if(nAC > 0)    {        eAC = EffectACIncrease(nAC, AC_DODGE_BONUS);        eLink = EffectLinkEffects(eLink, eAC);    }    if(nSkill > 0)    {        eSkill = EffectSkillIncrease(SKILL_ALL_SKILLS, nSkill);        eLink = EffectLinkEffects(eLink, eSkill);    }    effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);    eLink = EffectLinkEffects(eLink, eDur);
    effect eImpact = EffectVisualEffect(VFX_IMP_HEAD_SONIC);    effect eFNF = EffectVisualEffect(VFX_FNF_LOS_NORMAL_30);    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eFNF, GetLocation(OBJECT_SELF));
    object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF));
    eHP = ExtraordinaryEffect(eHP);    eLink = ExtraordinaryEffect(eLink);
    while(GetIsObjectValid(oTarget))    {        RemoveEffectsFromSpell(oTarget,GetSpellId());
             // * GZ Oct 2003: If we are silenced, we can not benefit from bard song             if (!GetHasEffect(EFFECT_TYPE_SILENCE,oTarget) && !GetHasEffect(EFFECT_TYPE_DEAF,oTarget))             {                if(oTarget == OBJECT_SELF)                {                    effect eLinkBard = EffectLinkEffects(eLink, eVis);                    eLinkBard = ExtraordinaryEffect(eLinkBard);                    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLinkBard, oTarget, RoundsToSeconds(nDuration));                    if (nHP > 0)                    {                        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHP, oTarget, RoundsToSeconds(nDuration));                    }                }                else if(GetIsFriend(oTarget))                {                    ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oTarget);                    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));                    if (nHP > 0)                    {                        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHP, oTarget, RoundsToSeconds(nDuration));                    }                }            }        }        oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF));
}


This is my bardsong script, when I use song in game it lags a moment then gives me this error..

 " Script NW_s2_bardsong, OID: ffffffff , Tag: , ERROR: TOO MENY INSTRUCTIONS "

no idea what i did to cause this lol
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Ability Overwrite
« Reply #12 on: March 31, 2011, 07:41:03 pm »


               please try to post your script again or use another form like http://pastebin.com/

I cant read this and I wont mess with this half a hour in toolset

When I did the change I suggested to you in my temp module it worked fine...
               
               

               
            

Legacy_0pie

  • Jr. Member
  • **
  • Posts: 74
  • Karma: +0/-0
Ability Overwrite
« Reply #13 on: March 31, 2011, 08:03:23 pm »


               My Bardsong Script

pastebin.com/XHaLycWm
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Ability Overwrite
« Reply #14 on: March 31, 2011, 09:24:26 pm »


               fixed:

//::///////////////////////////////////////////////
//:: Bard Song
//:: NW_S2_BardSong
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    This spells applies bonuses to all of the
    bard's allies within 30ft for a set duration of
    10 rounds.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Feb 25, 2002
//:://////////////////////////////////////////////
//:: Last Updated By: Georg Zoeller Oct 1, 2003
/*
bugfix by Kovi 2002.07.30
- loosing temporary hp resulted in loosing the other bonuses
*/

#include "x0_i0_spells"

void main()
{
    if (GetHasEffect(EFFECT_TYPE_SILENCE,OBJECT_SELF))
    {
        FloatingTextStrRefOnCreature(85764,OBJECT_SELF); // not useable when silenced
        return;
    }
    string sTag = GetTag(OBJECT_SELF);

    if (sTag == "x0_hen_dee" || sTag == "x2_hen_deekin")
    {
        // * Deekin has a chance of singing a doom song
        // * same effect, better tune
        if (Random(100) + 1 > 80)
        {
            // the Xp2 Deekin knows more than one doom song
            if (d3() ==1 && sTag == "x2_hen_deekin")
            {
                DelayCommand(0.0, PlaySound("vs_nx2deekM_050"));
            }
            else
            {
                DelayCommand(0.0, PlaySound("vs_nx0deekM_074"));
                DelayCommand(5.0, PlaySound("vs_nx0deekM_074"));
            }
        }
    }


    //Declare major variables
    int nLevel = GetLevelByclass(class_TYPE_BARD);
    int nRanks = GetSkillRank(SKILL_PERFORM);
    int nChr = GetAbilityModifier(ABILITY_CHARISMA);
    int nPerform = nRanks;
    int nDuration = 10; //+ nChr;

    effect eAttack;
    effect eDamage;
    effect eWill;
    effect eFort;
    effect eReflex;
    effect eHP;
    effect eAC;
    effect eSkill;

    int nAttack;
    int nDamage;
    int nWill;
    int nFort;
    int nReflex;
    int nHP;
    int nAC;
    int nSkill;
    //Check to see if the caster has Lasting Impression and increase duration.
    if(GetHasFeat(870))
    {
        nDuration *= 10;
    }

    // lingering song
    if(GetHasFeat(424)) // lingering song
    {
        nDuration += 20;
    }

    //SpeakString("Level: " + IntToString(nLevel) + " Ranks: " + IntToString(nRanks));

    if(nPerform >= 100 && nLevel >= 30)
    {
        nAttack = 2;
        nDamage = 3;
        nWill = 3;
        nFort = 2;
        nReflex = 2;
        nHP = 48;
        nAC = 7;
        nSkill = 19;
    }
    else if(nPerform >= 95 && nLevel >= 29)
    {
        nAttack = 2;
        nDamage = 3;
        nWill = 3;
        nFort = 2;
        nReflex = 2;
        nHP = 46;
        nAC = 6;
        nSkill = 18;
    }
    else if(nPerform >= 90 && nLevel >= 28)
    {
        nAttack = 2;
        nDamage = 3;
        nWill = 3;
        nFort = 2;
        nReflex = 2;
        nHP = 44;
        nAC = 6;
        nSkill = 17;
    }
    else if(nPerform >= 85 && nLevel >= 27)
    {
        nAttack = 2;
        nDamage = 3;
        nWill = 3;
        nFort = 2;
        nReflex = 2;
        nHP = 42;
        nAC = 6;
        nSkill = 16;
    }
    else if(nPerform >= 80 && nLevel >= 26)
    {
        nAttack = 2;
        nDamage = 3;
        nWill = 3;
        nFort = 2;
        nReflex = 2;
        nHP = 40;
        nAC = 6;
        nSkill = 15;
    }
    else if(nPerform >= 75 && nLevel >= 25)
    {
        nAttack = 2;
        nDamage = 3;
        nWill = 3;
        nFort = 2;
        nReflex = 2;
        nHP = 38;
        nAC = 6;
        nSkill = 14;
    }
    else if(nPerform >= 70 && nLevel >= 24)
    {
        nAttack = 2;
        nDamage = 3;
        nWill = 3;
        nFort = 2;
        nReflex = 2;
        nHP = 36;
        nAC = 5;
        nSkill = 13;
    }
    else if(nPerform >= 65 && nLevel >= 23)
    {
        nAttack = 2;
        nDamage = 3;
        nWill = 3;
        nFort = 2;
        nReflex = 2;
        nHP = 34;
        nAC = 5;
        nSkill = 12;
    }
    else if(nPerform >= 60 && nLevel >= 22)
    {
        nAttack = 2;
        nDamage = 3;
        nWill = 3;
        nFort = 2;
        nReflex = 2;
        nHP = 32;
        nAC = 5;
        nSkill = 11;
    }
    else if(nPerform >= 55 && nLevel >= 21)
    {
        nAttack = 2;
        nDamage = 3;
        nWill = 3;
        nFort = 2;
        nReflex = 2;
        nHP = 30;
        nAC = 5;
        nSkill = 9;
    }
    else if(nPerform >= 50 && nLevel >= 20)
    {
        nAttack = 2;
        nDamage = 3;
        nWill = 3;
        nFort = 2;
        nReflex = 2;
        nHP = 28;
        nAC = 5;
        nSkill = 8;
    }
    else if(nPerform >= 45 && nLevel >= 19)
    {
        nAttack = 2;
        nDamage = 3;
        nWill = 3;
        nFort = 2;
        nReflex = 2;
        nHP = 26;
        nAC = 5;
        nSkill = 7;
    }
    else if(nPerform >= 40 && nLevel >= 18)
    {
        nAttack = 2;
        nDamage = 3;
        nWill = 3;
        nFort = 2;
        nReflex = 2;
        nHP = 24;
        nAC = 5;
        nSkill = 6;
    }
    else if(nPerform >= 35 && nLevel >= 17)
    {
        nAttack = 2;
        nDamage = 3;
        nWill = 3;
        nFort = 2;
        nReflex = 2;
        nHP = 22;
        nAC = 5;
        nSkill = 5;
    }
    else if(nPerform >= 30 && nLevel >= 16)
    {
        nAttack = 2;
        nDamage = 3;
        nWill = 3;
        nFort = 2;
        nReflex = 2;
        nHP = 20;
        nAC = 5;
        nSkill = 4;
    }
    else if(nPerform >= 24 && nLevel >= 15)
    {
        nAttack = 2;
        nDamage = 3;
        nWill = 2;
        nFort = 2;
        nReflex = 2;
        nHP = 16;
        nAC = 4;
        nSkill = 3;
    }
    else if(nPerform >= 21 && nLevel >= 14)
    {
        nAttack = 2;
        nDamage = 3;
        nWill = 1;
        nFort = 1;
        nReflex = 1;
        nHP = 16;
        nAC = 3;
        nSkill = 2;
    }
    else if(nPerform >= 18 && nLevel >= 11)
    {
        nAttack = 2;
        nDamage = 2;
        nWill = 1;
        nFort = 1;
        nReflex = 1;
        nHP = 8;
        nAC = 2;
        nSkill = 2;
    }
    else if(nPerform >= 15 && nLevel >= 8)
    {
        nAttack = 2;
        nDamage = 2;
        nWill = 1;
        nFort = 1;
        nReflex = 1;
        nHP = 8;
        nAC = 0;
        nSkill = 1;
    }
    else if(nPerform >= 12 && nLevel >= 6)
    {
        nAttack = 1;
        nDamage = 2;
        nWill = 1;
        nFort = 1;
        nReflex = 1;
        nHP = 0;
        nAC = 0;
        nSkill = 1;
    }
    else if(nPerform >= 9 && nLevel >= 3)
    {
        nAttack = 1;
        nDamage = 2;
        nWill = 1;
        nFort = 1;
        nReflex = 0;
        nHP = 0;
        nAC = 0;
        nSkill = 0;
    }
    else if(nPerform >= 6 && nLevel >= 2)
    {
        nAttack = 1;
        nDamage = 1;
        nWill = 1;
        nFort = 0;
        nReflex = 0;
        nHP = 0;
        nAC = 0;
        nSkill = 0;
    }
    else if(nPerform >= 3 && nLevel >= 1)
    {
        nAttack = 1;
        nDamage = 1;
        nWill = 0;
        nFort = 0;
        nReflex = 0;
        nHP = 0;
        nAC = 0;
        nSkill = 0;
    }
    effect eVis = EffectVisualEffect(VFX_DUR_BARD_SONG);

    eAttack = EffectAttackIncrease(nAttack);
    eDamage = EffectDamageIncrease(nDamage, DAMAGE_TYPE_BLUDGEONING);
    effect eLink = EffectLinkEffects(eAttack, eDamage);

    if(nWill > 0)
    {
        eWill = EffectSavingThrowIncrease(SAVING_THROW_WILL, nWill);
        eLink = EffectLinkEffects(eLink, eWill);
    }
    if(nFort > 0)
    {
        eFort = EffectSavingThrowIncrease(SAVING_THROW_FORT, nFort);
        eLink = EffectLinkEffects(eLink, eFort);
    }
    if(nReflex > 0)
    {
        eReflex = EffectSavingThrowIncrease(SAVING_THROW_REFLEX, nReflex);
        eLink = EffectLinkEffects(eLink, eReflex);
    }
    if(nHP > 0)
    {
        //SpeakString("HP Bonus " + IntToString(nHP));
        eHP = EffectTemporaryHitpoints(nHP);
//        eLink = EffectLinkEffects(eLink, eHP);
    }
    if(nAC > 0)
    {
        eAC = EffectACIncrease(nAC, AC_DODGE_BONUS);
        eLink = EffectLinkEffects(eLink, eAC);
    }
    if(nSkill > 0)
    {
        eSkill = EffectSkillIncrease(SKILL_ALL_SKILLS, nSkill);
        eLink = EffectLinkEffects(eLink, eSkill);
    }
    effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
    eLink = EffectLinkEffects(eLink, eDur);

    effect eImpact = EffectVisualEffect(VFX_IMP_HEAD_SONIC);
    effect eFNF = EffectVisualEffect(VFX_FNF_LOS_NORMAL_30);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eFNF, GetLocation(OBJECT_SELF));

    object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF));

    eHP = ExtraordinaryEffect(eHP);
    eLink = ExtraordinaryEffect(eLink);

    while(GetIsObjectValid(oTarget))
    {
        RemoveEffectsFromSpell(oTarget,GetSpellId());
             // * GZ Oct 2003: If we are silenced, we can not benefit from bard song
             if (!GetHasEffect(EFFECT_TYPE_SILENCE,oTarget) && !GetHasEffect(EFFECT_TYPE_DEAF,oTarget))
             {
                if(oTarget == OBJECT_SELF)
                {
                    effect eLinkBard = EffectLinkEffects(eLink, eVis);
                    eLinkBard = ExtraordinaryEffect(eLinkBard);
                    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLinkBard, oTarget, RoundsToSeconds(nDuration));
                    if (nHP > 0)
                    {
                        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHP, oTarget, RoundsToSeconds(nDuration));
                    }
                }
                else if(GetIsFriend(oTarget))
                {
                    ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oTarget);
                    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
                    if (nHP > 0)
                    {
                        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHP, oTarget, RoundsToSeconds(nDuration));
                    }
                }
            }
        oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF));
    }
}

You removed the bad brake (and you didnt had to removed them) so you made an endless loop.
               
               

               


                     Modifié par ShaDoOoW, 31 mars 2011 - 08:24 .