Author Topic: Recognizing feats for AOE damage spells  (Read 877 times)

Legacy_Imperator

  • Full Member
  • ***
  • Posts: 128
  • Karma: +0/-0
Recognizing feats for AOE damage spells
« on: May 13, 2016, 03:02:15 pm »


               

I'm attempting to fool around with aoe spells such as incendiary cloud, acid fog and cloudkill to make them better for conjuration based mages. Right now I'm just going about it with a very rough and elementary perspective..


 


so as a mage takes conjuration focuses, or in the case of incendiary cloud (evo focuses) they'll apply another damage effect for the on enter and the onHeartbeat.


 


 


But for some reason I can't get the script to recognize the fact that my mage has conjuration/evocation focuses.. does it have something to do with the fact that the script doesn't register "OBJECT_SELF" as the caster casting the spell? Or have I made some other oversight?


 


 


 


//::///////////////////////////////////////////////

//:: Cloudkill: On Enter

//:: NW_S0_CloudKillA.nss

//:: Copyright © 2001 Bioware Corp.

//:://////////////////////////////////////////////

/*

    All creatures with 3 or less HD die, those with

    4 to 6 HD must make a save Fortitude Save or die.

    Those with more than 6 HD take 1d10 Poison damage

    every round.

*/

//:://////////////////////////////////////////////

//:: Created By: Preston Watamaniuk

//:: Created On: May 17, 2001

//:://////////////////////////////////////////////


#include "X0_I0_SPELLS"


void main()

{



    //Declare major variables

    object oTarget = GetEnteringObject();

    int nHD = GetHitDice(oTarget);

    effect eDeath = EffectDeath();

    effect eVis =   EffectVisualEffect(VFX_IMP_DEATH);

    effect eNeg = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);

    effect eSpeed = EffectMovementSpeedDecrease(50);

    effect eVis2 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);

    effect eLink = EffectLinkEffects(eSpeed, eVis2);


    float fDelay= GetRandomDelay(0.5, 1.5);

    effect eDam;

    int nDam = d10();

    int nMetaMagic = GetMetaMagicFeat();


    int HasSFConj = GetHasFeat(FEAT_SPELL_FOCUS_CONJURATION, OBJECT_SELF);

    int HasGSFConj = GetHasFeat(FEAT_GREATER_SPELL_FOCUS_CONJURATION, OBJECT_SELF);

    int HasESFConj = GetHasFeat(FEAT_EPIC_SPELL_FOCUS_CONJURATION, OBJECT_SELF);





    //Enter Metamagic conditions

    if (nMetaMagic == METAMAGIC_MAXIMIZE)

    {

        nDam = 10;//Damage is at max

    }

    else if (nMetaMagic == METAMAGIC_EMPOWER)

    {

        nDam =  nDam + (nDam/2); //Damage/Healing is +50%

    }

    eDam = EffectDamage(nDam, DAMAGE_TYPE_ACID);

    if(spellsIsTarget(oTarget,SPELL_TARGET_STANDARDHOSTILE , GetAreaOfEffectCreator()) )

    {

        //Fire cast spell at event for the specified target

        SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CLOUDKILL));

        //Make SR Check

        if(!MyResistSpell(GetAreaOfEffectCreator(), oTarget, fDelay))

        {

            //Determine spell effect based on the targets HD

            if (nHD <= 3)

            {

                if(!GetIsImmune(oTarget, IMMUNITY_TYPE_DEATH))

                {

                    DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));

                    DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget));

                }

            }

            else if (nHD >= 4 && nHD <= 6)

            {

                //Make a save or die

                if(!MySavingThrow(SAVING_THROW_FORT, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_DEATH, OBJECT_SELF, fDelay))

                {

                    DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget));

                    DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));

                }

                else

                {

            if(HasESFConj == TRUE)

            {

            nDam = d10(1); //for testing

            DelayCommand(fDelay+0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay+0.2, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay+0.3, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay+0.4, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eNeg, oTarget));


            }

            else if(HasGSFConj == TRUE)

            {

            nDam = d10(1); //for testing

            DelayCommand(fDelay+0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay+0.2, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay+0.3, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eNeg, oTarget));


            }

            else if(HasSFConj == TRUE)

            {

            nDam = d10(1); //for testing

            DelayCommand(fDelay+0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay+0.2, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eNeg, oTarget));


            }

            else

            {

            nDam = d10(1); //for testing

            //Apply VFX impact and damage

            DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eNeg, oTarget));

            }



                    if(!MySavingThrow(SAVING_THROW_FORT, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_NONE, OBJECT_SELF, fDelay))

                    {

                        ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSpeed, oTarget);

                    }

                }

            }

            else

            {


            if(HasESFConj == TRUE)

            {

            nDam = d10(1);  //for testing

            DelayCommand(fDelay+0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay+0.2, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay+0.3, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay+0.4, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eNeg, oTarget));

            ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSpeed, oTarget);

            }

            else if(HasGSFConj == TRUE)

            {

            nDam = d10(1); //for testing

            DelayCommand(fDelay+0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay+0.2, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay+0.3, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eNeg, oTarget));

            ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSpeed, oTarget);

            }

            else if(HasSFConj == TRUE)

            {

            nDam = d10(1);//for testing

            DelayCommand(fDelay+0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay+0.2, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eNeg, oTarget));

            ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSpeed, oTarget);

            }            

            else

            {

            nDam = d10(1); //for testing

            //Apply VFX impact and damage

            DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));

            DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eNeg, oTarget));

            ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSpeed, oTarget);


            }



            }

        }

    }

}



               
               

               
            

Legacy_Terrorble

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Recognizing feats for AOE damage spells
« Reply #1 on: May 13, 2016, 04:22:11 pm »


               

You might try GetAreaOfEffectCreator() to get the person who cast the spell.  OBJECT_SELF works in the script that casts the spell and creates the AOE, but for the OnEnter, Heartbeat, OnExit scripts I think OBJECT_SELF refers to the AOE object itself and not the caster who cast it.



               
               

               
            

Legacy_Imperator

  • Full Member
  • ***
  • Posts: 128
  • Karma: +0/-0
Recognizing feats for AOE damage spells
« Reply #2 on: May 13, 2016, 04:56:23 pm »


               

Thanks for the reply, I thought it might be something technical like that but I wasn't sure.