Author Topic: Modifying the OC - Need more loot  (Read 908 times)

Legacy_Mordaedil

  • Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Modifying the OC - Need more loot
« on: August 29, 2015, 02:43:53 pm »


               

I've decided to finally spice up my experience with the NWN OC campaigns and done the tiresome work of upgrading them all with the Player's Resource Consortium package, which I feel adds a ton of options and fun stuff for me to experiment with (I also made backups of the campaigns without these, so no worries on that end)


 


But now I'm in a bit of a fix, because the OC is of course not created with this in mind and whenever I find loot or go visit stores they all lack anything added by this mod package entirely. While I recognize I could always go in and add these myself in the toolset, I feel it'd sort of ruin the surprise of discovering new toys to play with.


 


What I guess I am asking for is if there is a known way to add the stuff from PRC to the modules as a package download, or given that is not existing, what I'd have to look for to add the spells and whatever else to the loot tables.


 


Thanks in advance.



               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Modifying the OC - Need more loot
« Reply #1 on: August 30, 2015, 07:27:11 pm »


               

Change the modules to use the XP1 Treasure system, add a "Setup" area to each module that PCs can't access, drop in the module wide loot chests, then add the PRC items to the chests.


 


Full documentation for the system is included in x0_i0_treasure.


 


Since the placeables that drop loot already have scripts, you'll then have to modify them to use the new system by changing the associated scripts. You don't need to do all of them, just a few, as both systems can be used within the same module.



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Modifying the OC - Need more loot
« Reply #2 on: August 31, 2015, 07:03:50 pm »


               

Well not bad idea Pstemarie, but I think there would be better the HoMaM3 Wake of Gods method. That is, modify vanila scripts in a way they will first spawn normal treasure, then roll some chance whether the item (if any) wil be replaced by something with similar value from list of PRC items and do the exchange.


 


This solution wouldn't require more than few files in override and someone who will prepare a system chest with all PRC items. But I dont have time to do this + I have too much stuff on vault already...



               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Modifying the OC - Need more loot
« Reply #3 on: August 31, 2015, 08:41:17 pm »


               


Well not bad idea Pstemarie, but I think there would be better the HoMaM3 Wake of Gods method. That is, modify vanila scripts in a way they will first spawn normal treasure, then roll some chance whether the item (if any) wil be replaced by something with similar value from list of PRC items and do the exchange.


 


This solution wouldn't require more than few files in override and someone who will prepare a system chest with all PRC items. But I dont have time to do this + I have too much stuff on vault already...




 


Yeah I was leaning that way with my response when I started typing it, but then I saw the number of scripts I'd have to list out - too much to do, so little time  '<img'>


               
               

               
            

Legacy_Mordaedil

  • Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Modifying the OC - Need more loot
« Reply #4 on: September 06, 2015, 09:37:13 pm »


               

I dug into the scripts for NWN OC, dug out the script NW_O2_CONINCLUDE and dug out the following bit, which is the main point of interest:



    // * nModifier is to 'raise' the level of the oAdventurer
    void CreateArcaneScroll(object oTarget, object oAdventurer, int nModifier = 0)
    {
        int nMaxSpells = 21;
        int nHD = GetHitDice(oAdventurer) + nModifier;
        int nScroll = 1;
        int nLevel = 1;

        if (GetRange(1, nHD))           // l 1-2
        {
          nLevel = d2();
          nScroll =  Random(nMaxSpells) + 1;
        }
        else if (GetRange(2, nHD))      // l 1-4
        {
          nLevel = d4();
          nScroll =  Random(nMaxSpells) + 1;
        }
        else if (GetRange(3, nHD))    // l 2-6
        {
          nLevel = d6();
          if (nLevel < 2) nLevel = 2;

          nScroll =  Random(nMaxSpells) + 1;
        }
        else if (GetRange(4, nHD))   // l 3-8
        {
          nLevel = d8();
          if (nLevel < 3) nLevel = 3;

          nScroll =  Random(nMaxSpells) + 1;
        }
        else if (GetRange(5, nHD))   // l 4-9
        {
          nLevel = d8() + 1;
          if (nLevel < 4) nLevel = 4;

          nScroll =  Random(nMaxSpells) + 1;
        }
        else if (GetRange(6, nHD))   // 5 -9
        {
          nLevel = d8() + 1;
          if (nLevel < 5) nLevel = 5;

          nScroll =  Random(nMaxSpells) + 1;
        }

        // * Trims the level of the scroll to match the max # of scrolls in each level range
        nScroll = TrimLevel(nScroll, nLevel);

        string sRes = "nw_it_sparscr216";

        if (nScroll < 10)
        {
            sRes = "NW_IT_SPARSCR" + IntToString(nLevel) + "0" + IntToString(nScroll);
        }
        else
        {
            sRes = "NW_IT_SPARSCR" + IntToString(nLevel) + IntToString(nScroll);
        }
          dbCreateItemOnObject(sRes, oTarget, 1);
        }


