Aller au contenu

Photo

Help with de-levelling script/Not applying default packages


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
Shockwolf

Shockwolf
  • Members
  • 26 messages
Hi

My scripting is limited and I'm using something I generated in my demo module to strip any pre-configured characters imported into the game via the party GUI of all gear and levels.   It reduces them to level 1.  However the thing I don't like about it is that it sets the characters first chosen class to a default package.

Is there any way of scripting this so that it doesn't do that?  Can it be scripted to set the level to 1 with the packages/custom configuration that were chosen by the player in the first place or perhaps allow them to reselect everything at level one?

 

This is the script I am using…

#include "ginc_debug"
#include "ginc_misc"

const string GUI_PARTY_GEN_XML = "partygen.xml";
const string GUI_PARTY_GEN_SCREEN = "SCREEN_PARTY_GEN";

void main()
{

object oPC = GetEnteringObject();

//if (!GetIsPC(oPC)) return;

object oItem;
oItem = GetFirstItemInInventory(oPC);

while (GetIsObjectValid(oItem))
   {
   if (GetPlotFlag(oItem))
      SetPlotFlag(oItem, FALSE);

   DestroyObject(oItem);

   oItem = GetNextItemInInventory(oPC);
   }

int nInt;
for (nInt=0; nInt<NUM_INVENTORY_SLOTS; nInt++)
   {
   oItem = GetItemInSlot(nInt, oPC);

   if (GetPlotFlag(oItem))
         SetPlotFlag(oItem, FALSE);

   DestroyObject(oItem);
   }

AssignCommand(oPC, TakeGoldFromCreature(GetGold(oPC), oPC, TRUE));
int nXP = GetPCAverageXP();
    ResetCreatureLevelForXP( oPC, 0, FALSE );
    ForceRest( oPC );
    DelayCommand(10.0, ExecuteScript("myk_handouts_@_start", OBJECT_SELF));
   
    if (!GetIsPC(oPC)) return;
    PrettyDebug("Party gen screen opening.");
    DisplayGuiScreen(oPC, GUI_PARTY_GEN_SCREEN, FALSE, GUI_PARTY_GEN_XML);

}
 



Thanks in advance.

Modifié par Shockwolf, 17 juillet 2010 - 03:40 .


#2
Morbane

Morbane
  • Members
  • 1 883 messages
Try using SetXP() function - then force rest - it does not choose the package just the XP.

#3
Shockwolf

Shockwolf
  • Members
  • 26 messages
Thanks Morbane!

#4
Shockwolf

Shockwolf
  • Members
  • 26 messages
I think it's working, though I can't really tell. lol

Modifié par Shockwolf, 17 juillet 2010 - 04:53 .


#5
Morbane

Morbane
  • Members
  • 1 883 messages
If you need to be sure about the package - set the XP at 1000 for a trial run - I am pretty sure the original package stays.

If you have an editor or hero builder - you can make a high(er) level char with an obscure package style then reset them to level 1 - that would be a decent test...

Modifié par Morbane, 17 juillet 2010 - 06:30 .


#6
Shockwolf

Shockwolf
  • Members
  • 26 messages
Yep, it definately appears to be working to me now.



Thanks again. :)