Author Topic: Scaling Mummy Dust & Dragon Knight  (Read 1955 times)

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Scaling Mummy Dust & Dragon Knight
« Reply #30 on: May 10, 2015, 01:00:30 am »


               

Yeah, edited above to be GetCasterLevel(OBJECT_SELF);



               
               

               
            

Legacy_Nic Mercy

  • Full Member
  • ***
  • Posts: 154
  • Karma: +0/-0
Scaling Mummy Dust & Dragon Knight
« Reply #31 on: May 10, 2015, 02:04:43 am »


               


Yeah, edited above to be GetCasterLevel(OBJECT_SELF);




 


 


Works perfectly for the palemaster levels ty so much! Only issue is the Druid aspect doesn't seem to be working. Casting mummy dust as a druid should spawn the treant but is spawning the mummy instead.



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Scaling Mummy Dust & Dragon Knight
« Reply #32 on: May 10, 2015, 05:14:44 am »


               

Add a debugging line to the end of the script to help ascertain the problem.


 


Something like this


 


SendMessageToPC(OBJECT_SELF, "Class: " + IntToString(nClass));
SendMessageToPC(OBJECT_SELF, "Caster Level: " + IntToString(nCasterLevel));


               
               

               
            

Legacy_Nic Mercy

  • Full Member
  • ***
  • Posts: 154
  • Karma: +0/-0
Scaling Mummy Dust & Dragon Knight
« Reply #33 on: May 10, 2015, 01:23:39 pm »


               

The debugging results are:


 


Class: 255


Caster level: 0


 


Upon further testing with lower level spellcasters it seems the same results are occuring. They get the highest level summon and its always the mummy regardless of class or level.


 


I've reverted to my old script using your initial suggestion to count the palemaster levels and it works perfectly. I also was able to use what I saw in your script to make my Dragon Knight spell add half of the palemaster levels as well! So at least I have them functional if not elegant.



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Scaling Mummy Dust & Dragon Knight
« Reply #34 on: May 10, 2015, 07:01:37 pm »


               


The debugging results are:


 


Class: 255


Caster level: 0


 


Upon further testing with lower level spellcasters it seems the same results are occuring. They get the highest level summon and its always the mummy regardless of class or level.


 


I've reverted to my old script using your initial suggestion to count the palemaster levels and it works perfectly. I also was able to use what I saw in your script to make my Dragon Knight spell add half of the palemaster levels as well! So at least I have them functional if not elegant.




 


This suggests that your epic spells are being cast through items.  Nothing wrong with that, you just need to delete the item cast lines I provided.



if(GetIsObjectValid(oItem))
          {
          nCasterLevel = GetCasterLevel(OBJECT_SELF);
          nClass = CLASS_TYPE_INVALID;
          }

Also if 005 is your highest summon, and not a default for being cast from an unknown source then I would suggest the following revision



#include "prc_alterations"
#include "x2_inc_spellhook"
#include "inc_epicspells"
 
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY);

    /*
      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;
        }

    if (GetCanCastSpell(OBJECT_SELF, MUMDUST_DC, MUMDUST_S, MUMDUST_XP))
    {
        //Declare major variables

        int nDuration = 24;

        //effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);

        effect eSummon;

        //NC:EDIT
        // Add check for druid for different summon
        //KA: EDIT
        // Add summon scaling every five levels and allowed ALL Palemaster levels
        // to be counted towards caster level for the spell.
        int nClass = GetLastSpellCastClass();
        int nCasterLevel = GetLevelByClass(nClass);
        object oItem = GetSpellCastItem();
        string sSummon = "s_morglord_001";
        switch (nClass)
          {
          case CLASS_TYPE_WIZARD:
          case CLASS_TYPE_SORCERER:
          case CLASS_TYPE_BARD:
             nCasterLevel += GetLevelByClass(CLASS_TYPE_PALEMASTER);
             break;         
          case CLASS_TYPE_PALEMASTER:
            if(GetLevelByClass(CLASS_TYPE_WIZARD) > GetLevelByClass(CLASS_TYPE_SORCERER))
                nCasterLevel += GetLevelByClass(CLASS_TYPE_WIZARD);
            else
                nCasterLevel += GetLevelByClass(CLASS_TYPE_SORCERER);
            break;
          }
       int iEpicIndex = (nCasterLevel - 15)/5;
       if(iEpicIndex > 5)
           iEpicIndex = 5;
       if(iEpicIndex < 1)
           iEpicIndex =1;
       switch(nClass)
          {
          case CLASS_TYPE_WIZARD:
          case CLASS_TYPE_SORCERER:
          case CLASS_TYPE_CLERIC:
          case CLASS_TYPE_PALEMASTER:
             sSummon = "s_morglord_00" + IntToString(iEpicIndex);
             break;
          case CLASS_TYPE_DRUID:
             sSummon = "s_treant_00" + IntToString(iEpicIndex);
             break;
         }
          
        //NC:EDIT

        //Summon the appropriate creature based on the summoner level
        //Warrior Mummy
        //NC:EDIT
        //Treant Druid only

        eSummon = EffectSummonCreature(sSummon,496,1.0f);

        //NC:EDIT

        eSummon = ExtraordinaryEffect(eSummon);

        //Apply the summon visual and summon the undead.
        //ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetSpellTargetLocation());

        ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(nDuration));
    }
    DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}


               
               

               
            

Legacy_Nic Mercy

  • Full Member
  • ***
  • Posts: 154
  • Karma: +0/-0
Scaling Mummy Dust & Dragon Knight
« Reply #35 on: May 10, 2015, 10:23:43 pm »


               

Ah because I am using the same custom epic spell system that the prc uses, epic spells are learned outside of choosing feats in the standard nwn. In this system the spells are learned through research (much closer to pnp style) and are dynamically assigned or removed from the epic spell menu (by virtue of a pc skin) so I guess technically speaking the spells are cast via an item (via a feat dynamically applied to the pc skin).