Wow, I thought, this looks like it'd be a zinch to just make a small alteration to to allow it to also grant PRC scrolls and the like without too much work.


 


But then I looked at the blueprints for the PRC scrolls. They are a mess. There is no consistant naming scheme in them and there's roughly like a thousand of them.


 


The place where it breaks down hardest is how they took care in giving all blueprints in the OC an integer representing spell level before assigning a two-digit number. The PRC assigns their spells a 4-digit number and to top it off do not provide consistant naming scheme.


 


"Acid Splash" is prc_scr_355. "Animalistic Power" is nw_it_sparscr232(kinda odd this doesn't show up). "Arrow of Bone" is prc_scr_1331.


 


Maybe there is system to the madness, but I could use some help seeing some way to twist this for ease of use.



               
               

               
            

Legacy_Mordaedil

  • Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Modifying the OC - Need more loot
« Reply #5 on: September 08, 2015, 10:01:37 pm »


               

So, it turns out you actually have an in-game option to flat-out buy any spell at will, so it doesn't technically need to be a part of standard loot.


 


If anyone is interested, however, I designed this script to sort of add the expansion spells to the loot table for the OC.


 


Not that I expect there to be a huge demand.



    // * nModifier is to 'raise' the level of the oAdventurer
    void CreateArcaneScroll(object oTarget, object oAdventurer, int nModifier = 0)
    {
        int nMaxSpells = 21;
        int nHD = GetHitDice(oAdventurer) + nModifier;
        int nScroll = 1;
        int nLevel = 1;

        if (GetRange(1, nHD))           // l 1-2
        {
          nLevel = d2();
          nScroll =  Random(nMaxSpells) + 1;
        }
        else if (GetRange(2, nHD))      // l 1-4
        {
          nLevel = d4();
          nScroll =  Random(nMaxSpells) + 1;
        }
        else if (GetRange(3, nHD))    // l 2-6
        {
          nLevel = d6();
          if (nLevel < 2) nLevel = 2;

          nScroll =  Random(nMaxSpells) + 1;
        }
        else if (GetRange(4, nHD))   // l 3-8
        {
          nLevel = d8();
          if (nLevel < 3) nLevel = 3;

          nScroll =  Random(nMaxSpells) + 1;
        }
        else if (GetRange(5, nHD))   // l 4-9
        {
          nLevel = d8() + 1;
          if (nLevel < 4) nLevel = 4;

          nScroll =  Random(nMaxSpells) + 1;
        }
        else if (GetRange(6, nHD))   // 5 -9
        {
          nLevel = d8() + 1;
          if (nLevel < 5) nLevel = 5;

          nScroll =  Random(nMaxSpells) + 1;
        }

        // * Trims the level of the scroll to match the max # of scrolls in each level range
        nScroll = TrimLevel(nScroll, nLevel);

   string sExp = "NW_";
   int nExp = Random(100);
        string sRes = "nw_it_sparscr216";

   if (nExp >= 90)
   {
      sExp = "X2_";
   }
   else if (nExp >= 75)
   {
      sExp = "X1_";
   }

        if (nScroll < 10)
        {
            sRes = sExp + "IT_SPARSCR" + IntToString(nLevel) + "0" + IntToString(nScroll);
        }
        else
        {
            sRes = sExp + "IT_SPARSCR" + IntToString(nLevel) + IntToString(nScroll);
        }
          dbCreateItemOnObject(sRes, oTarget, 1);
        }