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 .





Retour en haut






